agent-comm — Claude Code MCP server: what it does, how to install
Coordinates parallel AI coding agents using shared locks, key-value state, and messaging. Helps prevent conflicts when multiple sessions edit the same codebase.
claude mcp add agent-comm -- npx -y agent-commWhat agent-comm does
The server runs as a background Node.js process using SQLite in WAL mode for storage. It provides 7 MCP tools alongside REST and WebSocket endpoints. Agents declare their capabilities, discover peer sessions by tags, and poll messages through comm_poll without busy-waiting. A live dashboard at localhost:3421 displays active channels and task progress.
Prompt instructions alone fail to stop agents from overwriting edits. The package addresses this with two PreToolUse hooks. The file-coord hook intercepts file writes and reserves them via atomic CAS requests. Meanwhile, bash-guard stops rogue git commit or test commands from bundling uncommitted edits belonging to another terminal session.
The server requires Node.js version 20.11 or newer to run. File access control relies directly on configuring the bundled hooks before starting parallel sessions.
What it helps with
- Prevent merge conflicts and file overwrites across parallel coding sessions
- Block premature git commits that pull in unfinished edits from other terminals
- Route tasks dynamically between agents using declared skill tags
- Synchronize worker flags and locks with atomic compare-and-swap operations
Example prompts for the agent
- Register yourself in agent-comm and discover any peer agents tagged for testing
- Broadcast an urgent status message to all active workers across the coordination channel
- Acquire a lock on
src/index.tsusing comm_state before modifying functions
How to install agent-comm
Platform CLI
claude mcp add agent-comm -- npx -y agent-commPlatform CLI
codex mcp add agent-comm -- npx -y agent-commConfig file
{
"mcpServers": {
"agent-comm": {
"command": "npx",
"args": [
"-y",
"agent-comm"
]
}
}
}Config file
{
"servers": {
"agent-comm": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"agent-comm"
]
}
}
}Platform CLI
gemini mcp add agent-comm npx -y agent-commStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about agent-comm
How to install agent-comm in Claude Code?
Run claude mcp add agent-comm -- npx -y agent-comm in your terminal. Ensure your system runs Node.js 20.11 or higher before launching.
What do the file-coord and bash-guard hooks do?
They enforce coordination rules at the execution boundary rather than relying on prompts. file-coord halts writes to locked files, while bash-guard intercepts commands like git commit whenever unfinished work from another agent is present.
How do agents discover and communicate with each other?
Agents announce their skill tags upon registration and exchange direct or channel-based messages. Inboxes are checked via blocking comm_poll calls, and shared state is synchronized using SQLite with atomic CAS operations.