hampsterx avatar

Codex Mcp Bridge

hampsterx/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 tools

Public 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: codex

Path to the codex CLI binary. Defaults to 'codex' on PATH.

CODEX_DEFAULT_MODEL

Default Codex model for codex/query/search.

CODEX_FALLBACK_MODEL

Model to use when the primary model hits a quota error.

CODEX_MAX_CONCURRENTdefault: 3

Maximum concurrent Codex CLI subprocesses (default 3).

CODEX_MCP_SERVERS

Controls 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

npm version npm downloads CI License: MIT Node.js TypeScript MCP

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?


View the full README on GitHub

Details

Repository
github.com/hampsterx/codex-mcp-bridge
Category
Search & Web Crawling
Package
codex-mcp-bridge
Transport
STDIO
Registry
MCP registry, active

More from hampsterx

Related Search & Web Crawling MCP servers

View all
1iggredible avatarVim Mcpiggredible/vim-mcpConnect Claude Code to Vim/Neovim - query state, execute commands, search help, record macros3stars
2happygallo avatarApple Adshappygallo/apple-ads-mcpManage Apple Search Ads campaigns, keywords, budgets, and reports via API v5.3stars
3lipdog avatarFossicklipdog/fossick-mcpSearch all of GitHub from your AI agent — find libraries, drill into repos, find code patterns.3stars
4markswendsen-code avatarDeltamarkswendsen-code/mcp-deltaMCP server for Delta Airlines - search flights, check status, manage trips3stars
5ozanmutlu avatarGitlab Docsozanmutlu/gitlab-docs-mcpSearch and browse 2,900+ official GitLab documentation pages via MCP3stars
6trackly-app avatarTrackly CLItrackly-app/trackly-cliSearch Thousands of jobs, Thousands of companies. MCP for Claude, ChatGPT, Codex and Cursor.3stars