codex-mcp-bridge
codex-mcp-bridge
用于 Claude Desktop 的 MCP server,通过共享的 Codex app-server 将提示词直接发送到现有 Codex 会话。支持 macOS、Windows 和 Linux。
不是使用 codex exec(每次创建新会话)。Bridge 通过 JSON-RPC 与 Codex 的真实 app-server 通信,因此会话会保留完整历史、cwd、模型和 rollout 文件。
架构
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)app-server 是按端口单例运行的。Bridge 探测
http://127.0.0.1:8791/readyz;如果尚未存活,则自动以 detached 方式 spawn(codex app-server --listen ws://127.0.0.1:8791),且该 app-server 在 Bridge 退出后仍会独立继续运行。所有指向同一 URL 的客户端都会使用同一个 app-server → 使用
threadId调用thread/resume会重新加入正在运行的会话,而不是打开新会话。Bridge 只维持一个 WebSocket,
initialize只调用一次,并按threadId路由通知,因此多个并发会话互不干扰。
Related MCP server: webgpt MCP
工具
工具 | 说明 |
| 将提示词作为 user turn 发送到 |
| 列出会话(id、title、cwd、更新时间、status)——用于获取正确的 |
| 在指定 |
| 读取会话最近的对话内容,不发送任何内容。 |
| 停止正在运行的 turn。 |
| macOS:通过 |
| 报告环境信息:platform、已解析的 |
send_to_codex_thread 还接受 timeoutSec(默认 240)、cwd、model、effort 和 openInApp(macOS — 发送前在应用中打开会话以实时查看)。超时不会取消 turn —— Bridge 会返回已收集到的内容及 turnId;可以使用 read_codex_thread 继续读取,或使用 interrupt_codex_turn 停止。
安装到 Claude Desktop
npm install
node scripts/install-claude-desktop.mjs脚本会自动识别 platform,在 config 文件不存在时创建,备份旧版本(*.bak-<ngày>-codexbridge),并保留所有现有 key:
操作系统 | 配置文件路径 |
macOS |
|
Windows |
|
Linux |
|
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"
}
}
}
}安装后重启 Claude Desktop。
解析 codex binary: Claude Desktop(以及 launchd)启动 MCP server 时使用被裁剪的 PATH,因此 codex 通常不在 PATH 中。Bridge 按以下顺序查找 —— CODEX_BIN → 该平台常见的安装位置 → PATH:
操作系统 | 查找顺序 |
macOS / Linux |
|
Windows |
|
在 macOS/Linux 上,codex 是带有 shebang #!/usr/bin/env node 的 Node 脚本,因此 Bridge 还会为子进程重新注入 PATH(当前 node 目录 + /opt/homebrew/bin + /usr/local/bin + 系统目录)——如果缺少这一步,spawn app-server 会在 shebang 处立即失败。
macOS
使用 launchd 将 app-server 作为后台服务运行
node scripts/install-launch-agent.mjs创建 ~/Library/LaunchAgents/com.codex-mcp-bridge.app-server.plist(RunAtLoad + 崩溃时 KeepAlive,ThrottleInterval 10 秒),然后运行 launchctl bootstrap gui/$UID。app-server 在登录时就已运行,因此 Bridge 无需自行 spawn,且会话始终处于 live 状态。
launchctl print gui/$UID/com.codex-mcp-bridge.app-server | head -20 # trạng thái
node scripts/install-launch-agent.mjs --uninstall # gỡ日志:~/Library/Logs/codex-mcp-bridge/app-server.{out,err}.log。
在 Codex 桌面应用中直接查看会话
macOS 上的 Codex 桌面应用是 /Applications/ChatGPT.app,并注册了 codex:// scheme。Bridge 使用 codex://threads/<threadId> 打开正确的会话:
open_codex_thread { threadId: "01a0…", background: true }
send_to_codex_thread { threadId: "01a0…", prompt: "…", openInApp: true }这是让任务发起人实时看到 Codex 正在做什么的方式,而不是等任务完成后再去阅读 rollout ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl。
macOS 上的限制
Codex 桌面应用会通过 stdio 自行运行一个独立的 app-server(
ChatGPT.app/Contents/Resources/codex … app-server),并且不接受外部 endpoint。在应用中打开的会话仍然可以通过 Bridge 发送,但机制是从 rollout.jsonl进行 resume,而不是 live attach。不要向桌面应用中正在运行 turn 的会话发送消息——两个 app-server 同时写入同一个 rollout 可能会损坏历史记录。先用list_codex_threads检查status,仅在idle/notLoaded时才发送。位于双系统机器 NTFS 分区上的仓库(
/Volumes/...)在 macOS 上只能读取——macOS 以只读方式挂载 NTFS。请在 APFS 卷上保留单独的 checkout(例如~/code/codex-mcp-bridge)以运行和修改。codex app-server daemon start使用unix://transport,control socket 为~/.codex/app-server-control/app-server-control.sock。Bridge 不使用这条路径(其帧协议不同于 WebSocket,且没有公开 API)——始终通过ws://通信。
环境变量
变量 | 默认值 | 含义 |
|
| 共享的 app-server endpoint。 |
| 自动探测 | 用于自动启动的 |
|
|
|
|
| 回复来自 Codex 的审批请求的方式。设为 |
| 按 OS 自动探测 | 运行 |
| 自动探测 | 为两个安装脚本强制指定 |
关于 approval: 如果 approval_policy 不是 never,Codex 会请求批准命令/补丁。由于没有人在 Claude Desktop 前点击按钮,Bridge 会根据 CODEX_BRIDGE_APPROVAL 自动回复,并记录到 stderr。默认的 approve 与 ~/.codex/config.toml 中的 approval_policy = "never" + sandbox_mode = "danger-full-access" 配置一致;如果收紧了沙箱,则应考虑改为 deny。
与交互式 Codex 会话共享 app-server
打开 TUI 并指向同一个 endpoint,这样 TUI 中的会话和 Bridge 中的会话就是同一个:
codex --remote ws://127.0.0.1:8791手动运行 app-server(不依赖 Bridge 的 autostart):
codex app-server --listen ws://127.0.0.1:8791测试
npm run check快速检查:启动 Bridge,必要时自动启动 app-server,列出会话。
npm run smokeSmoke test 创建一个新会话,连续发送 2 个 turn,并检查 Codex 是否记得上一个 turn 中的 codeword —— 也就是说会话确实是连续的,而不是每次新建会话。
在 Claude 中检查环境:调用工具 codex_bridge_status。
Available Tools
9 toolscodex_bridge_statusCheck the Codex bridge environmentARead-only
Report how this bridge is wired on the current machine: platform, resolved codex binary, app-server endpoint and whether it is live, plus desktop deep-link support and macOS integrations.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds meaningful behavioral context beyond the readOnlyHint annotation by listing exactly what the tool inspects and reports, including liveness checks and desktop/macOS integration details. It does not contradict the annotations, and for a read-only status tool the disclosure of its reported fields is sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that immediately states the tool's purpose and then lists the specific items reported, with no redundant phrases or filler. Every clause adds information, and the structure is easy to parse for an agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple zero-parameter status tool with readOnlyHint and openWorldHint annotations, the description is complete: it explains what the tool does, what information it exposes, and how it is bounded to the current machine. There is no output schema, so the enumerated report contents compensate appropriately and give the agent a clear model of the return value.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema coverage is 100% by definition, so there is no parameter semantics to clarify. Per the baseline for zero-parameter tools, this is a solid score; the description accurately describes the tool's fixed scope without pretending there are configurable inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Report') and a specific resource ('how this bridge is wired on the current machine'), then enumerates the concrete facts returned: platform, resolved codex binary, app-server endpoint and liveness, deep-link support, and macOS integrations. This clearly distinguishes it from the sibling tools, all of which are imperative actions rather than status checks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Report how this bridge is wired' implies this is a diagnostic/status tool to be used when the agent needs environment or connectivity information. However, there is no explicit guidance about when to prefer this over the sibling tools, such as 'check this before delegating' or 'use this when an operation fails.' The usage context is clear but only implied, not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_to_codexDelegate work to a new Codex sessionADestructive
Create a named Codex session at the requested project directory, send Claude's prompt into it, return Codex's reply, and hand the session to Codex Desktop without leaving the bridge writer lock behind. Use for independent new work when the user explicitly or through standing instructions authorizes new conversations. In Desktop mode, supply a fresh requestId per independent task and keep it on retries; omit requestId in legacy app-server mode. Use send_to_codex_thread for unfinished work.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute project directory where Codex must work | |
| name | No | Optional Codex session title; otherwise one is derived from the prompt | |
| model | No | Model override, e.g. gpt-5.6-luna | |
| effort | No | Override reasoning effort (default whatever ~/.codex/config.toml says) | |
| prompt | Yes | The complete task Claude is delegating to Codex. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim | |
| openInApp | No | Show the task in Codex Desktop; native tasks open immediately while running | |
| requestId | No | Desktop creation identity: fresh UUID for each independent new task; retain exactly on retries. Omitting it preserves legacy title/prompt deduplication and can return an older task. Not supported in legacy app-server mode. | |
| timeoutSec | No | How long to observe the task (Desktop caps the entire call, including creation, at 40s; the task continues and its threadId is returned) | |
| releaseAfterTurn | No | Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true, openWorldHint=true, and non-idempotency, so the safety profile is covered. The description adds real context beyond that: a bridge writer lock it must not leave behind, an authorization precondition, Desktop-mode requestId identity rules, and the 40s cap on the overall call even though timeoutSec allows up to 3600. It does not describe auth/credential requirements beyond the user-authorization note.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core action is front-loaded in the first sentence, followed by usage, mode rules, and the sibling pointer. Dense but slightly long-winded; the requestId rules repeat what the schema already says, which weakens justification for the length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 9-parameter mutating tool with no output schema, the description covers workflow, mode differences, alternative tools, and lock cleanup. It stops short of stating what is returned (the threadId appears only inside a parameter description) and the failure/error behavior of the call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds cross-parameter semantics the schema states per-parameter: a fresh requestId per independent task kept exactly on retries, omission in legacy mode, and the Desktop 40s cap conflicting with the timeoutSec ceiling. That interaction guidance is genuinely additive.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a precise multi-step verb sequence — create a named session at a project directory, send the prompt, return Codex's reply, hand off to Desktop without leaving the bridge lock behind. It is clearly distinguishable from siblings start_codex_thread and send_to_codex_thread.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It names the triggering condition ('independent new work when the user explicitly or through standing instructions authorizes new conversations') and routes unfinished work to the explicit alternative send_to_codex_thread. Mode-specific guidance (Desktop vs legacy app-server) is also given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
interrupt_codex_turnInterrupt a Codex turnADestructiveIdempotent
Stop a turn that is still running in a Codex thread.
| Name | Required | Description | Default |
|---|---|---|---|
| turnId | Yes | Turn id reported by send_to_codex_thread | |
| threadId | Yes | Codex thread id |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already mark destructiveHint=true and readOnlyHint=false, so the description carries a lower burden. It adds the useful condition that the turn must be still running, but it does not disclose side effects such as whether partial output is lost or whether the thread remains usable after interruption.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single, front-loaded sentence with no redundant content. It conveys the action, target, and condition in twelve words, making it highly efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-parameter tool with full schema coverage and annotations covering the destructive and idempotent nature, the description captures the core action and the key condition (still running). It lacks only minor detail about post-interruption behavior, which is not essential for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and both parameters have clear descriptions in the schema (turnId is reported by send_to_codex_thread, threadId is the Codex thread id). The description adds no additional parameter-level meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Stop') and resource ('a turn ... in a Codex thread'), clearly distinguishing it from sibling tools that operate on threads or the app server. The qualifying phrase 'still running' further narrows the scope and makes the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'still running' implies the intended use case—interrupting an active turn—but the description provides no explicit guidance on when not to use it or how it relates to alternatives like stop_codex_app_server. No when-to-use or when-not-to-use conditions are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_codex_threadsList Codex threadsARead-only
List recent Codex threads (id, title, cwd, last update, status) so you can pick the exact threadId to talk to.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Only threads whose session cwd matches this path exactly | |
| limit | No | How many threads to return (default 15) | |
| loadedOnly | No | Only threads currently loaded/live inside this app-server (default false) | |
| searchTerm | No | Substring filter on the thread title |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint=true and openWorldHint=true, so this is clearly a non-destructive operation. The description adds value by specifying the exact output fields and its purpose, which is especially useful since no output schema is present. It does not describe sorting or the exact source scope, but the annotations lower the bar for side-effect disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that front-loads the verb, resource, and output fields, then states the practical purpose. There is no redundant filler or repetition of schema content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only list tool with a fully described schema and no required parameters, the description is nearly complete: it names the output fields and the intended follow-up action. It could be slightly more explicit about whether it lists only app-server-loaded threads or all persistent threads, but the loadedOnly parameter and sibling context make this a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and every parameter (cwd, limit, loadedOnly, searchTerm) already has a meaningful description, including the default limit of 15. The description adds no additional parameter-level meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb-resource pair ('List recent Codex threads') and enumerates the returned fields (id, title, cwd, last update, status). It also gives a clear goal — picking the exact threadId to talk to — which distinguishes this read-only listing tool from sibling action tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool: before interacting with a thread, when the agent needs to resolve a threadId. It does not explicitly name sibling alternatives or state when not to use it, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
open_codex_threadOpen a Codex thread in the desktop appAIdempotent
Bring a Codex thread to the front on Windows or macOS using (codex://threads/) so a human can watch the work live instead of reading the transcript afterwards.
| Name | Required | Description | Default |
|---|---|---|---|
| threadId | Yes | Codex thread id | |
| background | No | Open without stealing focus from the current app (default false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations (idempotent, non-destructive), the description adds platform scope, the URI scheme, and the UI-focus side effect. It does not cover failure behavior such as an invalid thread ID or the desktop app not running, but there is no contradiction with the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence that front-loads the action and resource, then gives the purpose. No filler and no repetition of schema details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description plus schema adequately cover the key call details for a low-complexity UI-focus operation. It does not explicitly state return or error behavior, but no output schema exists and the intent is clear, leaving only a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds extra value by showing the exact codex://threads/<id> format for threadId, helping the agent construct a valid call beyond the schema's simple 'Codex thread id'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific action ('bring... to the front'), a specific resource (Codex thread), platform scope (Windows/macOS), and mechanism (codex://threads/<id>). This clearly distinguishes it from siblings like read_codex_thread or send_to_codex_thread.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description conveys when to choose this tool: when a human should watch the work live instead of reading a transcript. It does not explicitly name alternatives or exclusion criteria, but the contextual purpose is clear enough for an agent to route correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_codex_threadRead a Codex threadARead-only
Read a Codex thread without sending anything. In Desktop mode, pass the exact turnId returned by send_to_codex_thread for authoritative assistant item IDs, text, and reply hash; without turnId the native recent-history view may omit items.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How many recent messages to show (default 10) | |
| turnId | No | Exact turn id to inspect authoritatively in Codex Desktop mode | |
| threadId | Yes | Codex thread id |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, but the description adds valuable behavioral context: the mode-dependent behavior with turnId and the risk of omitting items without it. This goes beyond the annotation's bare safety profile.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no fluff; the core purpose is front-loaded, and the caveat about turnId is placed second. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with simple parameters and existing annotations, the description covers the purpose, mode-specific behavior, and parameter context. It lacks explicit output format but that's not required without an output schema, and the schema covers parameter defaults.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are already documented. The description adds extra meaning for turnId, explaining it should be the exact turnId from send_to_codex_thread for authoritative data, which enriches the schema's description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the action 'read' and the resource 'Codex thread', with the qualifier 'without sending anything' that distinguishes it from send_to_codex_thread. The mention of Desktop mode and turnId further differentiates it from siblings like open_codex_thread.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit guidance on when to pass turnId and why, indicating the context of use (read-only). However, it does not explicitly name alternatives or when-not-to-use, though the sibling list implies them.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_to_codex_threadSend a prompt to a Codex threadADestructive
Send a prompt as a new user turn inside an existing Codex thread and wait for Codex to answer. Use only for the same unfinished task, including follow-up fixes, clarifications, or results; independent new work belongs in a new conversation when authorized. The thread keeps its full history, cwd and model. Use list_codex_threads first if you do not know the threadId. Desktop-owned tasks must use Desktop native delivery; an open task is a valid destination. If legacy delivery reports an active writer, inspect codex_bridge_status and repair the native relay/configuration. Do not close the task, create a replacement, or ask the user to copy the message manually.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Expected destination directory; Desktop always checks the verified sender's project and cannot change the task's workspace | |
| name | No | Optional title to show for this Codex session | |
| model | No | Override the model for this turn | |
| effort | No | Override reasoning effort (default whatever ~/.codex/config.toml says) | |
| prompt | Yes | The message to send to Codex as a new user turn. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim | |
| threadId | Yes | Codex thread id (UUID) - get it from list_codex_threads | |
| openInApp | No | Open the thread in Codex Desktop on Windows or macOS so a human can watch it live | |
| timeoutSec | No | How long to observe the task (Desktop caps the entire call at 40s; the task continues and its threadId is returned) | |
| releaseAfterTurn | No | Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructive=true, non-idempotent and open-world, so the mutation/safety profile is partially covered. The description adds real context beyond that: the thread retains full history, cwd and model; Desktop-owned tasks must use Desktop delivery; and a legacy 'active writer' failure has a recovery path via codex_bridge_status. It stops short of describing what a wait/timeout actually returns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The core purpose and applicability rule lead the paragraph, and the negative instruction ('Do not close the task, create a replacement, or ask the user to copy the message manually') is a useful closer. It is dense with operational detail by necessity, but a couple of sentences about legacy relay repair sit awkwardly mid-paragraph.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 9-parameter, no-output-schema orchestration tool in a multi-agent setup, the description covers selection, persistence semantics, Desktop constraints, and failure recovery. Return handling is only implied (the schema notes a 40s cap that still returns a threadId), and the 'wait' behavior on non-Desktop paths is not spelled out, but the essentials are present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and all 9 params (including the effort enum range and the 40s Desktop cap) are documented in the schema itself. The description only marginally re-frames cwd/model/name via 'the thread keeps its full history, cwd and model,' so it does not add meaning beyond the structured fields. The baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Send a prompt as a new user turn inside an existing Codex thread and wait for Codex to answer.' It distinguishes itself from start_codex_thread by insisting on 'inside an existing Codex thread' and from delegate_to_codex by tying it to 'the same unfinished task.' An agent can select it without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit when-to-use ('the same unfinished task, including follow-up fixes, clarifications, or results') and when-not-to-use ('independent new work belongs in a new conversation when authorized'), plus a prerequisite ('Use list_codex_threads first if you do not know the threadId'). It also routes Desktop-owned tasks to native delivery, naming the alternative path.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
start_codex_threadStart a new Codex threadADestructive
Start a new Codex task when the user explicitly or through standing instructions authorizes a new conversation for independent work. In Desktop mode include the initial prompt and a fresh requestId to create and assign a visible task atomically; keep requestId unchanged on retries. Continue unfinished work with send_to_codex_thread and its original threadId. Use delegate_to_codex to also wait for its reply.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Absolute working directory for the new Codex session | |
| name | No | Optional title to show for the new Codex session | |
| model | No | Model override, e.g. gpt-5.6-luna | |
| prompt | No | Initial task; required with CODEX_BRIDGE_DESKTOP_TASKS=1, starts immediately. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim | |
| requestId | No | Desktop creation identity: fresh UUID per independent task, same UUID on retries. Omit only for legacy title/prompt deduplication. Not supported in legacy app-server mode. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true, readOnlyHint=false, openWorldHint=true, idempotentHint=false. The description adds operational details beyond annotations: Desktop mode atomic creation, requestId handling on retries, and that the tool creates a visible task. However, it does not elaborate on why it's destructive or what side effects occur beyond task creation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the core action and condition, then routing guidance. Every sentence earns its place and there is no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (creates a new thread, multiple parameters, mutation), the description covers usage conditions, alternatives, and key behavioral traits. It lacks details on error handling or what happens on failure, but with full schema coverage and annotations, it is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all parameters thoroughly. The description mentions 'initial prompt' and 'fresh requestId' behavior, which aligns with schema but adds minimal semantics beyond it (e.g., retry consistency). Baseline 3 is appropriate when schema does the heavy lifting.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action: 'Start a new Codex task' and clearly indicates it creates a new thread. It distinguishes itself from siblings by explicitly naming send_to_codex_thread and delegate_to_codex and describing when to use each alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides explicit guidance: use when the user explicitly or through standing instructions authorizes a new conversation; use send_to_codex_thread to continue unfinished work with an original threadId; use delegate_to_codex to also wait for a reply. This covers when to use this tool vs alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
stop_codex_app_serverStop the shared Codex app-serverADestructiveIdempotent
Stop the shared app-server this bridge talks to. Use it when work is handed off and the Codex desktop app is open: two app-servers on the same ~/.codex state make the app stutter. The bridge starts a new one automatically the next time it needs it.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already signal idempotent and destructive, and the description adds meaningful context beyond them: the shared-server scope, the stuttering problem it prevents, and automatic restart by the bridge on next use. It does not detail effects on in-flight Codex threads, but 'when work is handed off' and the auto-start note cover the main behavioral concerns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, each earning its place: what it stops, when to use it and why, and what happens next. The key trigger is front-loaded after the opening statement.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, no-output-schema tool, the description covers purpose, trigger conditions, rationale, and post-call behavior. The sibling context and annotations complete the picture without requiring extra prose.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and 100% schema coverage, so there is no parameter meaning to add. The description correctly implies this is a direct action with no inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: 'Stop the shared app-server this bridge talks to.' It distinguishes this tool from the thread/turn siblings by naming the bridge's app-server as the target, making its unique role clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives an explicit trigger: 'Use it when work is handed off and the Codex desktop app is open,' plus the reason ('two app-servers on the same ~/.codex state make the app stutter'). It also reassures about the next startup, so an agent knows when it is safe and expected to call it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.19.3- Changed
delegate_to_codex1 field changed- added
Input schema / properties / requestIdAdded value: +{ + "description": "Desktop creation identity: fresh UUID for each independent new task; retain exactly on retries. Omitting it preserves legacy title/prompt deduplication and can return an older task. Not supported in legacy app-server mode.", + "format": "uuid", + "type": "string" +}
- Changed
send_to_codex_thread1 field changed- changed
Input schema / properties / cwd / descriptionPrevious value: -"Override the working directory for this turn"New value: +"Expected destination directory; Desktop always checks the verified sender's project and cannot change the task's workspace"
- Changed
start_codex_thread1 field changed- added
Input schema / properties / requestIdAdded value: +{ + "description": "Desktop creation identity: fresh UUID per independent task, same UUID on retries. Omit only for legacy title/prompt deduplication. Not supported in legacy app-server mode.", + "format": "uuid", + "type": "string" +}
3 tool updates
v1.18.0- Changed
delegate_to_codex1 field changed- changed
Input schema / properties / prompt / descriptionPrevious value: -"The complete task Claude is delegating to Codex"New value: +"The complete task Claude is delegating to Codex. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"
- Changed
send_to_codex_thread1 field changed- changed
Input schema / properties / prompt / descriptionPrevious value: -"The message to send to Codex, exactly as a user would type it"New value: +"The message to send to Codex as a new user turn. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"
- Changed
start_codex_thread1 field changed- changed
Input schema / properties / prompt / descriptionPrevious value: -"Initial task; required with CODEX_BRIDGE_DESKTOP_TASKS=1, starts immediately"New value: +"Initial task; required with CODEX_BRIDGE_DESKTOP_TASKS=1, starts immediately. The prompt for the recipient agent, in English with the sections Goal, Context, Task, Scope, Constraints, Done when, Reply format (omit any that do not apply); text the user supplied is sent verbatim"
1 tool update
v1.16.1- Changed
read_codex_thread1 field changed- added
Input schema / properties / turnIdAdded value: +{ + "description": "Exact turn id to inspect authoritatively in Codex Desktop mode", + "type": "string" +}
3 tool updates
- Changed
delegate_to_codex2 fields changed- changed
Input schema / properties / openInApp / descriptionPrevious value: -"Open the finished session in Codex Desktop on Windows or macOS"New value: +"Show the task in Codex Desktop; native tasks open immediately while running" - changed
Input schema / properties / timeoutSec / descriptionPrevious value: -"How long to wait for the turn to finish (default 240s)"New value: +"How long to observe the task (Desktop caps the entire call, including creation, at 40s; the task continues and its threadId is returned)"
- Changed
send_to_codex_thread1 field changed- changed
Input schema / properties / timeoutSec / descriptionPrevious value: -"How long to wait for the turn to finish (default 240s)"New value: +"How long to observe the task (Desktop caps the entire call at 40s; the task continues and its threadId is returned)"
- Changed
start_codex_thread1 field changed- added
Input schema / properties / promptAdded value: +{ + "description": "Initial task; required with CODEX_BRIDGE_DESKTOP_TASKS=1, starts immediately", + "minLength": 1, + "type": "string" +}
2 tool updates
v1.12.3- Changed
delegate_to_codex1 field changed- changed
Input schema / properties / releaseAfterTurn / descriptionPrevious value: -"Stop the bridge app-server after a terminal turn so Codex Desktop owns the writer lock"New value: +"Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed"
- Changed
send_to_codex_thread1 field changed- changed
Input schema / properties / releaseAfterTurn / descriptionPrevious value: -"Stop the bridge app-server after a terminal turn so Codex Desktop owns the writer lock"New value: +"Unsubscribe this thread after a terminal turn; open Desktop only after its unload is confirmed"
9 tool updates
v1.11.2- First observed
codex_bridge_status - First observed
delegate_to_codex - First observed
interrupt_codex_turn - First observed
list_codex_threads - First observed
open_codex_thread - First observed
read_codex_thread - First observed
send_to_codex_thread - First observed
start_codex_thread - First observed
stop_codex_app_server
TDQS
Scored across 9 tools
delegate_to_codex, start_codex_thread, and send_to_codex_thread heavily overlap—delegate_to_codex is essentially a superset (create + send + wait), and the new-conversation vs unfinished-work distinction is explained only via lengthy prose that an agent can easily miss. list_codex_threads, read_codex_thread, open_codex_thread, and interrupt_codex_turn are more clearly distinct, but the core conversation-starting trio remains fuzzy.
Most tools follow a consistent verb_codex_noun pattern (list_codex_threads, send_to_codex_thread, read_codex_thread, stop_codex_app_server). The main deviation is codex_bridge_status, which flips to a noun-first form, though it is still readable and clearly its own concept.
Nine tools is well-scoped for a bridge that manages Codex sessions, covering session lifecycle, delivery, monitoring, and status. Slightly heavy given the operational overlap among the send/delegate/start trio, but each tool maps to a real capability.
The surface covers create (start/delegate), list, read, send, interrupt, open, and status—effectively the full session lifecycle an agent needs. The only notable gap is an explicit thread close/delete operation, but the descriptions imply tasks are intentionally never closed, so this is minor.
Maintenance
Related MCP Connectors
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for managing Claude Code conversation sessions1294 npmMIT
- FlicenseNot gradedqualityDmaintenanceLocal MCP server for Codex to send prompts to ChatGPT Web Pro extension and manage repository tasks safely.1-
- AlicenseNot gradedqualityBmaintenanceAn 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.2 npmMIT
- 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.474 npm1MIT