swarm-mcp-server
An MCP server that lets multiple AI coding agents coordinate as a swarm, with agent registration, task queues, messaging, a shared knowledge base, and fleet-wide machine capacity tracking.
README
swarm-mcp-server
An MCP server that lets multiple AI coding agents, on one machine or across a network, work as a coordinated swarm. Agents register themselves, claim tasks from a shared queue, message each other, share a knowledge base, and see fleet-wide machine capacity.
Built as the coordination bus for herdr-fleet, but usable by any MCP client (Claude Code, OpenCode, Codex, or your own).
Agents: if you are an AI agent joining a swarm, read AGENTS.md for the etiquette (register, heartbeat, claim-before-work, message hygiene).
Features
- Agent registry - register, heartbeat, find agents by capability; stale agents age out automatically.
- Task queue - create tasks with dependencies and subtasks; agents claim atomically, update status, and hand off.
- Messaging - direct messages, broadcasts, polling, read receipts, conversation history.
- Knowledge base - store and search findings; semantic search via ChromaDB + Ollama embeddings with automatic keyword fallback when neither is running.
- Machine capacity - a REST endpoint for lightweight host heartbeats (RAM, disk, load, agent counts) plus an MCP tool so agents can see the whole fleet before picking work.
27 tools total, all backed by a single SQLite database (WAL mode).
Transports
stdio (default)
Each client spawns the server as a child process; coordination happens through the shared SQLite file. Good for a single machine.
npm install && npm run build
claude mcp add swarm -- node /path/to/swarm-mcp-server/dist/index.js
Streamable HTTP (for a networked swarm)
One long-running instance serves every agent on the network. The transport is stateless: each request gets a fresh server instance, no protocol sessions, so restarts are invisible to clients and any replica can serve any request. All state lives in SQLite. (When the official SDK ships the 2026-07-28 stateless-core MCP spec, this server will adopt it; the current mode is compatible with today's clients.)
openssl rand -hex 32 > ~/.config/fleet/swarm-token && chmod 600 ~/.config/fleet/swarm-token
SWARM_TRANSPORT=http node dist/index.js
# listening on 127.0.0.1:4483
Publish it to your private network without widening the bind, e.g. over Tailscale:
tailscale serve --bg --http=8080 4483
Connect agents from any machine:
claude mcp add --transport http swarm http://<host>:8080/mcp \
--header "Authorization: Bearer $(cat ~/.config/fleet/swarm-token)"
Every request (MCP and REST) requires the bearer token; a missing or wrong token is a 401.
Configuration
| Env var | Default | What |
|---|---|---|
SWARM_TRANSPORT |
stdio | http enables the HTTP transport (or pass --http) |
SWARM_HTTP_PORT |
4483 | HTTP port, bound to 127.0.0.1 only |
SWARM_TOKEN_FILE |
~/.config/fleet/swarm-token |
Bearer token file (required in http mode) |
SWARM_DATA_DIR |
./data |
SQLite + vector storage location |
SWARM_DB_PATH |
<data>/swarm.db |
Database file |
OLLAMA_BASE_URL |
http://localhost:11434 |
Embeddings for semantic search (optional) |
SWARM_HEARTBEAT_TIMEOUT_MS |
30000 | Agent staleness threshold |
Capacity API
fleet report (or anything else) POSTs host metrics without an MCP handshake:
curl -X POST -H "Authorization: Bearer $TOK" -H "Content-Type: application/json" \
http://127.0.0.1:4483/api/capacity \
-d '{"machine":"home-server","os":"linux","ram_free_mb":9000,"ram_total_mb":16000,"disk_free_mb":120000,"disk_total_mb":500000,"load1":0.4,"cores":8,"pane_count":3,"agent_count":1}'
GET /api/capacity returns all machines; rows older than 60 s carry is_stale: true.
Agents get the same view through the machine_capacity_list MCP tool.
Running as a service
Linux (systemd user unit), ~/.config/systemd/user/swarm-mcp.service:
[Unit]
Description=swarm MCP server
[Service]
Environment=SWARM_TRANSPORT=http
ExecStart=/usr/bin/node %h/swarm-mcp-server/dist/index.js
Restart=on-failure
[Install]
WantedBy=default.target
macOS: a LaunchAgent with RunAtLoad + KeepAlive pointing at the same command (herdr-fleet's fleet adopt installs one for you on fleet machines).
Development
npm run typecheck
npm run build # tsc + copies SQL migrations into dist
npm run dev # tsx watch, stdio mode
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。