codex-app-server-mcp
Enables delegation of tasks to OpenAI Codex through a persistent codex app-server process, with tools for starting and continuing threads, waiting on results, responding to approval requests, steering or interrupting turns, running code reviews, and managing parallel worktree-isolated tasks.
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., "@codex-app-server-mcp Have Codex implement dark mode in this repo, then review its diff."
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.
codex-app-server-mcp
An MCP server that lets Claude Code (or any MCP client) delegate work to OpenAI Codex: Claude plans and reviews, Codex does the hands-on work.
Most Codex MCP wrappers shell out to codex exec once per task. This one keeps a single long-lived codex app-server process and speaks its JSON protocol directly, so it can do things exec can't:
Persistent threads: follow-ups go to the same Codex thread with its full context.
Async, never times out: every call returns within
wait_secondswith a progress snapshot; keep going withcodex_wait.Two-way: when Codex needs an approval or asks a question, the turn pauses and the request is handed to Claude (
codex_respond) instead of hanging.Steer and interrupt: add instructions to a running turn, or stop it.
Native code review, plus a steerable "adversarial" mode that challenges the design.
Parallel work: many threads at once, batch
codex_wait, optional isolated git worktree per task.Resume anything: continue threads started in the Codex app or CLI, or after a restart.
Live status, model list, structured output, web search, context compaction.
Tools
Tool | What it does |
| Start a task (new thread needs |
| Wait on one thread or a batch ( |
| Non-blocking peek: status, what Codex is doing right now, pending requests. |
| Answer a pending request: approvals take |
| Add instructions to the turn that's currently running. |
| Stop the running turn. |
| Codex's native read-only review of |
| Compact a long thread's history to free up context. |
| Models available to your Codex login, with supported reasoning efforts. |
| Recent Codex threads (including ones from the Codex app/CLI). |
Every task tool returns the same report:
{
"thread_id": "01a14aa3-…",
"turn_id": "01a14aa3-…",
"status": "waitingForInput",
"latest_message": "I need to clear the build directory first.",
"files_changed": [],
"commands_run": 3,
"recent_commands": [{ "command": "npm test", "exitCode": 1 }],
"pending_requests": [
{ "request_id": "req_1", "type": "approve_command", "command": "rm -rf build", "cwd": "/repo", "reason": null }
],
"hint": "Codex is blocked on these requests — answer each with codex_respond, then codex_wait."
}status is inProgress, waitingForInput, completed, interrupted or failed. A review adds review, a worktree run adds worktree: { path, branch }, and a running turn adds current_activity.
Related MCP server: subcodex-mcp
Install
Requires Node ≥ 20 and the Codex CLI (npm i -g @openai/codex, logged in).
claude mcp add --scope user codex -- npx -y codex-app-server-mcpThen start a new Claude Code session and say something like "Have Codex implement X in this repo, then review its diff."
Any other MCP client: use the command npx -y codex-app-server-mcp (stdio). If the client can't find codex on its PATH (common with nvm), add -e CODEX_BIN="$(which codex)".
From source: git clone https://github.com/Goudu666/codex-app-server-mcp.git && cd codex-app-server-mcp && npm install, then point your client at node server.mjs.
Configuration
Env var | Default | |
|
| Default sandbox for new threads: |
|
| Default approval policy: |
| from | Default model |
| from | Default reasoning effort |
|
| Path to the Codex CLI |
Permissions
By default Codex can write inside the working directory and asks before anything beyond that. Those requests come back to Claude as pending_requests, and Claude decides or asks you, then calls codex_respond.
Full autonomy, where Codex can touch anything your user can and never asks:
claude mcp add --scope user codex -e CODEX_SANDBOX=danger-full-access -e CODEX_APPROVAL=never -- npx -y codex-app-server-mcpor per task: codex_run({ ..., sandbox: "danger-full-access", approval: "never" }). The sandbox is fixed once a thread starts; the approval policy can change between turns. MCP servers inside Codex that request a form (elicitation) are auto-declined.
Parallel work
codex_run({ cwd, prompt: "A", worktree: true, wait_seconds: 0 }) → thread a
codex_run({ cwd, prompt: "B", worktree: true, wait_seconds: 0 }) → thread b
codex_wait({ thread_ids: [a, b] }) → both reportsworktree: true creates ~/.codex-mcp/worktrees/<repo>-<stamp> on a new branch codex/<stamp>. Worktrees are kept for you to inspect and merge. Remove them with git worktree remove <path>.
Notes
codex app-serveris marked experimental by OpenAI, so the protocol may change between Codex versions. Tested with codex-cli 0.163.0. To check a new version, regenerate the types withcodex app-server generate-ts --out <dir>.files_changedlists edits made through Codex's patch tool. Edits made via shell commands show up inrecent_commandsinstead. Review the actual diff.Each new thread starts the MCP servers from your Codex config, so the first turn may take a few seconds.
The default
wait_secondsof 240 has worked well in practice; raise it if your MCP client's tool-call timeout allows.
Development
npm test # offline: real MCP server against a fake app-server (test/fake-codex.mjs)
node test/e2e.mjs /tmp/scratch [repo] # real Codex: models, run, respond, structured output, review (uses quota)
node test/resume.mjs <thread_id> # continue an existing thread from a fresh process中文说明
让 Claude Code 通过 MCP 指挥 Codex:Claude 负责拆任务、验收,Codex 负责动手。多数同类项目每个任务都起一个 codex exec;这个项目常驻一个 codex app-server 进程,直接走它的 JSON 协议,所以能做到下面这些:
线程持久:追加指令发到同一个线程,上下文一直在。
异步、不超时:每次调用最多阻塞
wait_seconds秒,到时返回当前进度,之后用codex_wait接着等。双向沟通:Codex 要审批或者反问时,回合会暂停,请求交给 Claude 用
codex_respond回答,不会一直卡着。追加指令与中断:
codex_steer给正在跑的回合补充指令,codex_interrupt中途停下。原生代码审查:
codex_review,加上adversarial: true会挑战设计本身,不只是找 bug。并行:可以同时开多个线程,
codex_wait批量等待;worktree: true给每个任务一个独立的 git worktree,互不覆盖。能续接:Codex app / CLI 里开的线程,或者重启前的线程,都能接着用。
另外还有:实时状态、模型列表、结构化输出、联网搜索、压缩上下文。
权限默认值:workspace-write + on-request。Codex 只能写工作目录,超出范围要先问,问题会交给 Claude 回答。想完全放开就设 CODEX_SANDBOX=danger-full-access 和 CODEX_APPROVAL=never,具体见上面的 Permissions 一节。
安装只要一行:claude mcp add --scope user codex -- npx -y codex-app-server-mcp。工具列表和配置项见上文。codex app-server 目前是 experimental,Codex 升级后协议可能会变。
License
MIT
Available Tools
10 toolscodex_compactCompact a Codex threadB
Summarize a long Codex thread's history to free up its context window. Runs in the background.
Inputs: thread_id (required).
codex_interruptInterrupt a Codex turnC
Stop the running turn on a Codex thread.
Inputs: thread_id (required).
codex_modelsList Codex modelsB
Models available to this Codex login, with supported reasoning efforts.
Inputs: include_hidden.
codex_respondAnswer CodexB
Answer a request Codex is blocked on (listed in pending_requests). Approvals take decision: accept | acceptForSession | decline | cancel. Questions take answers: { : "answer" }. Ask the user first when the request is something they should decide.
Inputs: request_id (required), answers, decision, wait_seconds.
codex_reviewCodex code reviewB
Run Codex's native code review (read-only) in a git repo. The review text comes back in the "review" field. Pass focus and/or adversarial: true for a steerable review that challenges the design, not just bugs.
Inputs: cwd (required), focus, model, effort, +5 more.
codex_runRun a Codex taskA
Give Codex (OpenAI coding agent) a task. Starts a new thread, or continues an existing one when thread_id is given. Blocks up to wait_seconds, then returns status, Codex's latest message, files changed and commands run. status "inProgress" → codex_wait; "waitingForInput" → answer pending_requests with codex_respond. Run several threads in parallel by calling codex_run with wait_seconds: 0 for each, then codex_wait with all thread_ids. Review Codex's changes yourself before reporting them as done.
Inputs: prompt (required), cwd, model, effort, +7 more.
codex_statusPeek at CodexA
Non-blocking snapshot of Codex threads in this session: status, what Codex is doing right now, pending requests.
Inputs: thread_ids.
codex_steerSteer a running Codex turnC
Add instructions to the turn Codex is currently working on, without stopping it.
Inputs: prompt (required), thread_id (required), wait_seconds.
codex_threadsList Codex threadsA
List recent Codex threads (including ones from the Codex app/CLI), newest first. Continue one with codex_run + thread_id.
Inputs: cwd, limit.
codex_waitWait for CodexA
Wait for turns on one or more Codex threads, then return their reports. mode "all" (default) returns when every thread is done or blocked on a request; "any" returns as soon as one is.
Inputs: mode, thread_id, thread_ids, wait_seconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a clearly distinct action in the Codex thread lifecycle. codex_run, codex_wait, and codex_status have explicit boundaries described in their docs, and codex_respond vs codex_steer are differentiated as answering blocked requests versus adding live instructions. No overlapping purposes that would cause misselection.
All tools use a consistent codex_ prefix with lower snake_case and a predictable verb/noun pattern. Names are immediately readable and follow the same convention throughout.
10 tools is well-scoped for managing Codex agent sessions. Each tool covers a necessary operation—run, wait, status, interrupt, review, compact, models, threads, respond, steer—without redundancy.
The surface covers a full agent-session lifecycle: start/continue, monitor, wait, interrupt, respond, steer, review, compact, and list models/threads. Minor gaps exist, such as no explicit thread deletion/archival or full transcript retrieval, but core workflows are covered.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Your AI apps as one team: hand work to Codex or Claude Code on your Mac, with a shared logbook.
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Code to delegate tasks to OpenAI's Codex CLI (GPT-5.4) with structured execution traces, parallel execution, session persistence, and adversarial code review.15MIT
- AlicenseBqualityDmaintenanceMCP server that enables Claude Code to delegate code generation and debugging to OpenAI Codex, with stall detection and auto-recovery.2MIT
- FlicenseCqualityCmaintenanceEnables Codex to delegate already-scoped coding tasks to Claude Code and manage the resulting execution and fresh read-only review sessions, returning deterministic PASS/FAIL results through a local MCP interface.723-
- AlicenseAqualityAmaintenanceUse Codex as a subagent inside Claude Code: async dispatch into a long-lived codex app-server, results pushed back into the Claude session automatically, steer/interrupt mid-task, and Codex's built-in code review.61MIT