Wraps Codex CLI as MCP tools: query, review, search, assess, structured, sessions.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
If you're in a terminal agent (Claude Code, Codex CLI, Gemini CLI) with shell access, call Codex CLI directly. It's faster, cheaper, and zero overhead:
Use this MCP bridge instead when:
--json has known bugs)CODEX_MAX_CONCURRENT)sessionId /
resetSession, inspected via listSessions)Worktree note: Codex CLI issue #9084
breaks codex -C /path review .... Run codex review from inside the worktree to avoid it.
npm i -g @openai/codex)OPENAI_API_KEY environment variable set, or codex auth login completedAdd to ~/.gemini/settings.json:
Add to your MCP settings:
| Tool | Description |
|---|---|
| codex | Execute prompts with file context, session resume, and sandbox control. Multi-turn conversations via session IDs. Use for free-form review prompts; see Code review with this CLI. |
| review | Native diff-aware Codex review via codex exec review --json. No caller prompt; supports uncommitted, base branch, and commit review modes. |
| search | Web search via codex --search. Returns synthesized answers with source URLs. |
| query | Lightweight text analysis. No repo context, no sessions. Runs in an isolated temp directory. |
| structured | JSON Schema validated output via Ajv. Data extraction, classification, or any task needing machine-parseable output. |
| ping | Health check with CLI version, capabilities, and concurrency diagnostics (activeCount, queueDepth). |
| mcpStatus | 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. |
| listSessions | List active conversation sessions with metadata (turn count, model, timestamps). |
General-purpose execution. Supports multi-turn conversations via sessionId, sandbox levels (read-only, workspace-write, full-auto), and reasoning effort control. Pass resetSession: true to discard and start fresh. Use listSessions to inspect active sessions before resuming.
Key parameters: prompt (required), files, model, sessionId, sandbox, reasoningEffort, workingDirectory, timeout (default 60s).
Web search powered by OpenAI's native search infrastructure via Codex CLI's --search flag. Returns synthesized answers with source URLs.
Key parameters: query (required), model, workingDirectory, timeout (default 120s).
Lightweight, non-agentic text analysis. Spawns in an isolated temp directory so the bridge's repo context doesn't leak. Pass text to analyze in the context parameter. Supports reasoningEffort and maxResponseLength.
Key parameters: prompt (required), context, model, reasoningEffort, timeout (default 60s).
Thin wrapper around Codex CLI's native diff-aware review. The bridge passes the diff selector to codex exec review --json; upstream Codex owns the review prompt. Requires a real git repository via workingDirectory.
Key parameters: mode (required: uncommitted, base, or commit), workingDirectory (required), base (required for base mode), commit (required for commit mode), title, model, timeout (default 180s).
Embeds a JSON Schema in the prompt and validates the response with Ajv. Returns clean JSON on success, validation errors on failure.
Key parameters: prompt (required), schema (required, JSON string), files, model, workingDirectory, timeout (default 60s).
No parameters. Returns CLI version, auth status, model configuration, and concurrency diagnostics (activeCount, queueDepth).
Reports per-server MCP state as Codex's own app-server protocol sees it. Unlike every other tool, it deliberately does not suppress Codex's MCP servers or harden the subprocess environment, because both would disable the thing being measured. It therefore boots the servers in ~/.codex/config.toml and is slower than a normal call.
Key parameters: diagnostics (default false), workingDirectory, timeout (per-request, default 90s).
| Mode | Cost | What you get |
|---|---|---|
| default | ~6-9s | Inventory: auth type, tool names and counts, and initialized / unknown per server. Creates no thread and writes no session record. |
diagnostics: true | ~10-20s | Adds an explicit failed state and the error text naming the cause (expired OAuth grant, missing binary, remote refusal). Starts an ephemeral thread, which is never materialised on disk. |
Reading the output:
unknown is not a failure. It means the inventory carried no server info and no explicit verdict was available. Only diagnostics: true can report failed.degraded warning means don't trust unknown. Slow calls have been observed reporting healthy servers as uninitialized, so the tool reports how long the underlying call took and flags the result when it was slow enough to be suspect.builtIn marks a server Codex injects that is not in your config; configuredButUnreported marks one in your config that Codex never mentioned.Example:
All tools attach execution metadata (_meta) with durationMs, model, fallbackUsed, and session info where applicable. See DESIGN.md for details.
This bridge does not bundle reviewer prompts. There are three paths for code review:
codex reviewDiff-aware review built into Codex CLI. No bridge involvement. Use this when your client has shell access.
review tool for native diff-aware reviewThe bridge runs codex exec review --json from workingDirectory, captures the final review text, and returns review metadata such as threadId, event counts, and redacted command output. It does not accept a prompt.
codex tool with caller-supplied promptThe bridge runs codex exec --sandbox read-only with the supplied prompt and returns stdout. Use this for free-form review prompts or review inputs that are not expressible as uncommitted, base, or commit diff selectors.
A starting point; adapt freely:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/codex-mcp-bridge)<a href="https://allmcps.com/mcp/codex-mcp-bridge"><img src="https://allmcps.com/api/badge/codex-mcp-bridge?style=directory" alt="Codex MCP Bridge on AllMCPs" /></a>