Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

MCPRequestHandler

Swift
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust Unavailable
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift

API reference · Markdown

struct MCPRequestHandler : struct MCPRequestHandler
struct [source]
struct [source]
struct MCPRequestHandler

Answers MCP requests, one line at a time, without touching a file descriptor.

Discussed in Swift MCP API

Members

protocolVersions

protocolVersions : static let protocolVersions: [String]
propertystatic [source]
propertystatic [source]
protocolVersions

The revisions this server speaks, newest first.

A client's requested revision is echoed back when it is one of these, so a new client is not held to an old shape and an old one is not handed a new one. Anything unrecognised gets the newest, which is what the specification says to do.

protocolVersion

protocolVersion : static var protocolVersion: String
propertystatic [source]
propertystatic [source]
protocolVersion

serverName

serverName : static let serverName: String
propertystatic [source]
propertystatic [source]
serverName

serverVersion

serverVersion : static let serverVersion: String
propertystatic [source]
propertystatic [source]
serverVersion

init(tools:)

init(tools:) ( tools : TmuxTools )
method [source]
method [source]
init(tools:)

respond(to:emit:)

respond(to:emit:) ( to : String , emit : @escaping (String) async -> Void ) → String?
methodasync [source]
methodasync [source]
respond(to:emit:)

Answers one newline-delimited JSON-RPC request.

Returns the response line, or nil for a valid notification or an oversized request. Malformed JSON, invalid request objects, and request ids that cannot fit in a bounded response receive the standard JSON-RPC error with a null id.

  • Parameters:
    • line: one JSON-RPC request without its trailing newline.
    • emit: where a notification sent *before* the answer goes — progress, while a long call is still running. Writing them is the caller's job because they share the one stdout the answer uses, and two writers there would interleave.
Esc

Type to search.