jeevesagent.mcp.client¶
Per-server MCP client wrapping mcp.ClientSession lifetime.
The mcp SDK is imported lazily inside MCPClient.connect().
Tests can bypass the real connection entirely by passing a
session= kwarg whose object exposes the methods we use:
initialize(), list_tools(), call_tool(name, args).
Classes¶
One client per MCP server. Holds the live |
Module Contents¶
- class jeevesagent.mcp.client.MCPClient(spec: jeevesagent.mcp.spec.MCPServerSpec, *, session: Any | None = None)[source]¶
One client per MCP server. Holds the live
ClientSession.- async call_tool(name: str, args: dict[str, Any]) Any[source]¶
Invoke
namewithargs. Returns the SDK’s CallToolResult.
- async connect() None[source]¶
Open the transport and initialise the session.
No-op if already connected (or a fake session was injected at construction time).
- async list_tools() list[Any][source]¶
Return whatever the SDK gave us — a list of tool descriptors.
Each descriptor has
name,description,inputSchema. We don’t translate toToolDefhere — the registry does that, since it also assigns names with disambiguation.
- property spec: jeevesagent.mcp.spec.MCPServerSpec¶