Claude MCP Swarm
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Claude MCP Swarm Run 3 agents in parallel to add tests, docs, and types to the auth module"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-mcp-swarm
An MCP server that wraps Anthropic's Claude Code CLI (claude) with true parallel execution, live task monitoring, git worktree isolation, and MCP Tasks support. Powered by stdlib-only mcp-swarm-core (zero third-party runtime dependencies).
Why?
Run multiple Claude Code (claude -p) agents concurrently from Codex, Antigravity, Claude Code, or any MCP client without serial queueing, with live visibility into tool calls, token usage, structured output, tool errors, permission denials, and isolated HEAD-based git worktrees.
Key features:
True parallel fan-out - each task runs as an independent
claude -p --output-format=stream-json --verbosesubprocessWorktree isolation -
worktree: truecreates an isolatedHEAD-based git worktree (claude-swarm/<id>) per task so parallel runs never edit past each otherBatch wait & MCP Tasks - supports both explicit fan-out (
claude_async+claude_wait) and the official MCP 2026-07-28 Tasks extension (io.modelcontextprotocol/tasks)Live JSONL streaming status - parses
system,assistant,user, and terminalresultNDJSON events incrementally for live tool counts, last tool call, token usage, tool errors, and permission denialsNon-interactive
claude -pflag support ---model,--fallback-model,--effort,--permission-mode,--dangerously-skip-permissions,--tools,--allowed-tools,--disallowed-tools,--add-dir,--agent,--agents,--system-prompt,--append-system-prompt,--json-schema,--settings,--setting-sources,--mcp-config,--strict-mcp-config,--max-turns,--max-budget-usd,--disable-slash-commands,--no-session-persistence,--bare,--resume, and--fork-sessionSafe stdin transport - prompts are sent via UTF-8 stdin and all value options use
--flag=valuesyntax, avoiding OS argv length limits, leading--option injection, Commander.js variadic greediness, and Windows shell quoting issues
Related MCP server: Roundtable AI MCP Server
MCP Protocol Support
Stateless MCP
2026-07-28- supportsserver/discover, per-request_meta["io.modelcontextprotocol/protocolVersion"]and_meta["io.modelcontextprotocol/clientCapabilities"],resultTypediscriminators, and unsupported-version rejection (-32022).Official Tasks extension (
io.modelcontextprotocol/tasks) - when a client advertisesio.modelcontextprotocol/tasks,claudeandclaude_replyimmediately return aCreateTaskResult(resultType: "task") with a 128-bittaskId. Clients polltasks/getand cancel viatasks/cancelper SEP-2663.Backward-compatible stateful MCP (
2024-11-05through2025-11-25) - supportsinitializenegotiation, top-level serverinstructions,ping, toolannotations,outputSchema+structuredContent, accurateisErrorflags, enrichednotifications/progress, and JSON-RPC 2.0 §4.1 silent handling of unknown notifications.
Tools
Tool | Description |
| Synchronous execution (or native MCP Task when client supports |
| Launch a task, get a |
| Continue a previous session via |
| Live read-only peek: tools called, last tool call, permission mode, tool errors, token usage, and failure cause |
| Block until multiple tasks complete and return results or structured failure details |
| Kill a running async task and its child process tree (preserves worktree for inspection); if already completed or failed, preserves and reports that outcome |
| List available Claude Code model aliases/identifiers, resolved model IDs, and supported effort levels (queried live without starting a turn, persisting a session, or running hooks) |
Installation
PyPI
uvx --upgrade claude-mcp-swarm --model opusLocal checkout (development)
uvx --from /path/to/claude-mcp-swarm --with /path/to/mcp-swarm-core claude-mcp-swarm --model opusCodex (~/.codex/config.toml)
[mcp_servers.claude-swarm]
command = "uvx"
args = ["--upgrade", "claude-mcp-swarm", "--model", "opus", "--dangerously-skip-permissions"]Unattended permissions & MCP isolation
Pass
--dangerously-skip-permissionsor--permission-mode bypassPermissions/acceptEdits/dontAskin server defaults (or per call) for unattended runs in trusted repos or sandboxes.If you want spawned Claude workers to skip loading your user MCP servers (faster startup and avoids recursive MCP server loading), pass
--strict-mcp-config(optionally with--mcp-config <file-or-json>).
Usage
Parallel execution
1. Call claude_async(prompt="Audit module A", worktree=true) -> task_id: "a1b2c3d4"
2. Call claude_async(prompt="Audit module B", worktree=true) -> task_id: "e5f60718"
3. Call claude_wait(task_ids=["a1b2c3d4", "e5f60718"])
-> blocks until all finish, returns all resultsclaude_async and claude_wait belong in the same turn: task_id is internal to this server and not tracked by legacy MCP clients. Short timeout values on claude_wait are raised to a floor (default 150s, configurable via CLAUDE_SWARM_MIN_WAIT) so long waits cross the client's 2-minute auto-backgrounding threshold; already-finished tasks return immediately.
Session continuity & worktree cwd preservation
When
cwdis omitted onclaude_reply(orclaude_async(session_id=...)), the server automatically reuses the original session's working directory (including its worktree path if it still exists; persisted on disk for async and worktree runs, and tracked in-process for non-worktree sync runs).Pass
fork_session: truealongsidesession_idto branch a conversation into a newsession_idwithout mutating the original transcript.Note that
no_session_persistence: truedisables writing session transcripts to disk, so those sessions cannot be resumed later.
Structured output (json_schema)
Pass json_schema (JSON object or string) to forward --json-schema to Claude Code so it can emit validated JSON via its StructuredOutput tool. When claude returns result.structured_output, it is exposed on structuredContent.structured_output. Callers should still check that structured_output is present, because Claude CLI can exit 0 without it on short-circuited CLI commands or prose fallbacks.
Credentials in config flags
Inline JSON passed via --settings or --mcp-config is redacted from the claude-swarm:///config resource, while file paths remain visible. Prefer file paths (e.g. --mcp-config /path/to/mcp.json) over inline tokens or env secrets so credentials are not passed on process command lines or stored in .meta files.
Worktree isolation
Caveats:
Because worktrees branch from
HEAD(git worktree add -b claude-swarm/<id> ... HEAD), uncommitted and untracked changes in your working tree are not included in the worktree. Commit prerequisite edits first if the task needs them.Expired worktrees (older than
CLAUDE_SWARM_TASK_MAX_AGE, default 24 hours) are lazily removed on a subsequent task launch viagit worktree remove --forceandgit branch -D. Merge or cherry-pick before expiry.
Server flags
Flag | Description |
| Show version and exit |
| Default model alias or full name (e.g. |
| Default fallback model(s), comma-separated |
| Default reasoning effort ( |
| Default permission mode ( |
| Bypass all permission checks by default |
| Built-in tools to expose ( |
| Tool rule to allow by default (repeatable) |
| Tool rule to deny by default (repeatable) |
| Additional directory Claude can access by default (repeatable) |
| Default agent name |
| Default custom agents JSON object or file path |
| Default system prompt override |
| Default text appended to the system prompt |
| Default extra settings JSON object or file path |
| Comma-separated setting sources ( |
| Default MCP config file or JSON string (repeatable) |
| Only use MCP servers from |
| Default maximum agentic turns per invocation |
| Default maximum API budget in USD per invocation |
| Disable skills and slash commands by default |
| Do not persist sessions to disk by default |
| Minimal headless mode (skip hooks, plugins, CLAUDE.md discovery, OAuth/keychain; API-key / provider auth only) |
Boolean server flags can be explicitly overridden to false on any individual tool call.
MCP Resources
URI | Description |
| Version, capabilities, directories, CLI protocol contract |
| Current server-level CLI defaults |
| Available Claude Code model aliases, resolved IDs, and supported effort levels |
| All known tasks and their state, usage, tool errors, permission denials, and failure details |
Environment variables
Variable | Default | Description |
|
| Log file path |
|
| Log level ( |
|
| Task output storage directory (owner-only |
|
| Worktree storage directory (owner-only |
|
| Seconds after completion / last reply activity before task artifacts and worktrees are cleaned up |
|
| Floor in seconds for |
| (auto) | Explicit path or command name for |
Requirements
Python 3.8+
Claude Code CLI (
claude) installed and authenticatedOnly depends on stdlib-only
mcp-swarm-core(no third-party packages)
License
MIT
Available Tools
7 toolsclaudeADestructive
Run a Claude Code (claude -p) session synchronously (or as a native MCP Task when the client advertises io.modelcontextprotocol/tasks). This server applies NO timeout of its own, but legacy MCP clients typically cut a tool call around 300s -- use claude_async + claude_wait for long runs or parallel fan-out on non-Tasks clients.
Inputs: prompt (required), cwd, bare, agent, +24 more. Returns: text, model, usage, effort, +16 more
claude_asyncADestructive
Launch a Claude Code task and return immediately with a task_id for parallel fan-out, then collect with a single claude_wait. CRITICAL: the task_id is internal to this server and NOT tracked by your MCP client -- you MUST call claude_wait in the same turn or results are stranded on disk. Pass session_id to resume an existing session asynchronously, and set worktree=true to isolate parallel edits in a HEAD-based git worktree.
Inputs: prompt (required), cwd, bare, agent, +24 more. Returns: error, model, status, task_id, +2 more
claude_cancelADestructiveIdempotent
Kill a running async Claude Code task and its child processes. Any worktree and partial output are preserved for inspection. If the task had already failed, the response includes its structured failure details.
Inputs: task_id (required). Returns: error, model, status, message, +10 more
claude_modelsARead-onlyIdempotent
List available Claude Code model aliases/identifiers, their resolved model IDs, and supported effort levels (queried live from the Claude Code CLI without starting a turn or persisting a session). Use this before passing a model override to claude / claude_async / claude_reply.
Inputs: no named parameters. Returns: error, models, source, warning, +1 more
claude_replyADestructive
Continue a Claude Code session via claude --resume=<session_id> (runs synchronously, or as a native MCP Task when the client advertises io.modelcontextprotocol/tasks). Automatically reuses the original session's cwd/worktree when cwd is omitted. Pass fork_session=true to branch into a new session_id. For long follow-ups on non-Tasks clients, prefer claude_async(session_id=..., prompt=...) + claude_wait.
Inputs: prompt (required), session_id (required), cwd, bare, +23 more. Returns: text, model, usage, effort, +14 more
claude_statusARead-onlyIdempotent
Get live status of async Claude Code tasks (tool calls, tool errors, permission mode, token usage, and terminal failure details). This is a read-only peek: it collects nothing and does not keep a task attached to your session -- only claude_wait does that. A FAILED verdict here is not always authoritative when inferred without a terminal event or exit code (flagged explicitly in the output).
Inputs: task_ids (required). Returns: tasks
claude_waitARead-onlyIdempotent
Block until one or more async Claude Code tasks complete, then return all results. Pass every task_id you launched in ONE call. Let it run long past your client's backgrounding threshold (short timeouts are raised to a floor; finished tasks return instantly). A wait timeout does NOT kill tasks -- call claude_wait again to keep waiting.
Inputs: task_ids (required), timeout. Returns: tasks
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct: launch (claude/claude_async), resume (claude_reply), inspect (claude_status), collect (claude_wait), cancel, and model listing. The main overlap is between claude (synchronous) and claude_async (asynchronous launch), plus claude_reply versus claude_async with a session_id, but the descriptions explicitly clarify these boundaries.
Six of seven tools follow a predictable claude_<verb> snake_case pattern: claude_async, claude_reply, claude_status, claude_wait, claude_cancel, claude_models. The base synchronous runner is just named 'claude', which is a minor but understandable deviation.
Seven tools is well-scoped for managing Claude Code sessions and async tasks. Each tool maps to a distinct lifecycle operation: run, launch, resume, inspect, wait, cancel, and list models.
The surface covers the core lifecycle well: synchronous execution, asynchronous launch, resumption, status inspection, result collection, cancellation, and model discovery. Minor gaps include no explicit session/task listing or worktree cleanup/management tool, though worktrees are handled implicitly through launch and cancel.
Maintenance
Related MCP Connectors
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Shared rooms where Claude Code, Codex, Cursor and other MCP agents talk and split work.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables coordinating Claude Code and Codex on one machine by fanning out tasks to multiple agents in isolated Git worktrees, comparing results, picking a winning candidate, and handing off work between harnesses. It provides MCP stdio tools, a CLI, and a local loopback web cockpit.Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant in an IDE to delegate tasks to multiple specialized AI coding assistants via MCP, running them in parallel with shared project context and synthesizing a single response. It uses existing CLI tools and subscriptions, supporting Codex, Claude, Cursor, Gemini, and 26+ MCP-compatible clients.-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to delegate work to nested subagents running on Codex and Claude Code, keeping each task's session, turn history and results durable in SQLite while the main chat continues. Supports async or blocking waits, mid-session context updates, git worktree isolation, read-only-by-default permission inheritance, and cancelling whole subagent trees.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to fan out multiple Google Antigravity (agy) CLI agents in true parallel, monitor their live progress and token usage, wait on batches, and cancel tasks. Adds git worktree isolation per task, conversation resume, structured output, and native MCP Tasks support so concurrent agent runs never block or edit over each other.MIT