claude-codex-mcp-bridge
A local MCP bridge that connects Claude Code and OpenAI Codex via a durable SQLite mailbox, with support for orchestrating and resuming Codex sessions.
README
<p align="center"> <a href="https://www.webisitystudio.co.uk/"> <img src="assets/webisity-studio-logo.svg" width="180" alt="WebiSity Studio logo"> </a> </p>
<h1 align="center">Claude Codex MCP Bridge</h1>
<p align="center">Built by <a href="https://www.webisitystudio.co.uk/">WebiSity Studio</a></p>
<p align="center"> <img src="assets/bridge-demo.gif" alt="Claude Codex MCP Bridge send, wait, wake and acknowledge demo" width="900"> </p>
A local MCP bridge for Claude Code and OpenAI Codex. It combines a durable SQLite mailbox with a bounded orchestration loop that can start and resume saved Codex workers.
Claude Code ──stdio MCP──┐
├── local SQLite WAL store
Codex ──stdio MCP──┘
The default mode has no account, cloud relay, HTTP server or listening network port.
Why
Plain MCP tools are request-response. Writing a message to a mailbox does not automatically start a new model turn in another GUI chat.
This project supports two practical patterns:
- Two visible chats: both agents use
bridge_waitbefore going idle. A pending MCP call returns when the matching message arrives. - Claude coordinates Codex: Claude calls
bridge_orchestrate_codex; the bridge starts a saved Codex CLI session, waits for structured output and can resume that exact session after a Fable decision.
See INSTRUCTIONS.md for copy-paste prompts.
Features
- Local SQLite WAL mailbox
- Direct messages and broadcasts
- Stable thread IDs
- Recipient-scoped acknowledgements
- Idempotency keys
- Blocking waits with sender/thread filters
- Durable Codex run state and audit events
- Saved Codex session continuation
- Optional isolated Git worktrees
- Structured worker output
- Round and timeout limits
- Explicit safety boundaries
Tools
| Tool | Purpose |
|---|---|
bridge_register |
Register an agent name and capabilities |
bridge_send |
Send a direct or broadcast message |
bridge_inbox |
Read unread messages immediately |
bridge_wait |
Keep the current turn open until a matching message arrives |
bridge_ack |
Acknowledge handled messages without deleting history |
bridge_thread |
Read a complete thread |
bridge_agents |
List registered agents |
ask_codex |
Handle a normal implementation, investigation or verification request without mailbox setup |
review_with_codex |
Run an evidence-led, read-only Codex repository review |
bridge_orchestrate_codex |
Start a saved Codex worker, optionally in a worktree |
bridge_continue_codex |
Resume the same Codex session with Claude's answer |
bridge_orchestration_status |
Read durable run state and audit events |
Requirements
- Node.js 22.5 or newer
- Claude Code
- OpenAI Codex CLI
- Git, if using worktree isolation
The mailbox works anywhere Node and both MCP clients run. The automated Codex launcher uses CODEX_BIN when set, then the bundled Codex binary inside the macOS ChatGPT app when available, then codex from PATH.
Core tests run on macOS, Linux and Windows in GitHub Actions. The live Claude Desktop/Fable plus Codex Desktop workflow was developed and verified on macOS.
Install
One command
Run directly from the public GitHub repository:
npx --yes --package=github:WebisityStudio/claude-codex-mcp-bridge claude-codex-mcp-bridge setup
The setup command:
- builds the package automatically;
- detects and registers Claude Code and Codex;
- resolves the server's absolute path internally;
- installs the
ask-codex,review-with-codexand coordinator skills; - installs a Claude
codex-teammateagent definition; - points both clients at the same local database.
Open fresh Claude and Codex sessions after setup, then verify the bridge:
npx --yes --package=github:WebisityStudio/claude-codex-mcp-bridge claude-codex-mcp-bridge doctor
npx --yes --package=github:WebisityStudio/claude-codex-mcp-bridge claude-codex-mcp-bridge demo
Other commands:
claude-codex-mcp-bridge status
claude-codex-mcp-bridge setup --force
claude-codex-mcp-bridge uninstall
claude-codex-mcp-bridge uninstall --purge
uninstall keeps the SQLite history unless --purge is explicitly supplied.
Manual fallback
git clone https://github.com/WebisityStudio/claude-codex-mcp-bridge.git
cd claude-codex-mcp-bridge
npm ci
npm run check
node dist/cli.js setup
If Codex is not available as codex on PATH, set CODEX_BIN in the MCP server environment to the full executable path.
Everyday use
After opening a fresh Claude session:
/ask-codex investigate why the authentication tests are flaky
/review-with-codex focus on authentication and tenant isolation
Or simply ask Claude:
Ask Codex to implement this change and verify it.
Have Codex review this repository for security regressions.
The installed skills route these requests through ask_codex and review_with_codex. Users do not need to choose agent names, create mailbox threads or manage acknowledgements for ordinary one-shot work.
Quick start: two visible chats
Pick one canonical thread ID, for example invoice-review-001. Register unique names, send with bridge_send, and wait with:
{
"agent": "claude-main",
"fromAgent": "codex-main",
"threadId": "invoice-review-001",
"timeoutSeconds": 285,
"acknowledge": true
}
Most MCP hosts cut tool calls near five minutes. The bridge caps waits at 290 seconds and defaults to 285. Agents should renew a timed-out wait while the task remains active.
A filtered wait only wakes for the exact sender and thread. Agree the thread ID before either side starts waiting.
Quick start: autonomous Codex worker
Claude calls:
{
"coordinatorAgent": "claude-main",
"projectPath": "/absolute/path/to/repository",
"task": "Implement and test the bounded change",
"threadId": "feature-x",
"useWorktree": true,
"maxRounds": 6
}
If the result is waiting_for_fable, Claude answers the returned question and calls bridge_continue_codex using the same run ID. The bridge resumes the exact Codex session and worktree.
The bridge does not commit, push, merge, deploy or clean worktrees automatically.
Storage
The default database is:
~/.local/share/claude-codex-bridge/bridge.sqlite
Override it in both MCP configurations with:
BRIDGE_DB_PATH=/absolute/path/to/bridge.sqlite
All MCP processes must point to the same database.
Honest limitations
- MCP cannot cold-wake a GUI chat after its model turn has ended.
bridge_waitworks by keeping the current call alive. - Agent registration does not prove active processing.
- A mismatched thread filter can leave valid messages unread.
- Codex session persistence does not guarantee immediate appearance in every desktop app version's thread list.
- The default transport is local to one machine. It is not a cross-machine broker.
Safety
- No credentials are stored by this project.
- Child processes receive a small allowlist of environment variables, not the full parent environment.
- Messages are local but are stored unencrypted in SQLite.
- Do not send secrets through the mailbox unless every connected client is trusted.
- Worker prompts prohibit commits, pushes, deployments, external sends, credential changes, deletion and production mutations unless separately approved.
Development
npm test
npm run build
npm run check
npm audit --omit=dev --audit-level=high
The test suite covers mailbox routing, acknowledgements, idempotency, independent MCP processes, blocking waits, durable orchestration state, session continuation, loop limits and platform-safe process environments.
Related work
This is not the only Claude/Codex bridge. See docs/ALTERNATIVES.md for a comparison with Claude Channels bridges, ACP delegation tools and general agent mailboxes.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。