hermes mcp serve starts a stdio MCP server that lets any MCP client
(Claude Code, Cursor, Codex, etc.) interact with Hermes conversations.
Matches OpenClaw's 9-tool channel bridge surface:
Tools exposed:
- conversations_list: list active sessions across all platforms
- conversation_get: details on one conversation
- messages_read: read message history
- attachments_fetch: extract non-text content from messages
- events_poll: poll for new events since a cursor
- events_wait: long-poll / block until next event (near-real-time)
- messages_send: send to any platform via send_message_tool
- channels_list: browse available messaging targets
- permissions_list_open: list pending approval requests
- permissions_respond: allow/deny approvals
Architecture:
- EventBridge: background thread polls SessionDB for new messages,
maintains in-memory event queue with waiter support
- Reads sessions.json + SessionDB directly (no gateway dep for reads)
- Reuses send_message_tool for sending (same platform adapters)
- FastMCP server with stdio transport
- Zero new dependencies (uses existing mcp>=1.2.0 optional dep)
Files:
- mcp_serve.py: MCP server + EventBridge (~600 lines)
- hermes_cli/main.py: added serve sub-parser to hermes mcp
- hermes_cli/mcp_config.py: route serve action to run_mcp_server
- tests/test_mcp_serve.py: 53 tests
- docs: updated MCP page + CLI commands reference
Summary
Adds
hermes mcp serve— a stdio MCP server that matches OpenClaw's 9-tool channel bridge surface. Any MCP-capable agent (Claude Code, Cursor, Codex, etc.) can interact with Hermes conversations across all connected messaging platforms.Inspired by OpenClaw's MCP channel bridge (shipped March 28, 2026).
What it does
hermes mcp servestarts a FastMCP stdio server exposing 10 tools:conversations_listconversation_getmessages_readattachments_fetchevents_pollevents_waitmessages_sendpermissions_list_openpermissions_respondchannels_listArchitecture
EventBridge
The key component for real-time events. A background thread polls SessionDB every ~2s for new messages and maintains an in-memory event queue with cursor-based access:
events_poll(after_cursor=N)— returns events since cursor, non-blockingevents_wait(after_cursor=N, timeout_ms=30000)— blocks until event arrivesThis is the Hermes equivalent of OpenClaw's WebSocket gateway bridge — instead of WebSocket push events, we poll the SQLite database.
Design decisions
mcp>=1.2.0optional depMCP client config
{ "mcpServers": { "hermes": { "command": "hermes", "args": ["mcp", "serve"] } } }Files changed
mcp_serve.pyhermes_cli/main.pyservesub-parser to existinghermes mcpcommandhermes_cli/mcp_config.pyserveaction torun_mcp_server()tests/test_mcp_serve.pywebsite/docs/user-guide/features/mcp.mdwebsite/docs/reference/cli-commands.mdserveto MCP subcommands tableBackwards compatibility
serveis a new sub-action alongside existingadd/remove/list/test/configureTest plan
vs OpenClaw — what's different
claude/channelpushchannels_listThe
claude/channelpush notification protocol and HTTP transport are follow-up items that both codebases share as limitations.