Skip to content
MCP server

codex-mcp-swarm MCP Server

Parallel Codex MCP server with live task monitoring, batch wait, and full flag parity

codex-mcp-swarm scores 48 (Fair), licensed MIT and written in Python. It installs as a local process. It declares 5 tools. Filed under AI and memory. GitHub shows 17 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by tkasperczykMITPython17 stars
Trust score
48Fair
Trust score 48 of 100, Fair

Fair trust

48 of 100 from six public signals. Nobody can buy a point.

  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 48 comes from

0 + 20 + 4 + 10 + 4 + 10 = 48. Each factor is capped, so no single signal can carry a listing.

Registry0 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 0 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity4 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 4 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "tkasperczyk-codex-mcp-swarm": {      "command": "uvx",      "args": [        "codex-mcp-swarm"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools5Tool docs quality grade C

All capabilities
  • Launch a task, get a taskid immediately (fan-out). Not fire-and-forget: results come back only via codexwait. Pass threadId to resume a session

  • Kill a running async task and its child process tree (preserves worktree for inspection); if it already completed or failed, preserve and report that outcome

  • Continue a previous session via codex exec resume (accepts optional cwd, model, sandbox, approval-policy, config); uses the same structured failure reporting and MCP Tasks support as codex

  • Live view: tools called, last command, current thinking, warnings, and terminal failure cause

  • Block until multiple tasks complete and return results or structured failure details

About

codex-mcp-swarm

An MCP server that wraps OpenAI's Codex CLI with true parallel execution and live task monitoring. Powered by stdlib-only mcp-swarm-core (zero third-party runtime dependencies).

Why?

The official codex mcp-server processes requests sequentially. If your MCP client (Claude Code, etc.) needs to run 5 Codex tasks, they queue up one after another. This server spawns each task as an independent subprocess, so they run in parallel.

Unique features no other Codex MCP wrapper has:

  • Worktree isolation -- worktree: true creates an isolated git worktree per task so parallel Codex instances never edit past each other
  • Batch wait & MCP Tasks -- supports both explicit fan-out (codex_async + codex_wait) and the official MCP 2026-07-28 Tasks extension (io.modelcontextprotocol/tasks)
  • Live status -- see what each Codex task is doing right now (last tool call, current reasoning, progress)
  • Full flag parity -- same parameters as the official Codex MCP tool (sandbox, approval-policy, cwd, model, config, etc.)
  • Drop-in config -- accepts the same -c key=value server args as codex mcp-server

MCP Protocol Support

  • Stateless MCP 2026-07-28 -- supports server/discover, per-request _meta["io.modelcontextprotocol/protocolVersion"] and _meta["io.modelcontextprotocol/clientCapabilities"], resultType discriminators, and unsupported-version rejection (-32022).
  • Official Tasks extension (io.modelcontextprotocol/tasks) -- when a client advertises io.modelcontextprotocol/tasks, codex and codex_reply immediately return a CreateTaskResult (resultType: "task") with a 128-bit taskId. Clients poll tasks/get (receiving live JSONL activity in statusMessage, then status: "completed" with the final CallToolResult — carrying isError: true on tool-level Codex failures per SEP-2663 — or status: "cancelled" if aborted) and can cancel via tasks/cancel (which returns -32602 on already-terminal tasks). codex_async / codex_wait / codex_status / codex_cancel remain available for non-Tasks clients and multi-task batch fan-out.
  • Backward-compatible stateful MCP (2024-11-05–2025-11-25) -- supports initialize negotiation, top-level server instructions, ping, tool annotations, outputSchema + structuredContent (alongside plain-text content), accurate isError flags on failures, live enriched notifications/progress, and JSON-RPC 2.0 §4.1 silent handling of unknown notifications.

Tools

ToolDescription
codexSynchronous execution (or native MCP Task when client supports io.modelcontextprotocol/tasks); terminal failures set isError: true and include the model, structured cause, category, and retryability
codex_asyncLaunch a task, get a task_id immediately (fan-out). Not fire-and-forget: results come back only via codex_wait. Pass threadId to resume a session
codex_replyContinue a previous session via codex exec resume (accepts optional cwd, model, sandbox, approval-policy, config); uses the same structured failure reporting and MCP Tasks support as codex
codex_statusLive view: tools called, last command, current thinking, warnings, and terminal failure cause
codex_waitBlock until multiple tasks complete and return results or structured failure details
codex_cancelKill a running async task and its child process tree (preserves worktree for inspection); if it already completed or failed, preserve and report that outcome

Installation

Claude Code

claude mcp add codex-swarm -- uvx --upgrade codex-mcp-swarm \
  -c model=gpt-6.2-astra \
  -c approval_policy=never \
  -c sandbox_mode=danger-full-access \
  --skip-git-repo-check

That's it. No clone, no setup. uvx downloads and runs it directly from PyPI. The --upgrade flag ensures you always get the latest version on restart.

Note: Requires uv (curl -LsSf https://astral.sh/uv/install.sh | sh). Alternatively, use pipx run codex-mcp-swarm instead of uvx codex-mcp-swarm.

Manual (~/.claude.json)

{
  "mcpServers": {
    "codex-swarm": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--upgrade",
        "codex-mcp-swarm",
        "-c", "model=gpt-6.2-astra",
        "-c", "approval_policy=never",
        "-c", "sandbox_mode=danger-full-access",
        "--skip-git-repo-check"
      ]
    }
  }
}

The -c flags are identical to codex mcp-server -- copy-paste your existing config.

Usage

Parallel execution

1. Call codex_async with prompt A  -->  task_id: "abc123"
2. Call codex_async with prompt B  -->  task_id: "def456"
3. Call codex_async with prompt C  -->  task_id: "ghi789"
4. Call codex_wait(task_ids=["abc123", "def456", "ghi789"])
   --> blocks until all finish, returns all results

Collecting results: read this before you fan out

A task_id is internal to this server. Your MCP client does not track it. It will not appear in a task list, and no notification fires when the task finishes. If the agent's turn ends before codex_wait is called, the Codex run still completes and writes its result to disk, but nothing is left to deliver it and nothing wakes the session. codex_status is a progress peek only; it collects nothing.

So: codex_async and codex_wait belong in the same turn.

Let the wait run long. Claude Code moves any main-conversation tool call still running after two minutes into a tracked background task and re-invokes the session with the result when it settles -- that is the wake-up mechanism, so crossing the two-minute line is the goal rather than something to dodge. Short timeout values are raised to a floor (default 150s, override with CODEX_SWARM_MIN_WAIT) for exactly this reason. Tasks that have already finished return instantly regardless of the floor.

Failure reporting and terminal precedence

codex exec writes progress, warnings and sandbox notices to stderr on perfectly healthy runs. Until 1.10.0, a task whose exit code was lost to a reaping race was marked failed on the strength of non-empty stderr alone, so finished work got reported as a failure and callers acted on it.

Version 1.11.0 uses the terminal events in codex exec --json as the primary lifecycle signal. An unambiguous turn.completed means success even if an earlier top-level error event was emitted while the CLI retried. An unambiguous turn.failed means failure even if an earlier, partial agent_message exists. Top-level error events are diagnostic rather than terminal, because the public JSONL omits the CLI's internal will_retry field; item.completed events whose item type is error are warnings. If terminal events are absent or contradict each other, an observed process exit code decides the result. Only a verdict made without either signal is marked as inferred, and both completion and failure outputs label that explicitly.

Terminal failures report the model parsed from the command that actually ran, the structured turn.failed.error.message, a failure category, whether a later retry is likely to be useful, and a suggested action. Retryability is information only: the wrapper never starts a second Codex turn. The Codex CLI may perform its own in-turn retries. Stderr can be included as a clearly labeled, truncated diagnostics section, but it never replaces the primary failure cause.

Two things follow for anyone consuming this server:

  • A FAILED from codex_status or codex_wait that is flagged as inferred is a prompt to verify, not a conclusion. Check pgrep -af 'codex exec', file mtimes, the worktree branch, and your own build or tests.
  • A codex_wait that times out is not a failure at all. The task is not killed. Call codex_wait again with the same task_id.

Worktree isolation

Prevent parallel tasks from editing the same files:

1. Call codex_async(prompt="Refactor auth", worktree=true)
   --> task_id: "abc123"
   --> Worktree Branch: codex-swarm/abc123

2. Call codex_async(prompt="Add logging", worktree=true)
   --> task_id: "def456"
   --> Worktree Branch: codex-swarm/def456

3. codex_wait(task_ids=["abc123", "def456"])
4. git merge codex-swarm/abc123
5. git merge codex-swarm/def456

Each task gets its own git worktree and branch based on HEAD (git worktree add -b codex-swarm/<id> ... HEAD). After completion, merge the branches back. Expired worktrees (older than CODEX_SWARM_TASK_MAX_AGE, default 24 hours) are lazily removed on a subsequent task launch via git worktree remove --force and git branch -D -- any uncommitted changes or unmerged commits still left in an expired worktree are discarded, so merge or cherry-pick before expiry.

Caveat: Because worktrees branch from HEAD, uncommitted and untracked changes in your working tree are not included in the worktree. Commit any prerequisite edits first if the Codex task needs to see them.

Live monitoring

Call codex_status(task_ids=["abc123"])
-->
=== Task abc123 (45s elapsed) ===
Phase: running
Tools called: 23
Last tool: exec_command(grep -rn "handleError" src/)
Output: Analyzing error handling patterns across the codebase...

Session continuity

1. Call codex(prompt="Review this file")  -->  result + session persisted
2. Call codex_reply(threadId="<session-uuid>", prompt="Now fix the bug you found")

For a follow-up that will run more than a few minutes, resume in the background instead -- codex_async accepts threadId and gives you a task_id that survives a client idle timeout:

1. Call codex_async(threadId="<session-uuid>", prompt="Now implement it")
                                          -->  task_id: "abc123"
2. Call codex_wait(task_ids=["abc123"])   -->  result, with full prior context

codex_reply is synchronous and emits progress notifications while it waits, but a client that gives up on silence will still abandon the request. Only the async path leaves you a handle to recover with.

Server flags

FlagDescription
-c key=valueConfig default (repeatable). Same format as codex mcp-server.
--skip-git-repo-checkAllow running outside git repos.
--ephemeralDon't persist session files. Disables codex_reply.

Per-call parameters

All parameters from the official Codex MCP tool are supported:

  • prompt (required)
  • model -- override server default
  • sandbox -- read-only, workspace-write, danger-full-access
  • approval-policy -- untrusted, on-failure, on-request, never
  • cwd -- working directory
  • profile -- config profile from config.toml (ignored on threadId resumes -- codex exec resume has no --profile flag)
  • config -- object of key=value overrides
  • worktree -- run in an isolated HEAD-based git worktree (prevents parallel tasks from conflicting; excludes uncommitted changes)
  • base-instructions, developer-instructions, compact-prompt

MCP Resources

The server exposes read-only resources for discoverability:

URIDescription
codex-swarm:///server-infoVersion, capabilities, directories, config
codex-swarm:///configCurrent server-level defaults and flags
codex-swarm:///tasksAll known tasks and their current state; failed entries include model, cause, category, and retryability

Environment variables

VariableDefaultDescription
CODEX_SWARM_LOG<user-runtime>/codex-swarm/codex_mcp_swarm.logLog file path
CODEX_SWARM_LOG_LEVELWARNINGLog level (DEBUG, INFO, WARNING, ERROR)
CODEX_SWARM_TASK_DIR<user-runtime>/codex-swarm/tasksTask output storage directory (owner-only 0700 when using default)
CODEX_SWARM_WORKTREE_DIR<user-cache>/codex-swarm/worktreesWorktree storage directory (owner-only 0700 when using default)
CODEX_SWARM_TASK_MAX_AGE86400 (24h)Seconds after completion / last reply activity before task artifacts (and worktrees) are cleaned up
CODEX_SWARM_MIN_WAIT150Floor in seconds for codex_wait. Keeps the call above the client's 2-minute auto-backgrounding threshold so completion re-invokes the session. Already-finished tasks ignore it
CODEX_SWARM_CODEX_BIN(auto)Windows only: path to codex.exe or to the npm package's codex.js, overriding the PATH lookup. Batch files (.cmd/.bat) are refused

<user-runtime> defaults to $XDG_RUNTIME_DIR when available, else /tmp/codex-swarm-<uid> on POSIX or %TEMP%\codex-swarm on Windows. <user-cache> defaults to ${XDG_CACHE_HOME:-~/.cache} on POSIX (keeping full git checkouts off RAM-capped runtime tmpfs) or %TEMP% on Windows. Note: if upgrading from <= 1.13.1, any old task/worktree files left under /tmp/codex_swarm_tasks or /tmp/codex-swarm-worktrees are no longer managed automatically and can be removed manually.

Requirements

  • Python 3.8+
  • Codex CLI installed and authenticated
  • Only depends on stdlib-only mcp-swarm-core (no third-party packages)
  • Works on Linux and macOS (Linux gets extra PID reuse protection and zombie detection via /proc; cancellation and timeouts terminate the entire child process group)
  • Works on Windows (native, no WSL): PID reuse protection via process creation time, cancellation kills the whole process tree

Windows notes

  • An npm-installed Codex is a codex.cmd shim. The server resolves it to node .../@openai/codex/bin/codex.js and never runs Codex through cmd.exe, which would cut multi-line prompts at the first newline and interpret & | < > ^ %. If Codex lives elsewhere, set CODEX_SWARM_CODEX_BIN.
  • Children are started without a console window and in their own process group. Async tasks are not tied to the server process, but if the MCP client runs the server inside a kill-on-close job object, they end with it.
  • Prompts are passed via standard input (-), so large or leading-- prompts do not hit the 32,767-character Windows command-line limit (only config/instruction flags remain on argv).
  • Codex itself needs a Windows sandbox backend. Without one (codex doctor shows sandbox backend disabled), read-only/workspace-write calls with approval-policy: never reject every shell command as "blocked by policy". Set it in ~/.codex/config.toml (unelevated needs no admin rights):
    [windows]
    sandbox = "unelevated"
    

Credits

Originally inspired by jeanchristophe13v/codex-mcp-async. Rewritten with full flag parity, JSONL status parsing, batch wait, and session reply support.

License

MIT

Frequently asked questions

What is codex-mcp-swarm MCP Server?

Parallel Codex MCP server with live task monitoring, batch wait, and full flag parity

How do I install codex-mcp-swarm MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. codex-mcp-swarm MCP Server runs locally from the PyPI package codex-mcp-swarm with the command uvx codex-mcp-swarm.

Is codex-mcp-swarm MCP Server free and open source?

Yes. codex-mcp-swarm MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does codex-mcp-swarm MCP Server support remote (HTTP) connections?

No remote endpoint is listed for codex-mcp-swarm MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does codex-mcp-swarm MCP Server provide?

codex-mcp-swarm MCP Server provides 5 tools, including codex_async, codex_cancel, codex_reply, and codex_status. See the full tool list for descriptions and parameters.

How is codex-mcp-swarm MCP Server's trust score calculated?

codex-mcp-swarm MCP Server scores 48 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server