
Codex Mcp Bridge
Wraps the Codex CLI as MCP tools so you can query code, run reviews, and get structured output from clients that don't have shell access. Exposes six tools: `codex` for free-form prompts with session resume and sandbox control, `review` for native diff-aware reviews against uncommitted changes or base branches, `search` for web lookups, `query` for isolated text analysis, `structured` for JSON Schema validated output, and `ping` for health checks. If you're already in a terminal agent with shell access, call Codex CLI directly. This bridge is for Cursor, Windsurf, Claude Desktop, or VS Code where you need subprocess isolation, partial response capture on timeout, automatic model fallback on quota errors, or multi-turn conversations via session IDs. Includes a FIFO queue that caps parallel spawns at three and redacts secrets from output.
- GitHub stars
- 3
- tools
- 8
- transport
- STDIO
- env vars
- 5
- last updated
- Aug 2, 2026
Tools
8 toolsPublic tool metadata for what this MCP can expose to an agent.
codexExecute prompts with file context, session resume, and sandbox control. Multi-turn conversations via session IDs.
Execute prompts with file context, session resume, and sandbox control. Multi-turn conversations via session IDs.
No parameter schema in public metadata yet.
reviewNative diff-aware Codex review via `codex exec review --json`. No caller prompt; supports uncommitted, base branch, and commit review modes.
Native diff-aware Codex review via `codex exec review --json`. No caller prompt; supports uncommitted, base branch, and commit review modes.
No parameter schema in public metadata yet.
searchWeb search via `codex --search`. Returns synthesized answers with source URLs.
Web search via `codex --search`. Returns synthesized answers with source URLs.
No parameter schema in public metadata yet.
queryLightweight text analysis. No repo context, no sessions. Runs in an isolated temp directory.
Lightweight text analysis. No repo context, no sessions. Runs in an isolated temp directory.
No parameter schema in public metadata yet.
structuredJSON Schema validated output via Ajv. Data extraction, classification, or any task needing machine-parseable output.
JSON Schema validated output via Ajv. Data extraction, classification, or any task needing machine-parseable output.
No parameter schema in public metadata yet.
pingHealth check with CLI version, capabilities, and concurrency diagnostics (activeCount, queueDepth).
Health check with CLI version, capabilities, and concurrency diagnostics (activeCount, queueDepth).
No parameter schema in public metadata yet.
mcpStatusReport what Codex says about each MCP server it knows about: auth type, tool inventory, and whether it initialized. Optional diagnostic mode adds explicit failure states and error text.
Report what Codex says about each MCP server it knows about: auth type, tool inventory, and whether it initialized. Optional diagnostic mode adds explicit failure states and error text.
No parameter schema in public metadata yet.
listSessionsList active conversation sessions with metadata (turn count, model, timestamps).
List active conversation sessions with metadata (turn count, model, timestamps).
No parameter schema in public metadata yet.
Sponsors
Configuration
CODEX_CLI_PATHdefault: codexPath to the codex CLI binary. Defaults to 'codex' on PATH.
CODEX_DEFAULT_MODELDefault Codex model for codex/query/search.
CODEX_FALLBACK_MODELModel to use when the primary model hits a quota error.
CODEX_MAX_CONCURRENTdefault: 3Maximum concurrent Codex CLI subprocesses (default 3).
CODEX_MCP_SERVERSControls which MCP servers from ~/.codex/config.toml stay enabled inside the Codex subprocess. Empty/unset disables all non-required servers; 'inherit' passes config through; comma-separated names (e.g. 'serena,github') enables those; values starting with '{' or '[' are raw TOML.
Readme
codex-mcp-bridge
MCP server that wraps Codex CLI as a subprocess, exposing code execution, web search, and structured output as Model Context Protocol tools.
Works with any MCP client: Claude Code, Gemini CLI, Cursor, Windsurf, VS Code, or any tool that speaks MCP.
Do you need this?
Details
- Repository
- github.com/hampsterx/codex-mcp-bridge
- Category
- Search & Web Crawling
- Package
codex-mcp-bridge- Transport
- STDIO
- Registry
- MCP registry, active