dsh-codex-mcp
dsh-codex-mcp
Codex models in DeepSeek Harness, through OpenAI's official CLI — without giving any third-party code custody of your ChatGPT credentials.
Install
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 webThat's it. Codex appears in the agent's tools as mcp__codex__codex. No API key, no OAuth flow inside the harness, nothing to paste.
Why this exists
Other plugins that put a ChatGPT subscription into the harness run their own OAuth flow, obtain a token scoped to your plan, and store it. To OpenAI those requests appear to come from Codex CLI. In practice a third-party package is holding a credential for something you pay for.
This plugin does not authenticate at all. It locates the Codex executable, launches it as an MCP server, and lets the harness talk to it over stdio. Authentication happens inside OpenAI's own signed binary, against its own ~/.codex/auth.json. There is no token here to leak, and uninstalling leaves nothing behind to revoke.
DeepSeek Harness ──MCP/stdio──▶ codex mcp-server ──HTTPS──▶ OpenAI
(official binary,
own credentials)Why MCP rather than shelling out per call
Measured on the same prompt and model:
Approach | Latency |
MCP server (persistent process) | 11.4s |
| 31.5s |
Every codex exec invocation cold-starts the binary and reloads its skills context before answering. The MCP server pays that once. It also keeps thread state, so codex-reply can continue a conversation.
The cost is a resident process — around 140 MB in observed use.
Configuration
Every option is optional; the defaults are what you want.
Option | Default | Purpose |
| auto-detected | Full path to the Codex executable |
|
| Tool namespace ( |
| harness working directory | Working directory for the Codex process |
|
| Extra environment variables |
|
| Per-call ceiling — Codex turns are agent runs, not completions |
|
| Whether a missing Codex should stop the harness booting |
DSH_CODEX_BINARY overrides detection without editing config.
How the executable is found
An explicit
command, orDSH_CODEX_BINARYThe native binary inside a global
@openai/codexinstall, enumerated from disk rather than hardcoded — a new platform or architecture needs no change hereA
codexexecutable onPATH
On Windows the npm .cmd and .ps1 shims are deliberately skipped: the MCP stdio transport spawns without a shell, and a shim cannot be launched that way.
When Codex is missing
The plugin logs one warning naming the fix and mounts nothing. The harness starts normally with Codex tools absent. Set failOnStartupError: true if you would rather boot loudly than run without it.
Requirements
DeepSeek Harness with
@deepseek-ai/dsh-mcp-client0.1.0-rc.6–0.1.0-rc.8Node
^22.19.0 || >=24Codex CLI, signed in
A ChatGPT plan that includes Codex
Verified against harness 0.1.0-rc.8 and codex-cli 0.144.5.
Uninstall
dsh plugin --profile web remove dsh-codex-mcpNo credentials were stored, so there is nothing else to clean up. Your Codex CLI login is untouched.
Development
npm install
npm testTests build synthetic npm layouts in a temp directory, so the suite passes on machines with no Codex installed. CI runs them on Linux, macOS and Windows across both supported Node versions, and separately verifies that a clean install of the packed tarball works.
Licence
MIT