What Codex Subagent does
Codex Subagent MCP server exposes OpenAI Codex CLI operations as MCP tools for an agent such as Claude Code. The calling agent remains responsible for orchestration while Codex handles a delegated coding task on the local machine. Prompts are sent through the installed CLI, so the server does not store or provide separate OpenAI credentials.
A delegation can request a specific model and reasoning-effort level from the models reported by the local Codex installation. Results identify the applied model, effort, sandbox, working directory, duration, token usage, and thread ID. An optional output schema can make the response JSON suitable for further automated handling.
How it works
The Codex Subagent MCP server starts the Codex CLI as a local process and passes the task through its standard invocation path. Delegations may block until completion or return a job ID for background execution. Background jobs can be inspected, read after completion, or cancelled. Up to eight background jobs may run concurrently by default, with an environment variable available to lower that limit.
Follow-up requests use a prior thread ID so Codex can continue with its existing context. The server repeats the model, effort, and directory settings on follow-ups. Cancellation, timeout, or shutdown stops Codex and commands started by that run.
Setup and configuration
Install Node.js 22 or later, install the Codex CLI separately, place it on PATH, and sign in to Codex. A Claude Code installation can register the server with:
claude mcp add codex-subagent -- npx -y codex-subagent-mcp
The repository also documents platform setup and Claude Desktop installation. Run codex_doctor to check whether the CLI is available and learn how to correct installation problems. Its extended mode performs a slower, networked configuration report.
Tools and capabilities
The available MCP tools cover the full delegation lifecycle:
codex_doctor checks the local CLI installation.
list_codex_models reports available models and reasoning levels.
codex_recommend suggests model and effort settings for a described task.
codex_delegate runs a foreground or background task and can enforce an output schema.
codex_follow_up continues a delegation by thread ID.
codex_job_status, codex_job_result, and codex_job_cancel manage background work.
Limitations and notes
Read-only execution is the default. Writing requires an explicit workspace-write setting or a configured default, and a worktree can place edits outside the main checkout. Sandbox ceilings restrict where Codex commands can write and whether they can access the network. Unsandboxed execution is unavailable unless explicitly permitted by the configured ceiling.
The operating-system sandbox applies to commands run by Codex, not to MCP or plugin tools that run as separate processes. The server does not automatically inherit those tools unless its configuration allows them. Linux and Windows behavior has not been measured in the repository's documented safety measurements, and sandboxed reads may be stricter on Windows. This project is independent and is not affiliated with OpenAI or Anthropic.