Skip to main content
Glama
Happenmass

Codex Claude Code MCP

by Happenmass

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 | bash

If you already cloned the repository:

./install.sh

The 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: pokeclaw

How it works

Codex parent
  ├─ continues its own work
  └─ Codex subagent
       └─ one blocking MCP call
            └─ Claude Agent SDK query stream
                 └─ final result / failure / cancellation

MCP 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:

  1. Tool input pathToClaudeCodeExecutable

  2. Environment variable CLAUDE_CODE_MCP_PATH

  3. Command named by CLAUDE_CODE_MCP_COMMAND

  4. claude, then claude-internal, from PATH

  5. The 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_run and claude_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 smoke

The 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:models

This 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 tools
claude_code_modelsList Claude Code ModelsA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory used to initialize Claude Code. Default: MCP server cwd.
timeoutMsNoModel discovery timeout. Default: 30000.
settingSourcesNoClaude settings sources. Default: user, project, local.
pathToClaudeCodeExecutableNoExplicit Claude Code executable. Uses the same environment and PATH resolution as run/resume.

Output Schema

ParametersJSON Schema
NameRequiredDescription
modelsYes
resultYes
statusYes
durationMsYes
executablePathNo
executableSourceNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, openWorldHint, and idempotentHint, which sets the safety baseline. The description adds useful context: the tool operates against the 'authenticated Claude Code CLI', returns specific data elements (identifiers, resolved models, descriptions, supported effort/mode), and explicitly states it does not run an inference turn. This goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, with the first sentence stating action and scope, and the second summarizing the return content. It is front-loaded with the verb and resource, and every word contributes value without fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity, rich annotations, and presence of an output schema, the description is largely complete: it explains what the tool does, its auth context, and what it returns. It slightly lacks explicit guidance on when to prefer this over run/resume, but that is a minor gap and the 'without running' phrase partially covers it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides descriptions for all four parameters, giving 100% coverage. The description does not add extra meaning about parameters such as cwd or timeoutMs, but since the schema already handles this, the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'List' and clearly identifies the resource: 'models available to the authenticated Claude Code CLI'. It also distinguishes itself from sibling tools by adding 'without running a model inference turn', making it unmistakably a discovery tool rather than an execution tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context: use this tool to list models without triggering inference. However, it does not explicitly mention sibling tools (claude_code_run, claude_code_resume) or state 'use X instead for running models', so it stops short of full exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_code_resumeResume Claude CodeA
Destructive

Resume a persisted Claude Code session and keep this single MCP call open until the turn completes. Do not poll.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute working directory for Claude Code.
modelNoClaude model override. Default: Claude Code settings.
effortNoClaude reasoning effort. Default: Claude Code.
promptYesTask for Claude Code. This call blocks until completion.
askToolsNoVisible tools that require MCP elicitation approval before use. Default: none.
maxTurnsNo
sessionIdYesClaude Code session ID returned by a prior call.
allowedToolsNoVisible, auto-approved Claude Code tools. Default: Read, Grep, Glob.
maxBudgetUsdNo
maxRuntimeMsNoServer-side runtime limit. Default: 2 hours; max: 8 hours.
systemPromptNo
settingSourcesNoClaude settings sources. Default: user, project, local.
disallowedToolsNoAlways-hidden and denied Claude Code tools. Deny wins over allow/ask.
progressIntervalMsNoMinimum interval between MCP progress notifications. Default: 20000.
permissionTimeoutMsNoTimeout for each MCP elicitation permission prompt. Default: 300000.
pathToClaudeCodeExecutableNoExplicit Claude Code executable. Default resolution: CLAUDE_CODE_MCP_PATH, CLAUDE_CODE_MCP_COMMAND, PATH claude/claude-internal, then SDK bundled binary.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes
statusYes
numTurnsYes
sessionIdNo
durationMsYes
stopReasonNo
errorSubtypeNo
totalCostUsdYes
durationApiMsNo
permissionDenialsNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotation already flags destructiveHint=true and readOnlyHint=false, and the description adds the critical behavioral trait that the call blocks until the turn completes. It also adds the 'Do not poll' directive, which is extra guidance not inferable from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short, front-loaded sentences with no filler. Every word contributes to the core understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with 16 parameters, the description covers the essential blocking/session-resume behavior and the no-poll rule. Since an output schema exists and annotations cover the safety profile, the description is adequately complete, though a bit terse given the parameter count.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 81%, so the schema already documents most parameters in detail. The description itself adds no parameter-level semantics, but the baseline of 3 is appropriate given the high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific action ('Resume') and resource ('persisted Claude Code session'), adding a key distinguishing behavior (keeping the MCP call open until completion). This clearly differentiates it from sibling tools like claude_code_run (new sessions) and claude_code_models (listing models).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear context for using this tool (resume persisted session) and explicitly instructs 'Do not poll,' which is useful operational guidance. However, it doesn't explicitly state when not to use it or name alternatives, so it stops short of full exclusion guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

