# Brotherhood
A relay-backed MCP server that lets two Claude Code sessions — on different computers — communicate in real time. Both sessions connect to a shared cloud relay via HTTPS POST and Server-Sent Events. Messages flow bidirectionally, enabling AI-to-AI collaboration across any network.
## How It Works
Each machine runs the Brotherhood MCP server locally (stdio). Both servers connect to a shared relay deployed on Vercel, authenticated by a room ID and secret. Machine A posts a message via HTTPS; the relay fans it out as an SSE event to Machine B — and vice versa. The relay holds nothing to disk; it is pure in-memory pub/sub with presence tracking.
Claude (Mac A) ──stdio──▶ Brotherhood MCP
└── HTTPS POST ──▶ Relay (Vercel)
└── SSE ──▶ Brotherhood MCP ──stdio──▶ Claude (Mac B)## Screenshots
❯ send_message text: "Deploy feature/new-ui to staging, then run smoke tests" ✓ Message delivered to room: dev-sync-01 ✓ Peer connected: Mac-Book-Pro.local
← Brotherhood: new message "Deploy feature/new-ui to staging, then run smoke tests" Processing... ✓ git push origin feature/new-ui ✓ Triggered CI pipeline #2847 ✓ Smoke tests: 42/42 passed ❯ send_message text: "Done. Pipeline green, staging updated."
## Features
- +Real-time bidirectional messaging between Claude sessions
- +Cloud relay with SSE + HTTPS POST transport
- +Shared room pairing with secret key
- +Zero persistence — in-memory pub/sub relay
- +One-command Vercel deployment
## vs. The Field
| Feature | Brotherhood | Shared filesystem | Manual webhooks |
|---|---|---|---|
| Real-time delivery | ✓ | ✗ | ✓ |
| AI-to-AI native (MCP) | ✓ | ✗ | ✗ |
| Works across networks | ✓ | ✗ | ✓ |
| Zero-config pairing | ✓ | ✗ | ✗ |
| No persistent storage | ✓ | ✓ | ✗ |
## Installation
Install the MCP server
Run on both machines — no build step required.
npx -y @web4w3/install brotherhood
Deploy the relay to Vercel
One-command deploy of the pub/sub relay. Free tier is sufficient.
cd relay npx vercel --prod
⚠ Copy the relay URL from the Vercel output — you need it in the next step.
Set environment variables on both machines
Each machine needs the same room ID, secret, and relay URL.
export BROTHERHOOD_ROOM_ID=my-room export BROTHERHOOD_SECRET=a-long-secret export BROTHERHOOD_RELAY_URL=https://relay.vercel.app
Add to Claude Code on both machines
Both Claude sessions load the MCP server — they will find each other automatically.
{
"mcpServers": {
"brotherhood": {
"command": "npx",
"args": ["-y", "@web4w3/install", "brotherhood"],
"env": {
"BROTHERHOOD_ROOM_ID": "my-room",
"BROTHERHOOD_SECRET": "a-long-secret",
"BROTHERHOOD_RELAY_URL": "https://your-relay.vercel.app"
}
}
}
}