Back to Browse

SwarmCode MCP Server

by User
CommunicationUse Caution3.8LocalNew
Free

Real-time messaging between Claude Code instances across machines

About

Real-time cross-machine communication for Claude Code instances. One agent session can send and receive messages with another over Redis pub/sub, so multiple agents working on related tasks can coordinate directly instead of only through a human relaying messages between terminals. Needs a reachable Redis instance and a one-time workspace init step.

Security Report

3.8
Use Caution3.8High Risk

No malicious patterns, data exfiltration, or dangerous code execution were found, but the server has real security weaknesses. The dashboard falls back to default credentials (admin/bridge) and is bound to 0.0.0.0, Redis is treated as an unauthenticated trust boundary (with a NodePort exposure in the Kubernetes manifests), and messages from other workspaces are self-attributed and fed into the agent as instructions to act on, creating a prompt-injection path. Supply chain analysis found 3 known vulnerabilities in dependencies (0 critical, 1 high severity). Package verification found 1 issue.

11 files analyzed · 14 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

TCP Network Access

Opens direct network connections, common for database or messaging tools.

HTTP Network Access

Connects to external APIs or services over the internet.

database

Check that this permission is expected for this type of plugin.

env_vars

Check that this permission is expected for this type of plugin.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

process_spawn

Check that this permission is expected for this type of plugin.

system_info

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

Connection URL for a reachable Redis instance you controlRequired

Environment variable: SWARMCODE_REDIS_URL

Sign up free
Workspace name shared by every agent that should see each other's messagesRequired

Environment variable: SWARMCODE_WORKSPACE_ID

Sign up free

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "swarmcode": {
      "env": {
        "SWARMCODE_REDIS_URL": "your-swarmcode-redis-url-here",
        "SWARMCODE_WORKSPACE_ID": "your-swarmcode-workspace-id-here"
      },
      "args": [
        "-y",
        "swarmcode-mcp"
      ],
      "command": "npx"
    }
  }
}

Getting Started

Once installed, try these example prompts and explore these capabilities:

  • 1"Send a message to the backend workspace asking if the API schema changed"
  • 2"Check my swarmcode inbox for new messages"
  • 3Tool: swarm_send / swarm_receive / swarm_status

Documentation

View on GitHub

From the project's GitHub README.

npm npm downloads license

Using mcp-agent-bridge? That is the old name of this project and it no longer gets updates. Switch with npm uninstall -g mcp-agent-bridge && npm install -g swarmcode-mcp, then re-run swarmcode-mcp init <workspace>. Same Redis, same protocol; the tools are now swarm_* instead of bridge_*. See Migrating from mcp-agent-bridge.

Two Claude Code instances can't talk to each other. The one on your desktop that just changed the API schema has no way to tell the one on your laptop that's writing the client against it — so you copy-paste between windows and act as the message bus yourself.

SwarmCode is that message bus. Agents on any machine on your network join a Redis-backed channel and send each other messages, artifacts, and workspace status, delivered as real-time push into VS Code — no polling, no manual relay.

Desktop (VS Code)          Laptop (VS Code)           Server
  Claude A ───────────────── Claude B ───────────────── Claude C
       \                      |                       /
        -------- Redis (single instance) ------------
                       |
                  Web Dashboard
              (monitor & control)

Install (60 seconds)

npm install -g swarmcode-mcp

# Redis, if you don't already have one
docker run -d --name redis -p 6379:6379 redis:alpine

swarmcode-mcp init my-workspace --redis redis://your-redis:6379

Restart Claude Code. Repeat on every other machine, all pointing at the same Redis. That's the whole setup.

What it looks like

Desktop (building the API):

> swarm_register("Building user auth REST API")
> swarm_send(to: "laptop", type: "info",
             content: "POST /api/users is live, schema: {id, email, role}")

Laptop — the message arrives as a task-notification while its agent is mid-task:

[task-notification] New message from "desktop": POST /api/users is live...
> swarm_receive()
> swarm_send(to: "desktop", type: "question",
             content: "Does /api/users support pagination?")

Desktop, instantly:

[task-notification] New message from "laptop": Does /api/users support pagination?
> swarm_receive()
> swarm_send(to: "laptop", type: "answer", content: "Yes, use ?page=1&limit=20")

No user in the loop. A terminal recording of the same exchange is in demo/demo.cast (asciinema play demo/demo.cast).

What Can It Do?

  • Cross-machine messaging — Claude on your desktop sends a message, Claude on your laptop receives it instantly
  • Real-time push — no polling, messages delivered via Redis pub/sub + background task notifications
  • Workspace awareness — every agent knows what the others are working on
  • Artifact sharing — share schemas, configs, interfaces across workspaces
  • Web dashboard — monitor all workspaces, send messages from your browser
  • Auto-setup — one command initializes any workspace

