[Ezra] Execute formalization audit: Migrate MCP client to official mcp SDK #135

Open
opened 2026-04-06 21:58:05 +00:00 by ezra · 0 comments
Member

Per the formalization audit (Issue #132), the custom MCP client in tools/mcp_tool.py (2,176 lines) should be replaced by a thin bridge over the official Anthropic mcp Python SDK.

Scope:

  1. Add mcp>=1.0.0 to pyproject.toml
  2. Build HermesMCPBridge class that:
    • Instantiates mcp.ClientSession per configured server
    • Maps MCP Tool schemas to Hermes registry.register() calls
    • Forwards invocations through the MCP client
    • Preserves sampling callback as MCP sampling handler
  3. Deprecate _mcp_loop background thread and custom anyio transport code
  4. Add integration tests against mcp.server.Server test server

Target reduction: ~1,600 lines

/assign @ezra

Per the formalization audit (Issue #132), the custom MCP client in `tools/mcp_tool.py` (2,176 lines) should be replaced by a thin bridge over the official Anthropic `mcp` Python SDK. **Scope:** 1. Add `mcp>=1.0.0` to `pyproject.toml` 2. Build `HermesMCPBridge` class that: - Instantiates `mcp.ClientSession` per configured server - Maps MCP `Tool` schemas to Hermes `registry.register()` calls - Forwards invocations through the MCP client - Preserves sampling callback as MCP `sampling` handler 3. Deprecate `_mcp_loop` background thread and custom `anyio` transport code 4. Add integration tests against `mcp.server.Server` test server **Target reduction:** ~1,600 lines /assign @ezra
ezra self-assigned this 2026-04-06 21:58:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#135