Codex Subagent logo

Codex Subagent

Delegate bounded coding tasks to a local OpenAI Codex CLI with selectable models, reasoning effort, and background jobs.

Install Codex Subagent

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "codex-subagent": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 9 tools correctly ().

Overview

Codex Subagent MCP server lets an MCP client delegate coding work to the OpenAI Codex CLI installed on the same machine. It exposes tools for checking the CLI, selecting models and reasoning effort, running synchronous or background tasks, continuing threads, and reviewing usage. Read-only execution is the default, while explicit sandbox settings and optional worktrees control write access. Reach for it when a coding agent needs a second model family, isolated investigation, or long-running implementation work.

Use cases

  • Delegate repository investigations without filling the orchestrator's context
  • Run an independent code review with a different model family
  • Start long-running test or implementation tasks in the background
  • Continue a Codex thread with follow-up questions
  • Apply changes inside a managed Git worktree

Key features

  • Per-task model and reasoning-effort selection
  • Foreground and background Codex delegations
  • Schema-constrained JSON results
  • Read-only default with sandbox controls
  • Managed Git worktree support
  • Background job and local usage management

Tools9

What Codex Subagent lets your agent do. Expand a tool for its parameters.

Verified live~2.8k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 47d

What it can do

From the 9 tools this server returned when we ran it; 9 declare their own safety hints.

Can delete or modify data · 1Writes files · 1Handles credentials · 1Makes network requests · 3Read-only tools · 7
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceSigned build
Package age72 days
Maintainers1

Observed 2026-11-23 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 14d ago via OSV.dev · codex-subagent-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads625Package downloads in the last 30 days.
Last commit5d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.
Directory activity7 viewsConfig copies, upvotes, and views on AllMCPs.

How Codex Subagent works

What Codex Subagent MCP server does

Codex Subagent MCP server connects an MCP client to the OpenAI Codex CLI running locally. The CLI must already be installed, available on PATH, and signed in; the MCP server does not hold separate credentials. Prompts are sent to OpenAI through Codex in the same way as direct CLI use.

The server is suited to delegated coding work rather than general API access. An orchestrating agent can ask Codex to inspect files, diagnose failures, review code, write tests, apply changes, or return a structured result. Choosing a different model family can provide an independent review, while the reasoning-effort setting lets each delegation receive an appropriate budget.

How it works

A client calls codex_delegate with a task and optional model, reasoning effort, working directory, sandbox, context, system instructions, and output schema. The call can block until completion or start a background job. Structured output is available when the requested result must conform to a supplied JSON schema.

Background work returns a job identifier. The client can check progress, retrieve the finished output, or cancel a running job. Up to eight background delegations can run simultaneously by default; CODEX_SUBAGENT_MAX_BACKGROUND_JOBS can reduce that limit. A follow-up uses the original delegation's thread_id and continues its Codex context.

Each completed delegation reports the model, effort, sandbox, directory, duration, token information, and thread identifier when available. It also checks the requested execution settings against what Codex recorded for the run and reports differences or unconfirmed values.

Setup and configuration

The server requires Node.js 22 or newer and a separately installed Codex CLI. After signing in to Codex and confirming it is on PATH, add it to Claude Code with:

Terminal
claude mcp add codex-subagent -- npx -y codex-subagent-mcp

codex_doctor checks the installation and explains corrective steps. Its extended: true option performs a slower, networked config.load check. The package also supports installation through other MCP client setup methods.

Tools and capabilities

  • codex_doctor validates the Codex CLI setup.
  • list_codex_models reports models and their available reasoning-effort levels.
  • codex_recommend suggests a model and effort for a described task.
  • codex_delegate runs a foreground or background delegation, optionally against an output schema.
  • codex_follow_up resumes a prior delegation by thread ID.
  • codex_job_status, codex_job_result, and codex_job_cancel manage background work.
  • codex_usage summarizes the opt-in local usage log by time window and selected grouping fields.

Delegations are read-only by default. workspace-write enables edits within the working directory, while use_worktree places edits in a managed Git worktree under ~/.codex/worktrees/. The sandbox ceiling and additional directories bound where Codex can operate. Results report file changes recorded by Codex.

Limitations and notes

The server runs another local process, so enabling writes requires care. Unsandboxed execution is unavailable unless explicitly permitted through the configured ceiling. The operating-system sandbox uses Seatbelt on macOS, bubblewrap on Linux and WSL2, and a native sandbox on Windows. Sandbox behavior can be stricter on Windows, and the documented measurements were made on macOS.

Sandbox restrictions apply to commands run by Codex's shell, not to MCP or plugin tools, which run separately with the account's permissions. Cancelling, timing out, or shutting down stops Codex and discoverable child commands, but a command that detached from the process tree may continue. Managed worktrees are not automatically cleaned up and can retain unapplied changes. Codex configuration settings such as network access or extra writable roots may still affect workspace-write runs.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Codex Subagent

Codex Subagent is an MCP server that connects an MCP client to the OpenAI Codex CLI on the same machine. Its main tools check the CLI, list and recommend models, delegate foreground or background coding tasks, continue threads, manage jobs, and summarize opt-in local usage.

Install Node.js 22 or newer and the Codex CLI, put Codex on `PATH`, sign in, then run `claude mcp add codex-subagent -- npx -y codex-subagent-mcp` in Claude Code. Use `codex_doctor` to check the installation.

Yes, Claude Code is the documented setup target. Add the server with the `claude mcp add` command, then use its MCP tools to delegate work to the locally installed Codex CLI.

Yes, `codex_delegate` can start a background delegation and return a `job_id`. Use `codex_job_status` to check progress, `codex_job_result` to read completed output, or `codex_job_cancel` to stop a running job.

Yes, but read-only execution is the default. Explicitly choose `workspace-write` or use a managed worktree with `use_worktree`; the sandbox and directory settings constrain where Codex can write.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCodex Subagent AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/codex-subagent?style=directory)](https://allmcps.com/mcp/codex-subagent)
HTML Embed
<a href="https://allmcps.com/mcp/codex-subagent"><img src="https://allmcps.com/api/badge/codex-subagent?style=directory" alt="Codex Subagent on AllMCPs" /></a>