Skip to main content

dsh-chatgpt-bridge

9Stars1Forks0Issues0Watchers

Bridges ChatGPT Web to local DSH via the official MCP protocol, enabling ChatGPT to directly create, view and continue DSH agent sessions with supervised targets.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
chatgptdeepseekdeepseek-harnessdshdsh-pluginmcpmodel-context-protocol

Install

cmdweb profile
$ dsh plugin --profile web add dsh-chatgpt-bridge

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin jiezeng2004-design/dsh-chatgpt-bridge for me: review the repository at https://github.com/jiezeng2004-design/dsh-chatgpt-bridge first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Positioning

This is an official DSH (DeepSeek Harness) plugin that builds an MCP bridge between ChatGPT Web and local DSH, enabling ChatGPT to directly create, view, continue, and supervise DSH agent sessions and multi-step goals through the standard protocol. The plugin only handles the connection and does not rewrite DSH's session, agent, tool, approval, sandbox, and workspace security models.

Core Capabilities

  • Enables ChatGPT to call DSH via 15 dsh_* tools (health check, workspace list, session create/view/continue, task status/result, approval and question decision-making)
  • Supports long-task supervision (Goal Supervision): initiate multi-step goals with dsh_start_goal, long-poll with dsh_wait_goal, revise/suspend/resume with dsh_update_goal, idempotent stop with dsh_stop_goal
  • Provides two MCP transports: default Streamable HTTP (127.0.0.1:3456/mcp) and stdio; auto-generates and persists authentication token on first launch
  • Adds a "ChatGPT Bridge" panel in DSH Web settings to host and monitor a plugin-owned tunnel-client subprocess (with Start/Stop/Restart, layered diagnostics, log viewing)
  • Reuses DSH's own session logs ($DSH_HOME/sessions/<workspace>/<session-id>/session.jsonl.zstd) as the session identity authority; sessions survive bridge, ChatGPT, or DSH restarts
  • Strictly inherits DSH's workspace boundaries, one-time approval permits, and sandbox path restrictions; does not expose arbitrary shell tools

Technical Implementation

  • Language: TypeScript (Node.js ESM, source includes type: "module")
  • Key Dependencies: @modelcontextprotocol/sdk (MCP protocol), @deepseek-ai/cordis (DSH plugin container), @deepseek-ai/dsh-agent / dsh-session / dsh-llm (agent and model access), zod + @deepseek-a i/schemastery (config/parameter validation)
  • Architecture Pattern: Injected as a DSH (Cordis) plugin row via dsh.bundle.patch (cordis.patch.yml); on plugin startup, apply(ctx, config) pulls up the Bridge, with McpServer registering 15 tools and exposing them via Streamable HTTP or StdioServerTransport; HTTP service supports Bearer token authentication
  • Entry Files: src/index.ts (apply startup entry) + src/bridge.ts (DSH seam adaptation core) + src/mcp.ts (15 dsh_* tool declarations) + src/client/index.js (DSH Web settings panel)

Use Cases

When you already have DSH running locally or in a self-hosted environment and want to use ChatGPT to directly assign tasks, check progress, and continue conversations—rather than copying and pasting content into the Web UI—this plugin exposes DSH as a ChatGPT-recognizable MCP application. It's also suitable for scenarios requiring long-task supervision (execution plans, goal revisions, suspending npm releases when 2FA gets stuck, etc.) because the Goal Supervision protocol allows ChatGPT to continuously poll within the same turn.

Prerequisites & Compatibility

DependencyMinimum VersionDescription
DeepSeek Harness (DSH)0.1.0-rc.6All @deepseek-ai/dsh-* peer/dev dependencies declared by the plugin are locked to 0.1.0-rc.6; needs web profile enabled in the same profile (recommended) or custom headless profile (see cordis.headless.patch.yml)
Node.js>= 22package.json#engines.node specifies "node": ">=22"; npm run typecheck / npm test scripts use Node 22+ test isolation flags
PlatformmacOS / Windows / LinuxSource uses process.platform to differentiate win32 (taskkill /T /F) from POSIX (SIGTERM/SIGKILL) flows; process-tunnel-runtime.ts explicitly supports platform: NodeJS.Platform injection for cross-platform testing
Native ModulesNoneAll dependencies (@deepseek-ai/cordis, @modelcontextprotocol/sdk, zod, @deepseek-ai/schemastery, etc.) are pure JS; no native bindings like node-gyp / node-pty / node:sqlite

Installation

dsh plugin --profile web add dsh-chatgpt-bridge

Configuration Options

