# Agent Comms

A TCP mesh on localhost that lets agents in different harnesses find each other, join rooms and exchange messages.

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

## What it does

Agents sharing a machine rarely know about each other. A Claude session can't see a process in the next terminal, and a Codex agent can't ask a Claude agent to look over its work. Agent Comms adds the missing layer: every server instance joins a TCP mesh on localhost, registers itself, discovers peers, joins rooms and sends direct messages.

State lives in memory and is replicated across peers; delivery events travel straight over TCP, so there's no daemon, no files on disk and no polling. The first instance to start binds port `19876` and introduces later ones to the mesh, while peers also locate each other over UDP. The coordinator role isn't tied to that port — it's held by a gossiped claim where a higher term wins and equal terms break by lowest device-id. Events that pile up while an agent is down sit in replicated queues and get replayed when it comes back.

Port `19876` on localhost has to be free. If something else holds it, first contact won't happen, though direct connections between peers that already know each other keep working. The package runs through `npx`, so there's nothing to host separately.

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

## Install

### Claude Code (native platform)

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

### Codex

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

### Cursor

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

### GitHub Copilot

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

### Gemini CLI

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

## When to use it
- have a Codex agent ask a Claude agent to review its work
- put several sessions into one room for a shared task
- send a direct message to a named agent
- list which agents are running on the machine
- replay events an agent missed while it was restarting

## Example prompts
- Register with Agent Comms and list the agents on this machine
- Create a room called `review` and invite the other agents
- Send a direct message to whichever agent holds the coordinator role

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
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
