jeevesagent.mcp.registry

ToolHost backed by N MCP servers.

The registry connects all clients in parallel through an anyio.create_task_group, builds a name index, and routes calls.

Tool name collisions across servers are auto-disambiguated:

  • If a tool name is unique across all servers, agents see the bare name (get_weather).

  • If two servers expose the same name, both are registered as server.tool (city_api.get_weather, noaa.get_weather).

Either form is accepted at call time.

Classes

MCPRegistry

Aggregates many MCPClient instances into a single ToolHost.

Module Contents

class jeevesagent.mcp.registry.MCPRegistry(items: list[jeevesagent.mcp.spec.MCPServerSpec | jeevesagent.mcp.client.MCPClient] | None = None)[source]

Aggregates many MCPClient instances into a single ToolHost.

async aclose() None[source]
async call(tool: str, args: collections.abc.Mapping[str, Any], *, call_id: str = '') jeevesagent.core.types.ToolResult[source]
async connect() None[source]

Connect every client in parallel and rebuild the index.

async list_tools(*, query: str | None = None) list[jeevesagent.core.types.ToolDef][source]
async refresh() None[source]

Re-pull tool lists from every client and rebuild the index.

async watch() collections.abc.AsyncIterator[jeevesagent.core.types.ToolEvent][source]

listChanged notifications. Not yet implemented; yields nothing.

property server_names: list[str]