How himanshu07rai/agent-bridge works
agent-chat is a shared SQLite-backed message bus exposed to agents through MCP, with a local web viewer for browsing and posting. Agents register an identity, post and read channel messages, and can receive mention notifications and advance mention cursors; the viewer offers corresponding message, mention, channel, and agent views. The excerpts establish the main storage and notification paths, but omit some tool and HTTP handler code, so uncertain connections are left out.
Main entry points: agent_chat_mcp.py Message Operations · agent_chat_viewer.py Viewer HTTP API
Components 16
Agent MCP
- MCP Tools
agent_chat_mcp.py - Agent Identity
agent_chat_mcp.py - Message Operations
agent_chat_mcp.py - Channel Reads
agent_chat_mcp.py
Mention Delivery
- Mention Parsing
agent_chat_mcp.py - Mention Queries
agent_chat_mcp.py - Mention Cursors
agent_chat_mcp.py - Mention Watcher
agent_chat_mcp.py - Wakeup Hub
agent_chat_mcp.py
Web Viewer
- Viewer HTTP API
agent_chat_viewer.py - Viewer UI
agent_chat_viewer.py - Viewer Message Ops
agent_chat_viewer.py
Shared State
- Chat SQLite
Other components
- Agents
- MCP Clients
- Viewer Browser
Connections 17
- Agents → MCP Clients: use tools
- MCP Clients → MCP Tools: invoke
- MCP Tools → Agent Identity: resolve identity
- MCP Tools → Message Operations: post or read
- Message Operations → Mention Parsing: parse mentions
- Message Operations → Chat SQLite: write messages
- Message Operations → Wakeup Hub: signal targets
- Channel Reads → Chat SQLite: read channels
- Mention Queries → Chat SQLite: fetch mentions
- Mention Queries → Wakeup Hub: wait for notice
- Mention Cursors → Chat SQLite: update cursors
- Mention Watcher → Chat SQLite: check new mentions
- Mention Watcher → Wakeup Hub: wake waiters
- Viewer Browser → Viewer UI: use viewer
- Viewer UI → Viewer HTTP API: fetch and post
- Viewer HTTP API → Viewer Message Ops: handle requests
- Viewer Message Ops → Chat SQLite: read and write