Codex Claude Code MCP
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 Claude Code MCP ask Claude Code to review this pull request for potential issues"
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 Claude Code MCP
A small MCP server for delegating long-running work from Codex to Claude Code without application-level polling.
It intentionally exposes only:
claude_code_models: list models available to the authenticated Claude Code CLI without running a model inference turn.claude_code_run: start a persisted Claude Code session and block until the turn ends.claude_code_resume: resume a returned session ID and block until the turn ends.
There is no poll, check, or get_status tool. Model discovery is a short read-only initialization request, not a background task. For background behavior, a Codex parent delegates the blocking run/resume call to a native Codex subagent and waits on Codex's own agent mailbox. See the Codex subagent workflow.
The repository also ships two global Codex skills:
claude-code-blocking-direct: the current agent makes one blocking MCP call and waits.claude-code-blocking-background: the parent spawns a native Codex subagent to own the blocking call, continues useful work, and later receives the result through Codex's native agent mailbox.
One-command install
Install the MCP server, validate its build, update ~/.codex/config.toml, and install both skills globally:
curl -fsSL https://raw.githubusercontent.com/Happenmass/codex-claude-code-mcp/main/install.sh | bashIf you already cloned the repository:
./install.shThe installer requires Node.js 20+, npm, Git, and an authenticated Claude Code CLI. It installs remote bootstrap checkouts under ~/.codex/tools/codex-claude-code-mcp by default and skills under ${CODEX_HOME:-$HOME/.codex}/skills. It creates config.toml.bak before replacing an existing claude-code-blocking MCP entry.
Restart Codex after installation so it discovers the new MCP server and skills.
Example prompts:
Use $claude-code-blocking-direct to ask Claude Code to review this change and wait for the result.Use $claude-code-blocking-background to have Claude Code review the test strategy while you continue implementing.Related MCP server: subcodex-mcp
How it works
Codex parent
├─ continues its own work
└─ Codex subagent
└─ one blocking MCP call
└─ Claude Agent SDK query stream
└─ final result / failure / cancellationMCP progress notifications are throttled (20 seconds by default). They describe activity but are not required for completion and do not require a model turn to poll.
Requirements
Node.js 20 or newer
A working Claude Code installation/authentication
Codex with MCP stdio support
Claude executable resolution
The bridge prefers the user's current system Claude Code installation so model routing and authentication match interactive Claude Code. Resolution order:
Tool input
pathToClaudeCodeExecutableEnvironment variable
CLAUDE_CODE_MCP_PATHCommand named by
CLAUDE_CODE_MCP_COMMANDclaude, thenclaude-internal, fromPATHThe Claude Agent SDK bundled binary
CLAUDE_CODE_MCP_PATH and CLAUDE_CODE_MCP_COMMAND are mutually exclusive.
For a deterministic Codex installation, set:
[mcp_servers.claude-code-blocking.env]
CLAUDE_CODE_MCP_PATH = "/opt/homebrew/bin/claude"Model discovery
Call claude_code_models before run/resume when the user asks what models are available or when a model identifier needs validation. It returns a stable normalized catalog containing:
the model value accepted by
claude_code_runandclaude_code_resume;the resolved model when Claude Code reports one;
display name and description;
supported effort levels and adaptive-thinking, fast-mode, or auto-mode capabilities.
The tool starts Claude Code only long enough to read its authenticated initialization catalog, then closes the query. It does not submit a prompt to a model, create a persisted session, or incur an inference turn.
Manual build
npm install
npm run typecheck
npm test
npm run build
npm run smokeThe smoke test launches the built server through an MCP stdio client and verifies that exactly the model-discovery, run, and resume tools are advertised. It does not spend Claude API credits.
To verify authenticated model discovery through the real MCP stdio path:
npm run smoke:claude:modelsThis initializes and closes Claude Code without submitting a model prompt. It requires Claude Code authentication but does not create an inference turn. Keep it out of default CI environments that lack a Claude login.
Manual Codex configuration
Build the project, then add an MCP server entry to ~/.codex/config.toml:
[mcp_servers.claude-code-blocking]
command = "node"
args = ["/Users/guhappen/code/codex-claude-code-mcp/dist/index.js"]
tool_timeout_sec = 7200
enabled_tools = ["claude_code_models", "claude_code_run", "claude_code_resume"]
[mcp_servers.claude-code-blocking.env]
CLAUDE_CODE_MCP_PATH = "/absolute/path/to/claude"Restart Codex after changing its MCP configuration. The long client-side tool timeout is intentional: the MCP request itself is the wait primitive.
To install the bundled skills manually:
cp -R skills/claude-code-blocking-direct "${CODEX_HOME:-$HOME/.codex}/skills/"
cp -R skills/claude-code-blocking-background "${CODEX_HOME:-$HOME/.codex}/skills/"Tool policy
The default auto-approved tools are only Read, Grep, and Glob.
allowedTools: visible and automatically approved.askTools: visible, but each use requires MCP elicitation approval.disallowedTools: always denied and hidden; deny wins over the other lists.
Any tool outside those explicit lists is denied. For an implementation task you might use:
{
"allowedTools": ["Read", "Grep", "Glob", "Edit", "Write"],
"askTools": ["Bash"],
"disallowedTools": ["WebFetch", "WebSearch"]
}If the MCP client does not support elicitation, every askTools request is denied rather than silently approved.
Result and resume
Each call returns compact structured data including status, result, duration, turn count, cost, and the Claude sessionId. Pass that ID to claude_code_resume to continue the same context.
MCP request cancellation is forwarded to Claude Code. A server-side runtime limit defaults to two hours and may be set up to eight hours.
Phase 1 boundary
This design avoids repeated status requests while the Codex task remains active. MCP alone cannot complete a call after its client has disconnected or independently reopen a finished Codex task. Durable cross-turn wake-up requires a Codex-owned thread/automation callback and is outside phase 1.
Available Tools
3 toolsclaude_code_modelsList Claude Code ModelsARead-onlyIdempotent
List models available to the authenticated Claude Code CLI without running a model inference turn. Returns model identifiers, resolved models, descriptions, and supported effort or mode capabilities.
Inputs: cwd, timeoutMs, settingSources, pathToClaudeCodeExecutable. Returns: models, result, status, durationMs, +2 more
claude_code_resumeResume Claude CodeADestructive
Resume a persisted Claude Code session and keep this single MCP call open until the turn completes. Do not poll.
Inputs: cwd (required), prompt (required), sessionId (required), model, +12 more. Returns: result, status, numTurns, sessionId, +6 more
claude_code_runRun Claude CodeADestructive
Run a new Claude Code session and keep this single MCP call open until it completes. Do not poll. For long tasks, a Codex parent should delegate this tool call to a Codex subagent and wait with Codex-native agent waiting.
Inputs: cwd (required), prompt (required), model, effort, +11 more. Returns: result, status, numTurns, sessionId, +6 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: listing models, starting a new session, and resuming an existing session. There is no overlap in their functions, making it easy for an agent to select the correct one.
All tool names follow a consistent pattern with the prefix 'claude_code_' followed by a verb or noun that clearly indicates the action. This uniformity makes the tool set predictable and intuitive.
With only three tools, the server is tightly scoped to its purpose of managing Claude Code sessions. Each tool provides a distinct, necessary function, and the small count is appropriate for the narrow domain.
The core workflow of listing models, running a new session, and resuming a session is well covered. A minor gap is the lack of a session management tool for listing or stopping active sessions, but these may not be necessary given the synchronous nature of the run and resume tools.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
MCP hosting for AI agents: Claude or Codex writes the code, runs it and sends a live link.
Related MCP Servers
- AlicenseAqualityDmaintenanceWraps Claude Code as tools for MCP clients, enabling autonomous coding tasks via a 4-tool lifecycle with session management, async polling, and permission controls.479 npm21MIT
- 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-
- AlicenseNot gradedqualityBmaintenanceEnables delegating bounded tasks from Codex to Claude Code, including read-only reviews, isolated branch edits, long-running background work, and approval handling.MIT