ConfigTypeDescriptionDefault
transportEnum (http / stdio)MCP transport; HTTP goes to 127.0.0.1:3456/mcp for ChatGPT Web, stdio is for local MCP clientshttp
hostStringHTTP service binding address127.0.0.1 (loopback only)
portNumber (1–65535)HTTP service binding port3456
authModeEnum (token / none)Authentication mode; none disables Bearer token requirement (only available on loopback)token
authTokenStringStatic token; if empty, falls back to authTokenEnv env var, then to auto-generated random token written to tokenFileempty
authTokenEnvStringToken env var name to read when authToken is emptyDSH_CHATGPT_BRIDGE_TOKEN
tokenFileStringPath for auto-generated token file; if empty, writes to $DSH_HOME/chatgpt-bridge.tokenempty
resultMaxCharsNumberMax characters for assistant text returned by dsh_get_result8000
resultMaxItemsNumberMax tool call entries returned by dsh_get_result50
sessionMaxItemsNumberMax message entries returned by dsh_get_session20
sessionMaxCharsNumberCharacter limit per message in dsh_get_session4000
logLevelEnum (debug / info / warn / error)Bridge log level; logs written to $DSH_HOME/chatgpt-bridge.log with sanitization, won't pollute stdout in stdio modeinfo

FAQ

Q: Does it need extra configuration after installation?

A: No. It defaults to listening on 127.0.0.1:3456 with token authentication enabled. On first launch, it auto-generates a random token and persists it to ~/.dsh/chatgpt-bridge.token. To use a fixed token, set the DSH_CHATGPT_BRIDGE_TOKEN environment variable or fill in authToken in the config.

Q: How does ChatGPT access my local MCP endpoint?

A: ChatGPT Web is a remote MCP client and cannot directly reach 127.0.0.1. You need to use OpenAI's currently supported Secure MCP Tunnel or a custom connector to forward requests to http://127.0.0.1:3456/mcp, and include the generated token as Authorization: Bearer <token>. The bridge itself does not expose public network interfaces and does not include a tunnel.

Q: Will this plugin modify DSH core?

A: No. The plugin only drives DSH through its public seams (ctx.agents, ctx.sessions, ctx.sessionPersistence, ctx.workspaceRegistry, ctx.approval, ctx.userQuestions, etc.); DSH's session, agent, tool, approval, sandbox, and workspace security models remain unchanged; no DSH core files are modified.

Q: Where are sessions saved? Do they survive restarts?

A: DSH persists them to $DSH_HOME/sessions/<workspace>/<session-id>/session.jsonl.zstd. After any restart of bridge, ChatGPT, or DSH, dsh_send_message can still hit the same session_id and replay logs into the model context via ctx.agents.resume().

Q: Getting 401 Unauthorized?

A: The token is bound to the runtime. Switching $DSH_HOME, regenerating the token, or mismatching DSH_CHATGPT_BRIDGE_TOKEN with the persisted token will trigger this. Read the current runtime's actual token (at $HOME/.dsh/chatgpt-bridge.token) and have ChatGPT reconnect.

Q: Port 3456 is occupied?

A: First check the occupying process with lsof -iTCP:3456 -sTCP:LISTEN (macOS/Linux) or Get-NetTCPConnection -LocalPort 3456 (Windows)—don't directly kill unknown processes. If it's an old DSH/bridge process, stop it normally; otherwise, modify the port field in the profile config or free that port.

Q: How to completely uninstall?

A: Run dsh plugin --profile chatgpt-bridge remove dsh-chatgpt-bridge, or add disabled: true to the chatgpt-bridge line in the profile config file and restart. Session logs created by the bridge are retained in DSH and can be recovered by any profile sharing $DSH_HOME.

Q: Can stdio transport be used with ChatGPT?

A: No. ChatGPT Web won't spawn local processes. stdio is only suitable for connecting with locally running MCP clients; ChatGPT must use HTTP + a secure tunnel. After switching to stdio, also ensure the bootstrap process doesn't output anything to stdout, otherwise it will pollute MCP protocol frames.

Difficulty Level

Advanced — requires first having DSH installed and running a web profile, then having ChatGPT connect to 127.0.0.1:3456/mcp through an MCP tunnel; once the token flow and port/firewall are working, the semantics of the remaining 15 tools are relatively intuitive.

Known Issues & Limitations

  • ChatGPT is a remote MCP client; the bridge can only listen on 127.0.0.1; it must work with OpenAI's currently supported Secure MCP Tunnel to connect—the bridge itself does not provide a public entry point
  • waiting_for_approval / waiting_for_user decisions hanging in the bridge process are in-process objects; if the bridge restarts while they're still suspended, they'll be marked as cancelled (fail-closed)
  • dsh_get_result.changed_files is parsed from edit-tool parameters in the session log, not a file diff viewer
  • waiting_for_user provider slot is singleton; when the Web UI already occupies it, questions go through the Web UI instead of the bridge
  • Only single-profile deployments will see cold-start session titles; concurrent profiles sharing projection cache will have titles overwrite each other
  • Not implemented in v0.4.0: native runtime (NativeManagedTunnelRuntime), runtime hot-swapping, PID takeover recovery after process crash; currently handled by ProcessTunnelRuntime for subprocess hosting
  • Destructive kills (SIGKILL / taskkill /T /F) always re-validate PID + normalize executable path + process start time; any mismatch or read failure refuses to forcefully kill, avoiding accidentally killing processes whose PID got reused

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/jiezeng2004-design/dsh-chatgpt-bridge)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory