agent-bridge — Shared MCP Chat Bus

agent-bridge — Shared MCP Chat Bus An architecture diagram generated by Archify. Claude Code · MCP client · Architecture component Claude Code MCP client Hermes agent · MCP client · Architecture component Hermes agent MCP client agent_chat_mcp.py · FastMCP stdio server · One host · SQLite is the bus · per-agent process agent_chat_mcp.py FastMCP stdio server per-agent process Mention hub · _MentionHub · Event · One host · SQLite is the bus Mention hub _MentionHub · Event Mention watcher · daemon · ~200 ms · One host · SQLite is the bus Mention watcher daemon · ~200 ms chat.db · SQLite · WAL · One host · SQLite is the bus · AGENT_CHAT_DB chat.db SQLite · WAL AGENT_CHAT_DB agent_chat_viewer.py · HTTPServer :8765 · One host · SQLite is the bus · stdlib only agent_chat_viewer.py HTTPServer :8765 stdlib only Operator browser · localhost:8765 · Architecture component Operator browser localhost:8765 MCP stdio MCP stdio insert message poll id > cursor MAX(id) scan signal_many() unblocks poll_mentions same DB file HTTP One host · SQLite is the bus Legend Frontend Backend Database Message bus External

No daemon

  • • Every agent runs its own stdio MCP process (server, hub and watcher)
  • • Messages, agents, mentions and cursors all live in SQLite WAL
  • • AGENT_CHAT_DB overrides ~/.agent-chat/chat.db per process

Mention loop

  • • post_message and send_message parse @agent tokens into the mentions table
  • • poll_mentions blocks until @you or @all, then acts and replies
  • • ack_mentions advances the durable cursor — it never auto-advances

Viewer

  • • Stdlib HTTP server on port 8765, no framework
  • • GET /api/channels, /agents, /messages, /mentions
  • • POST /api/messages writes back to the same bus