Module client

Module client 

Source
Expand description

MCP Client — connects to external MCP servers and invokes tools.

Supports two transports:

  • stdio: spawns a child process, communicates via JSON-RPC over stdin/stdout.
  • http: sends JSON-RPC requests over HTTP POST (Streamable HTTP transport).

The client performs the MCP initialize/initialized handshake, discovers tools via tools/list, and invokes tools via tools/call.

Structs§

McpClient
An active connection to a single MCP server.
McpClientRegistry
Global registry of active MCP client connections, keyed by server name.

Functions§

get_mcp_client_registry
Get the global MCP client registry.