codex-mcp-bridge
codex-mcp-bridge
在 ChatGPT 与官方本地 Codex MCP 服务器之间提供一个小型策略层。
ChatGPT
-> OpenAI Secure MCP Tunnel
-> codex-mcp-bridge (loopback HTTP)
-> codex mcp-server (stdio)
-> one explicitly allowed repository官方 Codex MCP 服务器已经提供 codex 和 codex-reply。该桥接层刻意只增加 ChatGPT 日常更安全使用所需的控制项:
bridge_status:检查当前生效的策略。codex_read:强制使用只读 Codex 会话。codex_run:启动受策略限制的读取或写入会话。codex_reply:仅继续通过此桥接层创建的线程。codex_job_status:获取长时间运行任务的结果。
安全默认值
绑定到
127.0.0.1。除非显式配置根目录,否则只允许一个当前工作目录。
使用
read-onlyCodex 沙盒。使用
on-request审批策略。决不暴露
danger-full-access。除非桥接层所有者启动写入配置,否则阻止工作区写入。
拒绝配置的真实路径根目录之外的路径。
拒绝包含常见机密文件名的仓库,除非所有者显式禁用预检查。
限制提示长度和并发 Codex 任务数。
抑制上游 Codex stderr,除非启用本地调试日志。
这些控制是策略层,不是 OS 级隔离。若需要强隔离,请使用暂存副本、容器、虚拟机或独立的 OS 用户。
Related MCP server: mcp-governance-proxy
先决条件
Node.js 20 或更高版本;推荐 Node.js 22。
已安装并完成认证的 Codex CLI,且提供
codex mcp-server。ChatGPT 访问需要
tunnel-client和 OpenAI Secure MCP Tunnel。
官方参考:
安装
npm ci
npm run check本地冒烟测试
本地模式不会创建公共端点:
npm run bridge:local -- --root /absolute/path/to/repositoryMCP 端点是 http://127.0.0.1:8876/mcp,健康检查端点是 http://127.0.0.1:8876/healthz。
Secure MCP Tunnel
在 OpenAI Platform 中创建隧道,然后在本仓库之外提供其运行时凭据:
export CONTROL_PLANE_API_KEY="<runtime-key>"
export CONTROL_PLANE_TUNNEL_ID="tunnel_..."
npm run bridge:secure -- --root /absolute/path/to/repository启动器会构建桥接层,在环回地址上启动它,初始化 tunnel 配置文件,运行 tunnel-client doctor,并保持 tunnel 客户端运行。
对于有意的写入会话:
npm run bridge:secure -- --root /absolute/path/to/repository --write不需要写入配置时,不要让它一直运行。
macOS Keychain
security add-generic-password -a "$USER" -s "codex-mcp-bridge:control-plane-api-key" -w "<runtime-key>" -U
security add-generic-password -a "$USER" -s "codex-mcp-bridge:control-plane-tunnel-id" -w "tunnel_..." -U
CODEX_MCP_BRIDGE_ROOT=/absolute/path/to/repository npm run bridge:secure:keychain仅在有意进行写入会话时使用 bridge:secure:write:keychain。
配置
变量 | 默认值 | 用途 |
| 当前目录 | 允许的绝对根目录,以逗号分隔 |
|
|
|
| 未设置 | 必须先设为 |
|
|
|
|
| 最大活跃 Codex 调用数 |
|
| 每次工具调用的最大提示长度 |
|
| Codex MCP 调用超时时间 |
|
| 返回任务 ID 前的等待时间 |
|
| 已完成任务的保留时长 |
| 未设置 | 显式绕过机密文件名预检查 |
| 未设置 | 输出本地诊断错误和 Codex stderr |
为兼容上游,暂时接受旧的 CODEX_GPT_BRIDGE_* 变量前缀。
ChatGPT 配置
上游
本仓库在 MIT License 下衍生自 DeepCogNeural/codex-gpt-bridge。本 fork 的范围参见 UPSTREAM.md。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityCmaintenanceA secure MCP server that exposes local repository context to ChatGPT/Codex with read-only access, path validation, and no generic shell.17
- AlicenseNot gradedqualityCmaintenanceAn MCP server that acts as a governance proxy for AI agents, evaluating each tool call against policies before execution, enabling secure and controlled access to systems like Slack, GitHub, and AWS without exposing credentials to the agent.Apache 2.0
- FlicenseNot gradedqualityCmaintenanceA local MCP server that provides controlled repository access with policy-based file filtering, secret redaction, and audit logging for AI coding agents.
- AlicenseNot gradedqualityBmaintenanceA secure MCP server that connects ChatGPT/Codex to a local Obsidian Vault, enabling controlled knowledge retrieval, note maintenance, and daily ingest while enforcing path policies, concurrency checks, and audit.MIT
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
A paid remote MCP for OpenAI Codex memory MCP, built to return verdicts, receipts, usage logs, and a
Remote MCP for Copilot CLI switch gate MCP, structured receipts, audit logs, and reviewer-ready evid
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/menaje/codex-mcp-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server