Skip to main content

Module client

Module client 

Source
Expand description

MCP client over the Streamable HTTP transport. No local process is ever spawned: a server is reached over a socket or not at all.

One client connects one remote server (https/http/unix/vsock) and covers the client subset agentd needs: initialize + capability store, tools (list+call), resources (list+read), subscribe/unsubscribe, ping. Client capabilities are declared only when a host handler can actually answer them.

Each request is one POST of a JSON-RPC frame over a fresh connection (the per-request socket timeout is the per-call bound); the response is application/json or an SSE stream. Server→client notifications ride a long-lived GET SSE stream, opened lazily on the first subscribe — a background thread pumps them into a queue [Self::drain_notifications] serves.

Structs§

McpClient
A connected (and, after McpClient::initialize, handshaken) remote MCP server over Streamable HTTP.

Enums§

McpError