mcp.transport.coordinator

Undocumented in source.

Members

Classes

DuplexCoordinator
class DuplexCoordinator

Correlates outbound JSON-RPC requests with the peer's responses on a single duplex byte channel (the MCP **stdio** transport, where both directions share one stream). It is the symmetric, transport-neutral counterpart to the Streamable HTTP transport's StreamCoordinator (which matches a server->client request with the client's reply that arrives on a *separate* POST), used by DuplexChannel for BOTH peers:

Functions

throwOrReturn
Json throwOrReturn(Json result, Json error, string defaultMsg)

Resolve a settled waiter's outcome into a value or an exception: if error is a JSON-RPC error object, throw McpException decoded from its code (defaulting to internalError) and message (defaulting to defaultMsg); otherwise return result. Shared by every coordinator's await path so the error decoding lives in one place.