mcp.client.transport

Undocumented in source.

Members

Classes

SubscriptionStream (from mcp.client.subscription)
class SubscriptionStream via public import mcp.client.subscription : SubscriptionStream, SubscriptionFilter;

A handle to an open subscriptions/listen stream. The stream runs on a background task, dispatching the leading notifications/subscriptions/acknowledged and every subsequent opted-in change notification to the client's onNotification (and onProgress). Call cancel() (alias close()) to stop listening; the background task then closes the connection and terminates.

Interfaces

ClientProtocol
interface ClientProtocol

The protocol-side collaborator an McpClient hands to its transport at construction (ClientTransport.setProtocol). It lets the transport pull the protocol-derived request headers and consult the cancelled-request set without knowing anything about the client's draft state, tool inputSchema cache, or cancellation bookkeeping — and without the transport having to be a concrete HttpClientTransport the client downcasts to. McpClient implements this interface.

ClientTransport
interface ClientTransport

The transport seam under McpClient. The client speaks pure JSON-RPC and protocol logic; a ClientTransport carries the bytes — over Streamable HTTP (HttpClientTransport) or stdio (StdioClientTransport).

Structs

SubscriptionFilter (from mcp.client.subscription)
struct SubscriptionFilter via public import mcp.client.subscription : SubscriptionStream, SubscriptionFilter;

The set of change-notification types a draft client opts into when opening a subscriptions/listen stream (draft basic/utilities/subscriptions). The three list-changed booleans request notifications/tools|prompts|resources/list_changed; resourceSubscriptions lists the resource URIs the client wants notifications/resources/updated for. This is serialised under params.notifications (a SubscriptionFilter) by subscriptionsListen.