claude_code_runRun Claude CodeA
Destructive

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdYesAbsolute working directory for Claude Code.
modelNoClaude model override. Default: Claude Code settings.
effortNoClaude reasoning effort. Default: Claude Code.
promptYesTask for Claude Code. This call blocks until completion.
askToolsNoVisible tools that require MCP elicitation approval before use. Default: none.
maxTurnsNo
allowedToolsNoVisible, auto-approved Claude Code tools. Default: Read, Grep, Glob.
maxBudgetUsdNo
maxRuntimeMsNoServer-side runtime limit. Default: 2 hours; max: 8 hours.
systemPromptNo
settingSourcesNoClaude settings sources. Default: user, project, local.
disallowedToolsNoAlways-hidden and denied Claude Code tools. Deny wins over allow/ask.
progressIntervalMsNoMinimum interval between MCP progress notifications. Default: 20000.
permissionTimeoutMsNoTimeout for each MCP elicitation permission prompt. Default: 300000.
pathToClaudeCodeExecutableNoExplicit Claude Code executable. Default resolution: CLAUDE_CODE_MCP_PATH, CLAUDE_CODE_MCP_COMMAND, PATH claude/claude-internal, then SDK bundled binary.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes
statusYes
numTurnsYes
sessionIdNo
durationMsYes
stopReasonNo
errorSubtypeNo
totalCostUsdYes
durationApiMsNo
permissionDenialsNo

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds significant behavioral context beyond annotations: the call blocks until completion and should not be polled. Annotations already indicate destructive/open-world behavior, but the description enriches the operational understanding with the blocking and delegation guidance. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: the first states the core purpose, the second gives a direct operational instruction, and the third provides a delegation note. Every sentence earns its place, with no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (15 parameters, long-running, destructive), the description captures the critical orchestration behavior (blocking, no polling, delegation) and benefits from a rich output schema. It doesn't mention preconditions or resume alternatives, but overall it provides sufficient context for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 80%, so parameters are largely self-documenting. The description does not add parameter-level meaning; it focuses on behavior. With high schema coverage, a score of 3 is appropriate—no additional value provided beyond what the schema already does.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states 'Run a new Claude Code session and keep this single MCP call open until it completes.' This clearly identifies the action, resource, and blocking behavior, and distinguishes from the sibling 'claude_code_resume' by emphasizing a new session.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear operational guidance: 'Do not poll' and explicit delegation advice for long tasks. While it doesn't explicitly mention using 'claude_code_resume' for existing sessions, the phrase 'new session' implies the distinction. Overall, it gives useful context for when and how to use the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.2.0
    • First observedclaude_code_models
    • First observedclaude_code_resume
    • First observedclaude_code_run

TDQS

A4.4/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Wraps Claude Code as tools for MCP clients, enabling autonomous coding tasks via a 4-tool lifecycle with session management, async polling, and permission controls.
    4
    57
    20
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables MCP clients to spawn and control Codex CLI and Claude Code sessions on the host machine, with session management and filesystem access.
    4
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Happenmass/codex-claude-code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server