# agent-comm

Coordinates parallel AI coding agents using shared locks, key-value state, and messaging. Helps prevent conflicts when multiple sessions edit the same codebase.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: keshrath
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/keshrath/agent-comm
- Updated: 2026-10-01
- HTML: https://affpapa.org/en/nevibecode/mcp/agent-comm

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add agent-comm -- npx -y agent-comm
```

### Codex

**Platform CLI**
```bash
codex mcp add agent-comm -- npx -y agent-comm
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "agent-comm": {
            "command": "npx",
            "args": [
                "-y",
                "agent-comm"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "agent-comm": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "agent-comm"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add agent-comm npx -y agent-comm
```

## When to use it
- 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
- 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.ts` using comm_state before modifying functions

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
