Skip to main content

Module mcp

Module mcp 

Source
Expand description

MCP (Model Context Protocol) client — stdio and HTTP+SSE transport, JSON-RPC 2.0.

Supports the bounded subset needed for tool proxy:

  • initialize / initialized handshake
  • tools/list to discover tools
  • tools/call to invoke them

Also supports:

  • resources/list and resources/read
  • prompts/list and prompts/get

Structs§

JsonRpcError
A JSON-RPC 2.0 error object.
JsonRpcRequest
A JSON-RPC 2.0 request.
JsonRpcResponse
A JSON-RPC 2.0 response.
McpClient
An MCP client owns a transport and manages JSON-RPC communication.
McpPrompt
A prompt template exposed by an MCP server.
McpPromptArgument
An argument to an MCP prompt template.
McpPromptMessage
A message in an MCP prompt response.
McpResource
A resource exposed by an MCP server.
McpResourceContent
Content returned from reading an MCP resource.
McpServer
Configuration for a single MCP server.
McpServerConfig
Configuration for a single MCP server in the Claude Code .mcp.json format.
McpTool
A tool that wraps an MCP server tool. Registered with a namespaced name mcp__<server_name>__<tool_name>.
McpToolSpec
A tool spec as returned by the MCP server’s tools/list.
ServerCapabilities
Capabilities advertised by an MCP server during the initialize handshake.

Functions§

discover_mcp_servers
Discover MCP server configurations from the workspace.
dispatch_request
Dispatch a JSON-RPC request to the appropriate handler.
load_mcp_config
Load MCP server configurations from a JSON file. Expected format: