codex-mcp-bridge
Click on "Install 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-mcp-bridgeSend to my active Codex thread: fix the failing tests in auth.test.ts"
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-mcp-bridge
MCP server for Claude Desktop to send prompts directly into an existing Codex thread, through a shared Codex app-server. Runs on macOS, Windows, and Linux.
Not codex exec (which creates a new session every time). The bridge speaks JSON-RPC with the real Codex app-server, so the thread keeps its history, cwd, model, and rollout file.
Architecture
Claude Desktop ──stdio──> codex-mcp-bridge ──WebSocket──> codex app-server (ws://127.0.0.1:8791)
│
Codex TUI ──codex --remote ws://127.0.0.1:8791───────────────────┘ (cùng app-server, cùng thread live)The app-server is a singleton per port. The bridge probes
http://127.0.0.1:8791/readyz; if it is not alive, it spawns a detached one (codex app-server --listen ws://127.0.0.1:8791), and that app-server keeps running independently after the bridge exits.Every client pointing to the same URL uses the same app-server →
thread/resumewiththreadIdrejoins the actual running thread instead of starting a new session.The bridge keeps exactly one WebSocket, initializes once, and routes notifications by
threadId, so multiple threads running in parallel never interfere with each other.
Related MCP server: webgpt MCP
Tools
Tool | Description |
| Sends a prompt as a user turn into |
| Lists threads (id, title, cwd, last updated, status) — use it to get the right |
| Opens a new Codex thread in a |
| Reads the thread's recent conversation without sending anything. |
| Stops a running turn. |
| macOS: brings the thread up in the Codex desktop app via |
| Reports the environment: platform, resolved |
send_to_codex_thread accepts additional timeoutSec (default 240), cwd, model, effort, and openInApp (macOS — opens the thread in the app before sending so you can watch live). Timing out does not cancel the turn — the bridge returns whatever it has gathered along with turnId; continue reading with read_codex_thread or stop with interrupt_codex_turn.
Install into Claude Desktop
npm install
node scripts/install-claude-desktop.mjsThe script detects the platform, creates the config file if it doesn't exist, backs up the old one (*.bak-<ngày>-codexbridge), and preserves all existing keys:
OS | Config path |
macOS |
|
Windows |
|
Linux |
|
Result on macOS:
{
"mcpServers": {
"codex-bridge": {
"command": "/Users/<user>/.local/node/v24.18.0/bin/node",
"args": ["/Users/<user>/code/codex-mcp-bridge/src/index.mjs"],
"env": {
"CODEX_BIN": "/Users/<user>/.local/bin/codex",
"CODEX_APP_SERVER_URL": "ws://127.0.0.1:8791"
}
}
}
}Restart Claude Desktop after installing.
Resolve the codex binary: Claude Desktop (and launchd) launch the MCP server with a trimmed PATH, so codex is often not on PATH. The bridge searches in this order — CODEX_BIN → the platform's usual install locations → PATH:
OS | Search order |
macOS / Linux |
|
Windows |
|
On macOS/Linux, codex is a Node script with shebang #!/usr/bin/env node, so the bridge also injects PATH (current node directory + /opt/homebrew/bin + /usr/local/bin + system dirs) into child processes — without this step, spawning the app-server dies immediately at the shebang.
macOS
Run the app-server in the background with launchd
node scripts/install-launch-agent.mjsCreate ~/Library/LaunchAgents/com.codex-mcp-bridge.app-server.plist (RunAtLoad + KeepAlive on crash, ThrottleInterval 10s) then launchctl bootstrap gui/$UID. The app-server is already alive from login, so the bridge doesn't have to spawn it, and threads are always in the live state.
launchctl print gui/$UID/com.codex-mcp-bridge.app-server | head -20 # trạng thái
node scripts/install-launch-agent.mjs --uninstall # gỡLog: ~/Library/Logs/codex-mcp-bridge/app-server.{out,err}.log.
View threads directly in the Codex desktop app
The Codex desktop app on macOS is /Applications/ChatGPT.app and registers the codex:// scheme. The bridge uses codex://threads/<threadId> to open the correct thread:
open_codex_thread { threadId: "01a0…", background: true }
send_to_codex_thread { threadId: "01a0…", prompt: "…", openInApp: true }This is how the person assigning the task can watch Codex doing the work instead of having to read back the rollout ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl after it finishes.
Limitations on macOS
The Codex desktop app runs its own app-server via stdio (
ChatGPT.app/Contents/Resources/codex … app-server) and does not accept an external endpoint. Threads opened in the app can still be sent to via the bridge, but by resuming from the.jsonlrollout rather than attaching live. Do not send to a thread currently running a turn in the desktop app — two app-servers writing to the same rollout can corrupt the history. Checkstatuswithlist_codex_threadsfirst, and only send whenidle/notLoaded.A repo on an NTFS partition of a dual-boot machine (
/Volumes/...) is read-only on macOS — macOS mounts NTFS read-only. Keep a separate checkout on an APFS volume (e.g.~/code/codex-mcp-bridge) to run and edit.codex app-server daemon startusesunix://transport with control socket~/.codex/app-server-control/app-server-control.sock. The bridge does not use this path (a framing protocol different from WebSocket, and no public API yet) — it always talks overws://.
Environment
Variable | Default | Meaning |
|
| The shared app-server endpoint. |
| auto-detected | Path to |
|
|
|
|
| How to answer approval requests from Codex. Set |
| auto-detected per OS | Force the config path when running |
| auto-detected | Force the |
About approval: Codex will ask to approve commands/patches if approval_policy is not never. No one is sitting in front of Claude Desktop to click, so the bridge automatically answers according to CODEX_BRIDGE_APPROVAL and logs to stderr. The default approve matches the configuration approval_policy = "never" + sandbox_mode = "danger-full-access" in ~/.codex/config.toml; if you tighten the sandbox, consider switching to deny.
Sharing the app-server with an interactive Codex session
Open the TUI pointing at the same endpoint so threads in the TUI and the bridge see them as one:
codex --remote ws://127.0.0.1:8791Run the app-server manually (independent of bridge autostart):
codex app-server --listen ws://127.0.0.1:8791Testing
npm run checkQuick check: the bridge starts, autostarts the app-server if needed, lists threads.
npm run smokeSmoke test creates a new thread, sends 2 consecutive turns, and verifies Codex remembers the codeword from the previous turn — i.e., the thread is truly continuous rather than a new session each time.
Check the environment from inside Claude: call the codex_bridge_status tool.
This server cannot be installed
Maintenance
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for managing Claude Code conversation sessions12503MIT
- Flicense-qualityCmaintenanceLocal MCP server for Codex to send prompts to ChatGPT Web Pro extension and manage repository tasks safely.
- Alicense-qualityBmaintenanceAn MCP server that bridges Claude Desktop with Claude Code, allowing users to delegate tasks to Claude Code directly from Claude Desktop conversations, supporting both synchronous and background execution with session reuse.13MIT
- AlicenseAqualityCmaintenanceMCP server that lets Claude Code drive the local Codex CLI as a sub-agent for concurrent queries and optional file/shell actions, using the CLI's existing login and sessions.4911MIT
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Hosted Amazon Seller and Vendor MCP server for Claude, ChatGPT, Cursor, Codex, Gemini, Copilot.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/buidangminh23/codex-mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server