Agent intercommunication - messaging, channels, shared state, and real-time events
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Agent-agnostic intercommunication system. Lets AI coding agents β Claude Code, Codex CLI, Gemini CLI, Aider, or any custom tool β talk to each other, share state, and coordinate work in real time.
| Light Theme | Dark Theme |
|---|---|
![]() | ![]() |
When you run multiple AI agents on the same codebase β code review in one terminal, implementation in another, testing in a third β they have no idea the others exist. They duplicate work, create merge conflicts, and miss context.
| Without agent-comm | With agent-comm | |
|---|---|---|
| Discovery | Agents don't know others exist | Agents register with skills, discover by capability |
| Coordination | Edit the same file, create conflicts | Lock files/regions, divide work |
| Communication | None β each agent works blind | Messages, channels, broadcasts |
| State sharing | Duplicate work, missed context | Shared KV store with atomic CAS |
| Visibility | No idea what's happening | Real-time dashboard + activity feed shows everything |
agent-comm gives them a shared communication layer:
low/normal/high/urgent) and optional ackcomm_poll) so mid-flight peer signals are consumed without busy-loopingfile-coord hook (see below) so parallel agents on shared files cannot clobber each otherIt works with any agent that supports MCP (stdio transport) or can make HTTP requests (REST API).
The MCP tools (comm_state, etc.) give agents the primitives to coordinate, but they don't enforce coordination β the agent has to remember to call them. Our bench measured what happens when you rely on the model's discretion: even with strict procedural prompting, Claude follows the protocol on the first claim cycle then drifts back to "be helpful, finish the task." Soft coordination is unreliable.
The fix is a pair of PreToolUse hooks shipped in scripts/hooks/: file-coord intercepts every Edit/Write/MultiEdit and claims the file via REST POST /api/state/file-locks/<path>/cas (blocks the edit if another agent holds the lock); bash-guard intercepts git commit, git push, npm install, npm test, builds, migrations, and dev-server starts and blocks/warns when they would conflict with another session's WIP. The protocol becomes infrastructure, not a prompt the agent might ignore.
The bench's headline pilot is multi-term-commit β directly modeling the daily pain of two terminal sessions on the same project. Session A edits two files but doesn't commit. Session B then edits two other files and runs git commit -am "my work". Without the hook, B's commit silently includes A's WIP. With the hook, B's commit is blocked at the bash layer with an actionable message, and B reacts (selective staging, restore, or coordinate). Bench result:
| naive (no hook) | with hooks | |
|---|---|---|
| Commit purity | MIXED β bar.js, baz.js, foo.js, qux.js | PURE β baz.js, qux.js |
| Wall time | 91.0s | 78.8s (-13%) |
| Total cost | $0.774 | $0.591 (-24%) |
| Outcome | A's WIP silently committed under B's name | clean commit, no clobber |
The hook is faster AND cheaper, not just safer. Reason: when agents lack coordination on shared workspaces, they read stale state, get confused mid-task, retry, and re-think. Serializing access and surfacing the conflict early removes that wasted thinking. Run npm run setup to install both hooks automatically; see Setup β File Coordination for manual install on Claude Code, OpenCode, or any custom MCP client. See bench/README.md for the measurement methodology.
agent-comm is a single Node process that exposes three transports β MCP stdio (for AI hosts), REST + WebSocket (for hooks, dashboards, custom scripts) β backed by a SQLite database in WAL mode. Hooks installed in your Claude Code (or other host) settings call the REST endpoint at localhost:3421 to claim file locks, query who-edited-what, and broadcast presence. The dashboard UI at the same port is a live view of every agent, message, channel, and shared-state entry. Multiple AI hosts can connect simultaneously and see the same world.
agent-comm runs as a stdio MCP server, so any MCP-compatible host can use it. Tested hosts include Claude Code, Cline, OpenCode, Cursor (read-only state), Windsurf, Codex CLI, Aider, and Continue.dev. Adapter recipes for each are in docs/SETUP.md.
Generic MCP config:
Add this to your host's MCP config file (the path varies by host β
~/.claude.json for Claude Code, ~/.config/opencode/config.json for
OpenCode, ~/.cursor/config.json for Cursor, etc. β see the per-host
sections in docs/SETUP.md).
The dashboard auto-starts at http://localhost:3421 on the first MCP connection regardless of which host is connected.
Registers the MCP server in ~/.claude.json, installs the hook scripts (lifecycle + file-coord + bash-guard), and configures permissions. Other hosts: see docs/SETUP.md for the per-host integration recipes β every host that supports pre-tool-call hooks can use the same file-coord.mjs script unchanged.
| Tool | Description |
|---|---|
comm_register | Register with name, capabilities, metadata, skills, and auto-join channels |
comm_agents | Agent management β actions: list, discover, whoami, heartbeat, status, unregister |
comm_send | Send messages β direct (to), channel, broadcast, reply (reply_to), forward (forward) |
comm_inbox | Read inbox (direct + channel messages, unread filter, importance filter, thread view via thread_id) |
comm_poll | Block until a new inbox message arrives (supports timeout_ms and importance filter) |
comm_channel | Channel management β actions: create, list, join, leave, archive, update, members, history |
comm_state | Shared key-value state β actions: set, get, list, delete, cas |
All endpoints return JSON. CORS enabled. See full API reference for details.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/agent-comm)<a href="https://allmcps.com/mcp/agent-comm"><img src="https://allmcps.com/api/badge/agent-comm?style=directory" alt="Agent Comm on AllMCPs" /></a>