Skip to main content
Glama
Zbrooklyn

dsh-codex-mcp

by Zbrooklyn

dsh-codex-mcp

通过 DeepSeek Harness 使用 Codex 模型,经由 OpenAI 官方 CLI —— 无需将你的 ChatGPT 凭据交给任何第三方代码保管。

安装

npm i -g @openai/codex   # if you don't already have it
codex login              # sign in with your ChatGPT account
dsh plugin --profile web add dsh-codex-mcp
dsh web

就这样。Codex 会以 mcp__codex__codex 的形式出现在代理的工具列表中。无需 API 密钥,无需在 harness 中执行 OAuth 流程,也无需粘贴任何内容。

为什么存在

其他将 ChatGPT 订阅接入 harness 的插件会自行执行 OAuth 流程,获取一个绑定到你套餐的令牌,并将其存储起来。对 OpenAI 而言,这些请求看起来来自 Codex CLI。实际上,是一个第三方包在保管着你付费服务的凭据。

本插件完全不进行身份验证。它只负责定位 Codex 可执行文件,将其作为 MCP 服务器启动,并让 harness 通过 stdio 与之通信。身份验证发生在 OpenAI 自己的签名二进制文件内部,使用的是它自己的 ~/.codex/auth.json这里没有令牌可泄露,卸载后也没有任何凭据需要撤销。

DeepSeek Harness  ──MCP/stdio──▶  codex mcp-server  ──HTTPS──▶  OpenAI
                                  (official binary,
                                   own credentials)

为什么用 MCP 而不是每次调用都启动新进程

在相同提示词和模型下的测量结果:

方式

延迟

MCP 服务器(常驻进程)

11.4 秒

codex exec(每次调用新进程)

31.5 秒

每次 codex exec 调用都会冷启动二进制文件并重新加载技能上下文,然后才开始应答。MCP 服务器只需承担一次这样的开销。它还能保持线程状态,因此 codex-reply 可以继续对话。

代价是一个常驻进程 —— 观察到的内存占用约为 140 MB。

配置

每个选项都是可选的;默认值就是你要的。

选项

默认值

用途

command

自动检测

Codex 可执行文件的完整路径

serverName

codex

工具命名空间(mcp__<serverName>__…

cwd

harness 工作目录

Codex 进程的工作目录

env

{}

额外的环境变量

toolCallTimeoutMs

900000

单次调用的时间上限 —— Codex 回合是代理运行,不是补全

failOnStartupError

false

是否在 Codex 缺失时阻止 harness 启动

DSH_CODEX_BINARY 可在不编辑配置的情况下覆盖检测结果。

如何定位可执行文件

  1. 显式指定的 command,或 DSH_CODEX_BINARY

  2. 全局 @openai/codex 安装中的原生二进制文件,通过枚举磁盘而非硬编码路径来查找 —— 新平台或新架构无需修改

  3. PATH 中的 codex 可执行文件

在 Windows 上会刻意跳过 npm 的 .cmd.ps1 垫片:MCP stdio 传输在启动进程时不经过 shell,因此垫片无法以这种方式启动。

当 Codex 缺失时

插件会记录一条警告,说明修复方法,然后不挂载任何工具。harness 会正常启动,只是没有 Codex 工具。如果你宁愿启动失败也不愿在缺少 Codex 的情况下运行,可以设置 failOnStartupError: true

要求

  • 安装了 @deepseek-ai/dsh-mcp-client 0.1.0-rc.60.1.0-rc.8 的 DeepSeek Harness

  • Node ^22.19.0 || >=24

  • 已登录的 Codex CLI

  • 包含 Codex 的 ChatGPT 套餐

已在 harness 0.1.0-rc.8codex-cli 0.144.5 上验证通过。

卸载

dsh plugin --profile web remove dsh-codex-mcp

没有存储任何凭据,因此无需清理其他内容。你的 Codex CLI 登录状态不受影响。

开发

npm install
npm test

测试会在临时目录中构建模拟的 npm 布局,因此测试套件可以在未安装 Codex 的机器上通过。CI 会在 Linux、macOS 和 Windows 上、跨两个受支持的 Node 版本运行测试,并单独验证打包后的 tarball 可以干净安装。

许可证

MIT

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • A paid remote MCP for OpenAI Codex harness MCP, built to return verdicts, receipts, usage logs, and

View all MCP Connectors

Latest Blog Posts

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/Zbrooklyn/dsh-codex-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server