Skip to main content

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

Project description

codex-mcp-swarm

An MCP server that wraps OpenAI's Codex CLI with true parallel execution and live task monitoring. Zero dependencies -- single Python file, stdlib only.

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:

  • Batch wait -- launch N tasks, call codex_wait once, get all results when they finish
  • 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

Tools

Tool Description
codex Synchronous execution (drop-in replacement for official)
codex_async Fire-and-forget -- returns a task_id immediately
codex_reply Continue a previous session via codex exec resume
codex_status Live view: tools called, last command, current thinking
codex_wait Block until multiple tasks complete, return all results

Installation

Claude Code

claude mcp add codex-swarm -- uvx --upgrade codex-mcp-swarm \
  -c model=gpt-5.4 \
  -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-5.4",
        "-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

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")

Server flags

Flag Description
-c key=value Config default (repeatable). Same format as codex mcp-server.
--skip-git-repo-check Allow running outside git repos.
--ephemeral Don'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
  • config -- object of key=value overrides
  • base-instructions, developer-instructions, compact-prompt

Environment variables

Variable Default Description
CODEX_SWARM_LOG /tmp/codex_mcp_swarm.log Log file path
CODEX_SWARM_LOG_LEVEL WARNING Log level (DEBUG, INFO, WARNING, ERROR)
CODEX_SWARM_TASK_DIR /tmp/codex_swarm_tasks Task output storage directory

Requirements

  • Python 3.8+
  • Codex CLI installed and authenticated
  • No pip dependencies (stdlib only)
  • Works on Linux and macOS (Linux gets extra PID reuse protection and zombie detection via /proc)

Credits

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_mcp_swarm-1.4.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_mcp_swarm-1.4.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file codex_mcp_swarm-1.4.0.tar.gz.

File metadata

  • Download URL: codex_mcp_swarm-1.4.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for codex_mcp_swarm-1.4.0.tar.gz
Algorithm Hash digest
SHA256 b84c75ef9ac9228aaca2d2d41fb3b08527a41e7ca9658d1f13e19ef93390e76f
MD5 81c290ae36647d9936b9517c56b3cb45
BLAKE2b-256 00e611f83fa1e862038a8957369f53dfc0d0d73a95b88894a079d26e8f3ca9fc

See more details on using hashes here.

File details

Details for the file codex_mcp_swarm-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for codex_mcp_swarm-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a207872de4a954fa27e05cab46b1f075a5f33a24c5615c5d0e5099d6a3de51
MD5 0dbc6439940abf3c54313dd9fdacda2f
BLAKE2b-256 52164688df6c1e369ac5032d116654a4d17fa4112dc8396e0989b5204b809db6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page