codex-dsh-bridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
codex-dsh-bridge
Let OpenAI Codex hand real tasks to DeepSeek Harness (DSH) — and watch everything DSH is doing.
Codex can start a DSH task, wait for it or poll it, continue the same DSH session with follow-ups, list the DSH sessions it can resume, and cancel running work. Since v1.1.0 it also sees sessions you start in the DSH desktop app: titles, live state, per-session turn/tool counters and an event tail. Every task runs inside a genuine, persisted DSH session, so it shows up in the DSH GUI, can use DSH tools with DSH approvals, and survives restarts.
English · 简体中文
flowchart LR
subgraph Codex["OpenAI Codex"]
A[Agent] --> B["MCP tools<br/>dsh_run_task / dsh_task / …"]
end
B -- "stdio (MCP)" --> C["codex-dsh-bridge<br/>Codex plugin · zero-dependency MCP server"]
C -- "HTTP + Bearer token<br/>127.0.0.1 only" --> D["dsh-codex-bridge<br/>DSH Host plugin"]
D -- "ctx.agents.create / resume<br/>+ session observation" --> E["Real DSH sessions<br/>(bridge tasks and GUI-started work)"]Why a bridge plugin
DSH authenticates its own Web/API surface with a token that only ever lives inside the running DSH host process — the desktop shell receives the ready URL over IPC, and nothing outside that process can mint the URL again. So an external agent cannot simply call the DSH Web API. The bridge closes that gap from the inside:
the DSH Host plugin runs a small loopback HTTP server, writes
~/.dsh/codex-bridge.json(url+ randomtoken), and drives real sessions through the DSHagentsservice;the Codex plugin reads that discovery file and exposes MCP tools that proxy to it.
No DSH token is ever copied into Codex, and nothing is exposed outside 127.0.0.1.
Related MCP server: harness-relay-mcp
Install
Two halves, both required.
1. DSH side (the Host plugin)
Install dsh-host-plugin/ into your DSH profile:
GUI: DSH → Plugins → Add plugin → choose the
dsh-host-plugindirectory, then restart DSH.Agent-assisted: ask a DSH agent to call
plugin_manager install_bundlewith the absolute path ofdsh-host-plugin/, then reload/restart DSH.
After DSH starts, check that the bridge is alive:
Get-Content $env:USERPROFILE\.dsh\codex-bridge.json
Invoke-RestMethod http://127.0.0.1:45871/health
# ok service=dsh-codex-bridge version=1.3.0 port=458712. Codex side (the plugin)
cd <this repo>
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\install.ps1The installer (idempotent):
copies
codex-plugin/into%USERPROFILE%\.codex\local-marketplaces\dsh-local\plugins\codex-dsh-bridge\and writes an absolute-path.mcp.json;registers the local marketplace at
…\dsh-local\.agents\plugins\marketplace.json;updates
%USERPROFILE%\.codex\config.toml(backup first) with[marketplaces.dsh-local],[plugins."codex-dsh-bridge@dsh-local"] enabled = trueand a compatibility[mcp_servers.dsh]entry;copies
skills/dsh-tasksinto%USERPROFILE%\.codex\skills\.
Then fully quit Codex (tray included) and relaunch, and confirm:
codex mcp list
# dsh C:\Program Files\nodejs\node.exe …\server\index.mjs enabledAsk Codex: "check the DSH bridge with dsh_status" — you should see
DSH bridge dsh-codex-bridge v1.3.1 — ok on port 45871.
Uninstall Codex side: powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\uninstall.ps1
Usage
Just talk to Codex, or name the tools explicitly:
Run the test suite in
C:\work\projectwith DSH and summarize the failures.
Start a long refactor in DSH, don't wait — poll it while I keep working here.
Continue the DSH task you started: now also update the changelog.
Which DSH sessions can you resume for this workspace?
What is running in DSH right now? Watch the
train-v3session and tell me when it finishes.
Cancel the stuck session in
C:\work\project.
Seeing everything in DSH, not just bridge tasks
Since v1.1.0 the DSH-side plugin observes every session in the DSH process — including the ones you start in the DSH desktop app. That closes the usual blind spot: Codex no longer only sees tasks it started itself. Since v1.3.0 it also reads DSH's managed job ledger, so background work that outlives the tool call — training runs, dev servers, detached shell jobs — stays visible with its live status, progress line and output tail.
MCP tool | What it does |
| Start a DSH task (new session, or an existing resumable |
| Fire-and-forget variant of |
| Fetch one task, optionally waiting; returns assistant output + tool trail |
| List tasks known to the bridge |
| Send a follow-up instruction to the same DSH session |
| Cancel a running task |
| List all DSH sessions ( |
| Read one session by id — GUI-started or bridge-started — optionally blocking while it runs |
| Cheap event tail of one session (turn starts/ends, tool calls/results, approvals, errors) for progress polling |
| Cancel the live turn of any session by id |
| List DSH managed jobs (live |
| One managed job: status, progress, detail and output tail |
| Stop a managed job |
| Add / list / remove a background watch over a file (with |
| Connectivity check, default model, task counts, currently running sessions |
Task results contain: state (starting / running / completed / error / cancelled
/ interrupted), session id, model, turn count, tool calls with args/result previews,
waiting_for_approval and idle duration.
Sessions that are not running any more are read back from the DSH session log, so
dsh_session still returns their title and last answer — the "what was that experiment
doing?" case works after the fact too.
Background work: session idle does not mean it stopped
A DSH session going idle only means its turn ended; a job it started keeps running.
Since v1.3.0 the bridge subscribes to DSH's job registry and to the job/registered /
job/settled session events, so dsh_jobs answers "is it still running" from the job
ledger instead of from the session state:
dsh_jobs {session_id: "session-…", live: true}— live jobs of one sessiondsh_job {job_id: "pwsh-…"}— status, progress, detail, and the tail of job outputdsh_job_cancel {job_id: "pwsh-…"}— stop it from Codex
For detached work that is not a managed job, use dsh_watch. It reports three separate
facts and never merges them into a guess:
process —
matched(a pid or command line is alive; a pid is only accepted when its creation time matches, so a recycled pid cannot fake liveness),not_found,unavailable(the query itself failed — absence then means nothing) ornot_configured;file — size,
updated_at, andprogress, computed as{kind: "lines", skip: 1}for a JSONL checkpoint (rows= lines − skip),{kind: "json_rows", key?}for a JSON array/object, or{kind: "regex", regex: "(\d+/\d+)"}for a log line. Mixed-encoding logs (Windows PowerShell UTF-16LE, cmd/GBK, Python UTF-8 appended into one file) are decoded from their BOM and a NUL-byte sniff instead of assuming UTF-8;verdict —
aliveonly when a matching process is confirmed;active_but_unconfirmedwhen files moved but liveness is unproven;unconfirmedotherwise. A quiet file or a missing process is reported asquiet/unknownwith an explicit "this alone does not prove it stopped", never as "stopped".
Manual watches have no start-time restriction, so you can attach one to an experiment that
has been running for hours; only the watches auto-created from a Start-Process/nohup
launch are bounded by that launch. Limit worth knowing: the job ledger covers work DSH itself
launched — every shell tool call is a job, so short foreground commands show up too. A process
started outside DSH, or a script whose launcher exited, is not in the ledger; give that one a
dsh_watch on its log/checkpoint and process.
HTTP API (DSH Host plugin)
All routes require Authorization: Bearer <token> except /health.
Method | Path | Description |
GET |
| Unauthenticated liveness probe ( |
GET |
| Bridge version, port, default model, task counts |
GET |
| Task list (newest first) |
POST |
| Create and run a task |
GET |
| Task detail / wait for terminal state (accepts a |
POST |
| Follow-up instruction in the same session |
POST |
| Cancel the task |
GET |
| All DSH sessions: live state, title, counters, optional event tail |
GET |
| One session (any origin); blocks while running when |
POST |
| Cancel the live turn of any session |
GET |
| Managed DSH jobs, live first |
GET |
| One job: status, progress, output tail |
POST |
| Stop a job |
GET |
| Background watches with live state |
POST |
| Add a watch ( |
GET | DELETE |
| Read or remove one watch |
POST /v1/tasks body:
{
"prompt": "Run the tests and summarize failures", // or "message"
"cwd": "C:\\work\\project", // workspace, default = plugin defaultCwd
"session_id": "session-…", // optional: resume an existing session
"title": "nightly tests", // optional label
"preset": "default", // optional DSH agent preset id
"model": "deepseek-flash", // optional, default = DSH default-model
"reasoning_effort": "high", // optional
"auto_approve": false, // default false
"wait": true,
"timeout_seconds": 120
}Security
The bridge listens on 127.0.0.1 only and authenticates with a random 32-byte token, compared in constant time. The token + URL live in
~/.dsh/codex-bridge.json.auto_approvedefaults to false: any tool that needs approval parks the task inwaiting_for_approvaland you approve it in the DSH GUI, like any other DSH session. Setauto_approve: trueonly for automations you explicitly trust.When the DSH plugin is disabled or reloaded, agents it created are cancelled and disposed; reloading rotates the token, and the Codex side re-discovers it automatically.
Compatibility
Piece | Requirement |
Codex | Desktop build with local marketplaces + MCP support (tested on 26.1120 / CLI 0.110.0). This build has no |
DSH |
|
Node.js |
|
OS | Windows 10/11 (PowerShell 5.1 or 7). The DSH host plugin itself is OS-agnostic. |
Troubleshooting
Symptom | Fix |
| The DSH Host plugin is not installed/enabled, or DSH was not restarted. Check |
| Discovery file is stale (DSH reloaded). The server re-reads it automatically; restart Codex if it persists. |
| Your PowerShell 5.1 wrote a BOM or re-encoded non-ASCII paths. Restore the |
Tools not visible in Codex | Restart Codex Desktop (tray included). The running session does not hot-reload MCP servers. |
| Codex CLI model/account mismatch — unrelated to this plugin. Pick a model your account can use, or use the desktop app. |
Development
npm test # offline MCP protocol tests (node --test, no DSH needed)
node scripts\e2e-bridge.cjs # end-to-end against the running DSH bridge (creates a real session)
node scripts\e2e-async.cjs # async / continue / cancel flows
node scripts\e2e-session-observe.cjs # live + historical session observation, cancel by session id
node scripts\e2e-watch.mjs # background watch over a detached process + progress file
node scripts\e2e-jobs.mjs # managed DSH jobs: live state, detail, cancel
node scripts\mcp-smoke.mjs <abs path to codex-plugin\server\index.mjs>Layout:
codex-plugin/ Codex side: portable plugin.json, .codex-plugin/plugin.json,
mcp.json + .mcp.json, skills/dsh-tasks/SKILL.md, server/index.mjs
dsh-host-plugin/ DSH side: cordis.patch.yml, index.js (loopback HTTP + agent runtime)
scripts/ manual end-to-end probes
tests/ offline MCP protocol tests
install.ps1 install Codex plugin + config
uninstall.ps1 remove them againReleases
Version | Date | Highlights |
2026-12-04 | Truthful watches: manual watches have no start-time limit, checkpoint progress ( | |
2026-12-03 | DSH managed jobs: |
| v1.1.0 | 2026-12-03 | See every DSH session: dsh_sessions / dsh_session / dsh_session_events / dsh_cancel_session, live state + titles + counters for GUI-started work |
| v1.0.2 | 2026-12-02 | Idempotent config.toml registration (lib/codex-config.ps1), installer regression test |
| v1.0.1 | 2026-12-02 | Session create-fallback, UTF-8-without-BOM install scripts, Chinese/English docs |
| v1.0.0 | 2026-12-02 | First public release: DSH Host bridge + Codex MCP plugin + installers |
See the full changelog for details.
Roadmap
observe sessions started directly in the DSH desktop app (v1.1.0)
follow DSH managed jobs and file/process watches for background work (v1.3.0)
one-click install through
codex plugin/ a Codex UI marketplace entry, once that surface shipsdsh_taskstreaming notifications so Codex can react to progress instead of pollingper-task token scoping and an audit log
macOS / Linux installer script
Related
Model Context Protocol — the stdio transport Codex uses to reach this plugin
Agent Plugins 1.0 — the portable
plugin.json/mcp.jsonspecification this plugin followsDeepSeek Harness (DSH) — the local agent runtime the bridge drives
License
MIT — see LICENSE. Contributions welcome; see CONTRIBUTING.md.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
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 harness MCP, built to return verdicts, receipts, usage logs, and
A paid remote MCP for OpenAI Codex memory MCP, built to return verdicts, receipts, usage logs, and a
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables Codex to supervise long-running DeepSeek Harness sessions through MCP, providing tools for progress monitoring, handoffs, and artifact management while keeping the host independent.MIT
- AlicenseNot gradedqualityBmaintenanceEnables Codex to delegate scoped tasks to a local DeepSeek Harness over MCP — dispatching read-only reviews or authorized workspace writes, steering and monitoring runs to a terminal state, and returning structured evidence such as changed paths, test results, and assistant text. It also supports exact archival of the terminal session by full session ID.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables Codex to delegate scoped coding tasks to DeepSeek Harness subagents over MCP using the official ACP, then wait for results, resume the same session with corrections, and forward permission requests. Read-only and workspace-write modes let results be reviewed and independently verified before acceptance.MIT
- AlicenseNot gradedqualityBmaintenanceEnables Codex to delegate selected tasks to a locally installed DeepSeek Harness through MCP tools for execution, status, planning, and feedback while keeping orchestration local.2MIT