ForgeSwarm
An MCP server that turns independent AI agents into a coordinated engineering team with shared task board, context, review loop, and enforced plan-implement-review-iterate workflow.
README
ForgeSwarm 🛠️🐝
An MCP server that turns independent AI agents into a coordinated engineering team.
Most MCP servers give agents data (GitHub, databases, web). ForgeSwarm gives them coordination: a shared task board with atomic claiming, a shared context blackboard, a decision log, and an enforced plan → implement → review → iterate loop — the same workflow shape that powers orchestration harnesses like CyOps, distilled into an open protocol primitive any MCP client can plug into.
Connect Claude Code, Codex, OpenCode, or a MiniMax M3-powered script to the same ForgeSwarm server, and they instantly become citizens of one swarm: claiming tasks without collisions, briefing each other through shared memory, and reviewing each other's work before anything counts as done.
Built for the CyOps Arena Hackathon — MCP Server Sprint (co-hosted with MiniMax).
Why this exists
Multi-agent coding fails in predictable ways: two agents grab the same task, an agent starts work with no idea what the others decided, "done" means "the model said done", and a crashed agent silently stalls the project. ForgeSwarm fixes each one server-side, so correctness doesn't depend on prompt discipline:
| Failure mode | ForgeSwarm mechanism |
|---|---|
| Two agents do the same work | claim_task is a single atomic conditional UPDATE — one winner, always |
| Agent starts cold, repeats settled debates | get_briefing bundles goal, constraints, decisions, dependency summaries, and prior review feedback into one onboarding packet |
| "Done" is just an assertion | submit_for_review → a different agent must post_review; self-review is rejected; request_changes auto-returns the task to its author with feedback attached and bumps the iteration counter |
| "Tests pass, trust me" | run_checks runs allowlisted test/lint commands with a hard timeout and records exit code + output on the task as review evidence |
| Crashed agent stalls the swarm | Claims carry leases; expired leases put tasks back on the board automatically |
| Disagreements evaporate into chat | open_discussion → positions from ≥2 distinct agents (server-enforced) → resolve_discussion auto-records the consensus as a binding decision in every future briefing |
| The swarm never learns | get_retrospective compiles hard evidence — review bounce rates, check pass rates, per-agent stats, hotspot tasks — for the swarm to analyze and act on |
| State lost between sessions | Everything persists in SQLite (WAL) — swarms survive restarts and work across both transports |
Install
From source (not yet on PyPI):
git clone https://github.com/H2SO4620/forgeswarm && cd forgeswarm
pip install -e ".[dev]"
pytest # 20 tests, including end-to-end MCP client sessions
forgeswarm
Transports
forgeswarm # stdio (local clients spawn it)
forgeswarm --transport http --port 8765 # one shared endpoint for a whole swarm
forgeswarm --db ./myproject.db # or set FORGESWARM_DB
State is SQLite either way (default ~/.forgeswarm/forgeswarm.db), so stdio clients —
which each spawn their own server process — still share one swarm.
Claude Code
claude mcp add forgeswarm -- uvx forgeswarm
Or in any MCP client config:
{
"mcpServers": {
"forgeswarm": { "command": "uvx", "args": ["forgeswarm"] }
}
}
The loop
flowchart LR
G[Goal] --> P[create_project<br/>submit_plan]
P --> B[Task board]
B -->|claim_task<br/>atomic| W[Agent works<br/>get_briefing · save_context · run_checks]
W --> S[submit_for_review]
S --> R{post_review<br/>by a different agent}
R -->|approve| D[done ✓]
R -->|request_changes<br/>iteration++| W
D --> B
Tools (24)
Planning — create_project, submit_plan (whole dependency graph in one call), list_projects, register_agent
Task board — list_tasks (with ready_only), claim_task (atomic, leased), update_task (progress + lease renewal), complete_task, get_task_graph
Shared context — save_context, search_context, record_decision, get_briefing ⭐
Review loop — submit_for_review, get_review_queue, post_review
Discussion & consensus — open_discussion, post_to_discussion, resolve_discussion (consensus becomes a recorded decision automatically), list_discussions
Workflow templates — list_workflow_templates, get_workflow_template (ship-feature, refactor-module, debug-issue — dependency-wired task graphs ready for submit_plan)
Verification & reflection — run_checks (allowlisted: pytest, ruff, mypy, npm, cargo, go, …; no shell, hard timeout, evidence recorded), get_retrospective (swarm performance evidence: bounce rates, iterations, per-agent stats)
Resources & Prompts
Live swarm state, readable without tool calls:
swarm://projects · swarm://agents · swarm://project/{id}/status ·
swarm://project/{id}/tasks · swarm://project/{id}/decisions ·
swarm://project/{id}/discussions · swarm://project/{id}/retrospective ·
swarm://project/{id}/context
Role prompts that make any MCP client swarm-ready in one message:
planner · implementer · reviewer · standup_summary (rendered from live board state)
Demo: a MiniMax M3 swarm builds software through ForgeSwarm
examples/minimax_swarm_demo.py runs three
MiniMax M3 agents — planner, implementer, reviewer — that coordinate entirely
through ForgeSwarm tools over a real MCP stdio session: the planner decomposes a
goal into a task graph, the implementer claims tasks and submits work, the reviewer
approves or bounces it, and the loop runs until the board is green.
pip install -e ".[demo]"
set MINIMAX_API_KEY=sk-... # export on macOS/Linux
python examples/minimax_swarm_demo.py "Build a CLI pomodoro timer in Python"
M3 is also available through OpenRouter (same model, smaller minimum top-up):
set MINIMAX_API_KEY=sk-or-...
set MINIMAX_BASE_URL=https://openrouter.ai/api/v1
set MINIMAX_MODEL=minimax/minimax-m3
No API key handy? examples/quickstart_client.py
walks the identical workflow with a scripted client — no LLM required:
python examples/quickstart_client.py
Verified run
A real run of the M3 swarm against "Build a CLI pomodoro timer in Python"
went from a bare goal to a finished, reviewed project with zero human
intervention — three M3 agents talking only through ForgeSwarm tools:
m3-plannerregistered itself, created the project, decomposed the goal into 8 dependency-ordered tasks (scaffold → timer state machine → config → notifier → CLI → tests → docs), and recorded 4 architectural decisions (stdlib-only, foreground blocking timer, XDG config path, stderr UI honoringNO_COLOR).m3-impl-1claimed each ready task in dependency order, wrote the source viasave_context, andsubmit_for_review'd every deliverable.m3-reviewer-1pulled the review queue, cross-checked each submission againstget_briefing(goal, constraints, decisions, prior feedback), andpost_review'd a verdict for each.
The board went 8/8 done, and the closing standup_summary prompt — also
answered by M3, purely from live board state — correctly reported:
All planned work is complete – 8/8 tasks closed... The project is feature-complete: scaffold, timer FSM, config, notifications, CLI, tests, and docs are all landed.
Single Most Important Next Action: Run a full end-to-end smoke test of the shipped CLI... and, if green, tag
v0.1.0and cut a release. Until we exercise the integrated binary, the "done" labels reflect unit-level completion only.
No agent ever had to be told what another agent decided, claimed, or reviewed — every coordination fact came from ForgeSwarm's shared state.
Architecture
src/forgeswarm/
├── server.py # FastMCP app + stdio/streamable-HTTP entrypoint
├── store.py # SQLite (WAL): atomic claims, leases, review state machine
├── models.py # Pydantic contracts returned by every tool
├── tools/ # planning · tasks · context · review · checks
├── resources.py # swarm:// live state
└── prompts.py # planner / implementer / reviewer / standup
Design choices worth knowing:
- SQLite over in-memory — over stdio every client spawns its own server process;
shared swarm state must live on disk. WAL mode + a busy timeout keeps concurrent
agents safe, and one conditional
UPDATEmakes claims race-free. - The loop is server-enforced — review outcomes mutate task state in the same transaction as the verdict. An agent cannot skip review by prompt injection or forgetfulness; the state machine simply won't move.
run_checksis verification, not execution — clients already execute code. The server's job is evidence: allowlisted executables, no shell, hard timeout, output recorded where reviewers can see it.
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 模型以安全和受控的方式获取实时的网络信息。