jeevesagent.jeeves.client

JeevesGateway — convenience wrapper around the Jeeves MCP gateway.

The class is itself a ToolHost; it lazy-builds a one-server MCPRegistry on first use and forwards every protocol method to it. That means three usage patterns work out of the box:

  • One-liner — drop straight into Agent:

    Agent("...", tools=JeevesGateway.from_env())
    
  • Compose with other MCP servers:

    MCPRegistry([
        JeevesGateway.from_env().as_mcp_server(),
        MCPServerSpec.stdio("git", "uvx", ["mcp-server-git"]),
    ])
    
  • Build the registry directly for explicit lifecycle management:

    gateway = JeevesGateway.from_env()
    registry = gateway.as_registry()
    async with registry:
        ...
    

Attributes

Classes

JeevesConfig

Connection details for the Jeeves Gateway.

JeevesGateway

ToolHost-shaped wrapper around the Jeeves Gateway.

Functions

looks_like_jeeves_key(→ bool)

Return True if value matches the Jeeves API-key shape.

Module Contents

class jeevesagent.jeeves.client.JeevesConfig[source]

Connection details for the Jeeves Gateway.

api_key: str
base_url: str = 'https://jeeves.works/mcp'
server_name: str = 'jeeves'
class jeevesagent.jeeves.client.JeevesGateway(config: JeevesConfig, *, registry: jeevesagent.mcp.registry.MCPRegistry | None = None)[source]

ToolHost-shaped wrapper around the Jeeves Gateway.

async aclose() None[source]
as_mcp_server() jeevesagent.mcp.spec.MCPServerSpec[source]

Return the MCPServerSpec describing this gateway.

as_registry() jeevesagent.mcp.registry.MCPRegistry[source]

Return a one-server MCPRegistry rooted at this gateway.

async call(tool: str, args: collections.abc.Mapping[str, Any], *, call_id: str = '') jeevesagent.core.types.ToolResult[source]
classmethod from_env(*, env_var: str = JEEVES_API_KEY_ENV, base_url: str | None = None, server_name: str = JEEVES_DEFAULT_SERVER_NAME) JeevesGateway[source]

Build a gateway from the JEEVES_API_KEY environment variable.

async list_tools(*, query: str | None = None) list[jeevesagent.core.types.ToolDef][source]
async watch() collections.abc.AsyncIterator[jeevesagent.core.types.ToolEvent][source]
property config: JeevesConfig
property server_name: str
jeevesagent.jeeves.client.looks_like_jeeves_key(value: str) bool[source]

Return True if value matches the Jeeves API-key shape.

The check is intentionally permissive — it only verifies the well-known jm_sk_ prefix so callers can warn on obviously-wrong inputs without blocking unconventional formats the server may accept.

jeevesagent.jeeves.client.JEEVES_API_KEY_ENV = 'JEEVES_API_KEY'
jeevesagent.jeeves.client.JEEVES_DEFAULT_BASE_URL = 'https://jeeves.works/mcp'
jeevesagent.jeeves.client.JEEVES_DEFAULT_SERVER_NAME = 'jeeves'
jeevesagent.jeeves.client.JEEVES_TOKEN_PREFIX = 'jm_sk_'