codex-bridge-mcp
Allows Claude Code to drive OpenAI Codex CLI jobs: start execute, review, or freeform sessions; wait for questions or turn results; send answers or corrections; and resume Codex sessions.
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-bridge-mcpStart a Codex reviewer on xhigh and adversarially review plans/plan-v3.md."
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-bridge-mcp
A two-way MCP bridge that lets Claude Code drive the Codex CLI, and lets Codex talk back.
Claude writes a plan → Codex executes it, or adversarially reviews it against the real code.
While working, Codex can ask Claude questions (and block until answered) or send progress / findings.
Claude can answer, send corrections mid-run, or start follow-up turns in the same Codex session.
Keep several named Codex sessions per project, e.g. a
revieweron high effort and anexecutoron a cheaper setting.
Claude Code ──MCP "codex"──▶ server.mjs ──spawns──▶ codex exec --json
▲ │ │
│ ~/.codex-bridge/jobs/<id>/ │ MCP "claude_bridge"
└──── codex_wait ◀──────── mailbox ◀───────────────┘ (injected per job)Requirements
Node.js 18+
Codex CLI, logged in (
codex login). Tested with codex-cli 0.162.Claude Code
Related MCP server: claude-code-codex-agents
Install
claude mcp add codex -s user -- npx -y codex-bridge-mcpOr from source:
git clone https://github.com/WeiqiZhou2002/codex-bridge-mcp.git
cd codex-bridge-mcp && npm install
claude mcp add codex -s user -- node "$PWD/server.mjs"Then start a new Claude Code session. claude mcp list should show codex ✔ Connected.
Usage
Just ask Claude in plain language:
Start a Codex reviewer on xhigh and have it adversarially review
plans/plan-v3.md.
Start a Codex executor on high to implement the plan; it should ask me if anything is unclear.
Tell the reviewer that finding #2 is wrong because the cache is per-request, and ask it to re-check.
Tools Claude gets (server codex)
Tool | What it does |
| Start a job in the background. |
| Block until Codex asks a question, sends a message, or finishes/fails its turn. Returns a digest of the commands it ran and files it changed. |
| With |
| Stop a running job. |
| List jobs with status, name, session and cwd. |
Anywhere a job_id is expected you can pass the job's name instead; the newest job with that name wins.
A job's model, effort and sandbox are fixed at start and reused by every follow-up turn.
Tools Codex gets (server claude_bridge, injected via -c per job)
Tool | What it does |
| Blocks until Claude answers (default timeout 30 min; on timeout Codex proceeds and states its assumption). |
| Non-blocking note: |
| Pick up corrections Claude queued. Queued messages are also appended to any bridge tool result. |
Your normal ~/.codex/config.toml (default model, other MCP servers, etc.) still applies.
How it works
Each job gets a directory under ~/.codex-bridge/jobs/<id>/ (override with CODEX_BRIDGE_HOME):
events.jsonl: Codex → Claude. Questions, messages, a digest parsed fromcodex exec --json, turn results.answers/<qid>.json: Claude → Codex answers toask_claude.inbox.jsonl: Claude → Codex unsolicited messages.
Follow-up turns use codex exec resume <session_id>. Job metadata persists on disk, so a later Claude session can keep talking to the same Codex session. Turns that were running when the previous Claude session exited are marked resumable.
Caveats
executemode lets Codex write inside the working directory.danger-full-accessis only used if you ask for it explicitly.In Codex's
workspace-writesandbox, Codex usually cannot write to.git, so let Claude (or you) do the commits.Codex's
--jsonevent format is not a stable API. If a Codex upgrade changes it, the activity digest may get thinner, but final answers still come through.Two jobs in the same folder do not share context. Claude relays between them.
Development
npm testThe tests drive the server through a real MCP client against a fake codex binary (test/fake-codex.mjs), so they are fast and don't spend tokens. Set CODEX_BIN to point the bridge at a different Codex executable.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Persistent cross-session memory shared by Codex, Claude Code, ChatGPT, and other AI agents.
- ParleyOAuthdev.weldra
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Related MCP Servers
- AlicenseCqualityFmaintenanceConnects AI assistants like Claude to the Codex CLI for code analysis, editing, and execution. Supports file references with @ syntax, sandboxed code execution with approval workflows, and structured code changes for automated refactoring and documentation.893 npm177MIT
- 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
- AlicenseAqualityAmaintenanceBridges Claude Code and OpenAI Codex CLI for an interactive plan-execute-review workflow, enabling Claude to interview, design, and review while Codex implements code changes.742 npm3MIT
- AlicenseNot gradedqualityAmaintenanceLets Codex delegate coding and repository work to an installed Claude Code CLI with permission-aware inspect/write access, model and effort selection, resumable and cloud-attached sessions, and durable synchronous or asynchronous jobs.MIT