vs Claude Desktop

Claude DesktopSwarmCode
Cross-machine communicationNoYes
Multi-workspace coordinationNo — each window isolatedYes — agents talk to each other
Real-time push notificationsNoYes
Artifact/schema sharingNoYes
Web dashboardNoYes
Works in VS CodeNoYes
Cross-platformMac onlyMac, Windows, Linux
Open sourceNoYes (MIT)

How It Works

Real-time message loop

1. Background listener subscribes to Redis pub/sub channel
2. Message arrives → listener exits → task-notification fires in VS Code
3. Claude reads the message → swarm_receive() → swarm_send() reply
4. New listener started → back to step 1

No polling. No cron. True event-driven push in VS Code.

Per-workspace isolation

swarmcode:ws:desktop-api       ← only desktop-api hears this
swarmcode:ws:laptop-frontend   ← only laptop-frontend hears this
swarmcode:ws:broadcast         ← everyone hears this (to="*")

Backup polling

A 5-minute CronCreate runs alongside the listener as a safety net.

Tools

ToolDescription
swarm_sendSend a message to a workspace or broadcast (to: "*")
swarm_receiveRead and mark pending messages as read
swarm_statusSee all registered workspaces
swarm_registerRegister/update this workspace's description
swarm_listenLong-running task that completes when the next message arrives

Web Dashboard

Monitor and control all workspaces from your browser.

docker run -d -p 4200:4200 \
  -e SWARMCODE_REDIS_URL=redis://your-redis:6379 \
  -e DASHBOARD_USER=admin \
  -e DASHBOARD_PASS=your-password \
  ghcr.io/spranab/swarmcode-dashboard:latest

Features:

  • All workspaces with active/idle status
  • Per-workspace inbox viewer
  • Global message log (real-time via SSE)
  • Send messages to any workspace
  • Dark theme

Architecture

src/
├── channel.js          # MCP server — tools + Redis pub/sub + instructions
├── listener.js         # One-shot Redis listener → task-notification push
├── check-inbox-http.js # UserPromptSubmit hook — inbox check on each prompt
├── init.js             # CLI — one-command workspace setup
└── server.js           # CLI entry point

dashboard/
├── server.js           # Express app with SSE, basic auth, REST API
└── index.html          # Real-time dashboard UI

Configuration

VariableDefaultDescription
SWARMCODE_REDIS_URLredis://localhost:6379Redis connection
SWARMCODE_WORKSPACE_ID(from .mcp.json)Workspace identifier
DASHBOARD_USERadminDashboard username
DASHBOARD_PASSbridgeDashboard password
DASHBOARD_PORT4200Dashboard port

Kubernetes

Redis + Dashboard manifests in k8s/:

kubectl apply -f k8s/namespace.yml
kubectl apply -f k8s/redis.yml       # includes NodePort on 30379
kubectl apply -f k8s/dashboard.yml
kubectl apply -f k8s/ingress.yml     # edit hostname

Built With

Migrating from mcp-agent-bridge

SwarmCode was published as mcp-agent-bridge until the rename. The old package still works but is frozen — new features and fixes only land in swarmcode-mcp.

npm uninstall -g mcp-agent-bridge
npm install -g swarmcode-mcp
swarmcode-mcp init my-workspace --redis redis://your-redis:6379

What changes:

Old (mcp-agent-bridge)New (swarmcode-mcp)
bridge_send / bridge_receive / bridge_registerswarm_send / swarm_receive / swarm_register
AGENT_BRIDGE_REDIS_URLSWARMCODE_REDIS_URL
AGENT_BRIDGE_WORKSPACE_IDSWARMCODE_WORKSPACE_ID
binary mcp-agent-bridgebinary swarmcode / swarmcode-mcp

The old AGENT_BRIDGE_* environment variables are still read as a fallback, and the Redis wire format is unchanged, so a migrated workspace can talk to a not-yet-migrated one during the switchover. Re-running init rewrites the workspace's .mcp.json entry and hooks for you.

Related projects

Other agent infrastructure by the same author, built to be used together:

  • saga-mcp — SQLite-backed project tracker so a swarm of agents shares one plan.
  • yantrikdb-mcp — persistent cognitive memory across sessions and machines.
  • brainstorm-mcp — multi-model debate as an MCP tool.
  • mcpier — self-hosted MCP control plane that keeps API keys off your clients.

License

MIT — Pranab Sarkar

Reviews

No reviews yet

Be the first to review this server!