claude-peers-mcp

Enable multiple Claude Code instances to discover each other and exchange messages in real-time via a local broker daemon and MCP server.

3,819 stars

Best use case

claude-peers-mcp is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Enable multiple Claude Code instances to discover each other and exchange messages in real-time via a local broker daemon and MCP server.

Teams using claude-peers-mcp should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/claude-peers-mcp/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/adisinghstudent/claude-peers-mcp/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/claude-peers-mcp/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How claude-peers-mcp Compares

Feature / Agentclaude-peers-mcpStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Enable multiple Claude Code instances to discover each other and exchange messages in real-time via a local broker daemon and MCP server.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# claude-peers-mcp

> Skill by [ara.so](https://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

```bash
git clone https://github.com/louislva/claude-peers-mcp.git ~/claude-peers-mcp
cd ~/claude-peers-mcp
bun install
```

### 2. Register as a global MCP server

```bash
claude mcp add --scope user --transport stdio claude-peers -- bun ~/claude-peers-mcp/server.ts
```

Adjust the path if you cloned elsewhere.

### 3. Launch Claude Code with the channel enabled

```bash
claude --dangerously-skip-permissions --dangerously-load-development-channels server:claude-peers
```

Add a shell alias to avoid typing it every time:

```bash
# ~/.bashrc or ~/.zshrc
alias claudepeers='claude --dangerously-load-development-channels server:claude-peers'
```

The broker daemon starts automatically on first use. No manual daemon management needed.

## Requirements

- [Bun](https://bun.sh) runtime
- Claude Code v2.1.80+
- claude.ai login (channels require it — API key auth does **not** work)

## Architecture

```
                    ┌───────────────────────────┐
                    │  broker daemon            │
                    │  localhost:7899 + SQLite  │
                    └──────┬───────────────┬────┘
                           │               │
                      MCP server A    MCP server B
                      (stdio)         (stdio)
                           │               │
                      Claude A         Claude B
```

- Each Claude Code session spawns its own `server.ts` MCP process over stdio
- MCP servers register with the broker and poll every second
- Inbound messages are pushed via the `claude/channel` protocol for instant delivery
- The broker auto-cleans dead peers and is localhost-only

## MCP Tools Reference

| Tool | Description |
|---|---|
| `list_peers` | Discover other Claude Code instances; scope: `machine`, `directory`, or `repo` |
| `send_message` | Send a message to a peer by ID — delivered instantly via channel push |
| `set_summary` | Set a description of what this instance is working on |
| `check_messages` | Manually poll for messages (fallback without channel mode) |

### Example prompts to Claude

```
List all peers on this machine
```

```
Send a message to peer abc123: "what files are you editing right now?"
```

```
Set your summary to: "refactoring the authentication module"
```

```
Check for any new messages from peers
```

## CLI Usage

Inspect and interact with the broker directly from the terminal:

```bash
cd ~/claude-peers-mcp

# Show broker status and all registered peers
bun cli.ts status

# List peers in a table
bun cli.ts peers

# Send a message into a specific Claude session
bun cli.ts send <peer-id> "your message here"

# Stop the broker daemon
bun cli.ts kill-broker
```

## Configuration

Set these environment variables before starting Claude Code:

| Variable | Default | Description |
|---|---|---|
| `CLAUDE_PEERS_PORT` | `7899` | Port the broker listens on |
| `CLAUDE_PEERS_DB` | `~/.claude-peers.db` | Path to the SQLite database |
| `OPENAI_API_KEY` | — | Enables auto-summary via `gpt-4o-mini` on startup |

```bash
export CLAUDE_PEERS_PORT=7899
export CLAUDE_PEERS_DB=~/.claude-peers.db
export OPENAI_API_KEY=$OPENAI_API_KEY  # optional — enables auto-summary
```

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

```bash
# Terminal 1 — in ~/projects/backend
claudepeers

# Terminal 2 — in ~/projects/frontend
claudepeers
```

Ask Claude in Terminal 1:
```
List peers scoped to machine, then ask the peer in the frontend project what API endpoints it needs
```

### Scope-filtered peer discovery

```
List peers scoped to repo
```
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

```bash
# Inject a task into a running Claude session from a shell script
PEER_ID=$(bun ~/claude-peers-mcp/cli.ts peers | grep 'backend' | awk '{print $1}')
bun ~/claude-peers-mcp/cli.ts send "$PEER_ID" "run the test suite and report failures"
```

### Polling fallback (no channel mode)

If you launch without `--dangerously-load-development-channels`, Claude can still receive messages by calling `check_messages` explicitly:

```
Check for any new peer messages
```

## Troubleshooting

**Broker not starting**
```bash
# Check if something is already on port 7899
lsof -i :7899

# Kill a stuck broker and restart
bun ~/claude-peers-mcp/cli.ts kill-broker
# Then relaunch Claude Code
```

**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` (default `7899`)
- Run `bun cli.ts status` to 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_messages` tool if channels are unavailable

**Auto-summary not generating**
- Verify `OPENAI_API_KEY` is 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**
```bash
# Reset the database entirely (all peers/messages lost)
rm ~/.claude-peers.db
bun ~/claude-peers-mcp/cli.ts kill-broker
```

**MCP server not found after registration**
```bash
# Verify registration
claude mcp list

# Re-register if missing
claude mcp add --scope user --transport stdio claude-peers -- bun ~/claude-peers-mcp/server.ts
```

Related Skills

afrexai-claude-code-production

3891
from openclaw/skills

Complete Claude Code productivity system — project setup, prompting patterns, sub-agent orchestration, context management, debugging, refactoring, TDD, and shipping 10X faster. Zero scripts needed.

ask-claude

3891
from openclaw/skills

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Coding & Development

claude-audit

3891
from openclaw/skills

Full project audit — launches 5 parallel AI agents (security, bugs, dead code, architecture, performance) to scan your codebase read-only, then compiles a unified report with health grade (A+ to F) and offers surgical fixes. Language-agnostic. Zero config.

Claude Skills 开发框架架构指导手册

3891
from openclaw/skills

## 1. 项目概述 (Overview)

claude-code-usage

3891
from openclaw/skills

Check Claude Code OAuth usage limits (session & weekly quotas). Use when user asks about Claude Code usage, remaining limits, rate limits, or how much Claude usage they have left. Includes automated session refresh reminders and reset detection monitoring.

ClaudeHemat

3891
from openclaw/skills

# Introduction

claude-code-cli

3891
from openclaw/skills

Delegate coding tasks to Claude Code CLI via background process. Use when: building features, reviewing PRs, refactoring codebases, or iterative coding that needs file exploration. Supports interactive PTY mode for confirmations/permissions and headless pipe mode for automation. NOT for: simple one-liner fixes (just edit), reading code (use read tool), or any work in ~/.openclaw/ workspace.

Claude Code CLI for OpenClaw

3891
from openclaw/skills

Install, authenticate, and use Claude Code CLI as a native coding tool for any OpenClaw agent system.

claude-relay

3891
from openclaw/skills

Relay operator for Claude Code via tmux across multiple projects. Use when the user wants to start/continue a Claude Code terminal session, send prompts, read output, or manage background Claude sessions by project name/path.

claude-usage

3891
from openclaw/skills

Check Claude Code / Claude Max usage limits. Run when user asks about usage, limits, quota, or how much Claude capacity is left.

claude-notifications

3891
from openclaw/skills

Set up native macOS notifications for Claude Code on local and devpod/remote environments. Use when the user asks to 'setup notifications', 'configure devpod notifications', 'get notified when Claude needs attention', 'setup claude alerts', or 'install notification hooks'. Handles local terminal-notifier, SSH reverse tunnel for devpods, launchd listener, tmux passthrough, and Claude Code hook configuration.

claude-code-statusline

3891
from openclaw/skills

Install and configure a custom Claude Code status line showing real-time token usage, context window percentage, git branch, and color-coded warnings. Use when the user asks to "install statusline", "setup statusline", "configure statusline", "setup status line", "install status bar", "show token usage", "context window display", "statusline colors", "statusline thresholds", or wants to customize their Claude Code status bar display.