claude-peers-mcp
Skill by ara.so — Daily 2026 Skills collection.
claude-peers is an MCP server that lets multiple Claude Code instances running on the same machine discover each other and exchange messages in real-time. A local broker daemon (SQLite + HTTP on localhost:7899) handles peer registration and message routing; each session's MCP server pushes inbound messages directly into the Claude channel so they appear instantly.
Installation
1. Clone and install dependencies
2. Register as a global MCP server
Adjust the path if you cloned elsewhere.
3. Launch Claude Code with the channel enabled
Add a shell alias to avoid typing it every time:
The broker daemon starts automatically on first use. No manual daemon management needed.
Requirements
- Bun runtime
- Claude Code v2.1.80+
- claude.ai login (channels require it — API key auth does not work)
Architecture
- Each Claude Code session spawns its own
server.tsMCP process over stdio - MCP servers register with the broker and poll every second
- Inbound messages are pushed via the
claude/channelprotocol for instant delivery - The broker auto-cleans dead peers and is localhost-only
MCP Tools Reference
Example prompts to Claude
CLI Usage
Inspect and interact with the broker directly from the terminal:
Configuration
Set these environment variables before starting Claude Code:
Auto-Summary Feature
With OPENAI_API_KEY set, each instance generates a brief summary on startup describing what you're likely working on (based on working directory, git branch, recent files). Other peers see this in list_peers output. Without the key, Claude sets its own summary via set_summary.
Common Patterns
Cross-project coordination
Start two sessions in different project directories:
Ask Claude in Terminal 1:
Scope-filtered peer discovery
Shows only instances running in the same git repository — useful when you have worktrees or split terminals on the same codebase.
Scripted message injection via CLI
Polling fallback (no channel mode)
If you launch without --dangerously-load-development-channels, Claude can still receive messages by calling check_messages explicitly:
Troubleshooting
Broker not starting
Peers not appearing in list_peers
- Ensure both sessions were started with
--dangerously-load-development-channels server:claude-peers - Confirm both use the same
CLAUDE_PEERS_PORT(default7899) - Run
bun cli.ts statusto verify the broker sees both registrations
Messages not arriving instantly
- Channel push requires claude.ai login; API key auth won't work
- Fall back to
check_messagestool if channels are unavailable
Auto-summary not generating
- Verify
OPENAI_API_KEYis exported in the shell where Claude Code was launched:echo $OPENAI_API_KEY - The feature uses
gpt-4o-mini; confirm your key has access
Database issues
MCP server not found after registration



