Preface¶
DeepSeek Harness (DSH) Desktop is already open with sessions, model switching, and approval workflows, but MCP-based tools like Antigravity, Claude Code, Codex, and Cursor often can only connect to their own processes, failing to match the state within the window. Common approaches involve either starting a separate mirrored session or writing custom HTTP integrations to the Host’s internal capabilities, which makes maintenance and permission boundaries more cumbersome.
dsh-mcp-bridge (npm package name dsh-mcp-bridge-server) is a Host plugin for DSH Desktop: it starts an MCP endpoint listening only on loopback within the Host process, writes the address and token to a discovery file, and provides a reconnectable stdio proxy, allowing external MCP clients to drive the same session log and GUI state as the desktop window. The following introduces its positioning, capabilities, and integration steps; maintained by google-q-dot, classified as a client plugin, repository at GitHub, directory page at SkillHub.
What is this¶
In short: It is not an independent MCP service; it must be installed into a specific DSH profile, and only exists after enabling the corresponding line in Plugins. Once enabled, it listens on http://127.0.0.1:<port>/mcp inside the Host and publishes ~/.dsh/mcp-bridge.json (directory can be changed via DSH_HOME).
The README states it has been tested on 0.2.2-rc.3; package.json requires dsh to be >=0.2.2-rc.1 <0.3.0, Node >=20. Runtime has zero npm dependencies, no need to start a separate process or run pnpm install in this repository.
Core Features¶
Streamable HTTP MCP Endpoint¶
- Path:
http://127.0.0.1:<port>/mcp, Bearer token authentication. - Protocol: JSON-RPC 2.0, supports
initialize,ping,tools/*,resources/*,prompts/list,logging/setLevel, etc.; tool calls return according to the MCP tools result envelope. GET /healthzcan be probed without authentication; other requests require token, loopbackHost, and satisfy the constraints mentioned in the README whenOriginis present.
stdio Proxy (Recommended for clients like Cursor)¶
The bin/dsh-mcp-stdio.mjs is launched by the client as a command, runs newline-delimited JSON-RPC on stdin/stdout, and forwards it to the loopback endpoint. initialize is answered locally by the proxy; even if the application is down, the proxy remains alive and returns -32000, discovering the endpoint file via jittered exponential backoff, and after reconnection, sends notifications/tools/list_changed and notifications/resources/list_changed.
Discovery file priority (high to low): CLI --url / --token -> Environment variable DSH_MCP_URL, DSH_MCP_TOKEN -> ~/.dsh/mcp-bridge.json.
Shared Session, No Shadow Transcript¶
The external agent writes to the real session log currently displayed on the desktop: the same set of prompts, model and mode switching, sub-agent requests and results. Will not mirror to a second private record, and will not write custom session-log event types.
Forward Budget and No Duplicate Replay¶
Default forward budget is 60s (DSH_MCP_REQUEST_TIMEOUT_MS). For blocking tools dsh_send_message (wait: true) and dsh_wait_session, the budget comes from the caller’s timeoutMs plus 30s, capped by DSH_MCP_MAX_FORWARD_TIMEOUT_MS at 15 minutes.
After reconnection, replay only when it does not cause duplicate side effects: tools/list, resources/*, prompts/list, ping can be replayed; tools/call is only replayed when it can be proven it was not executed (e.g., connection refused, unknown transport returning HTTP 404). Timeout or vague failures return -32002, do not retry tools/call to avoid dsh_send_message appearing twice in the session. Each request is replayed at most twice.
The README summary states the bridge side exposes about 26 tools; the specific list is determined by tools/list after enabling.
Discovery File Fields¶
~/.dsh/mcp-bridge.json is atomically written, permissions 0600. Main fields: version, pid, instanceId, dshVersion, host, port, url, token, startedAt, running (may contain stoppedAt when uninstalled). Token can be reused across restarts; when uninstalling, the record is only rewritten if the instanceId still belongs to the current instance, avoiding accidental deletion of writes by a new instance during hot reload.
Installation and Enablement¶
From npm / dsh-market (For production releases)¶
Inside the app: Plugins → Add plugin, search for dsh-mcp-bridge-server to install, confirm the plugin line dsh-mcp-bridge exists and is enabled.
CLI:
dsh plugin --profile <profile> add dsh-mcp-bridge-server
When the Host prompts, restart the app or dsh web process. dsh-market card installation uses the same npm package, no extra download steps.
From Local Directory Package (Development)¶
- In Plugins → Add plugin, install the absolute path of this repository, or point
plugin_manager’sinstall_bundleto this path. - Confirm the plugin line
dsh-mcp-bridge(in this repo it is@local/dsh-mcp-bridge) is enabled.
cordis.patch.yml will insert this line; activating it starts the endpoint and writes the discovery file.
How to Load After Modifying Source Code¶
Host-side HMR does not monitor the root modules of this bundle; when installed via link: inside the profile, modifying repository files will not hot reload automatically. Close and reopen the plugin line in Plugins, or use plugin_manager to execute set_plugin on include:dsh-mcp-bridge (enabled: false then true), or restart the application. The listener will try to bind to the original port; the token in the discovery file usually remains unchanged, instanceId and startedAt will be updated.
Typical Usage: Connecting MCP Clients¶
Method A — stdio Proxy (Recommended)¶
Point to the proxy script in the client MCP configuration; <profile> is the DSH profile directory of the installed plugin (the desktop default is often ~/.dsh/profiles/desktop):
{
"mcpServers": {
"deepseek-harness": {
"command": "node",
"args": [
"<profile>/node_modules/dsh-mcp-bridge-server/bin/dsh-mcp-stdio.mjs"
]
}
}
}
If the package is installed globally or for the current project, you can also:
npx --package dsh-mcp-bridge-server dsh-mcp-stdio
The proxy parses the endpoint from the discovery file; you do not need to change the client configuration when the app restarts or the port changes (unless you explicitly override URL/token).
Method B — Direct Streamable HTTP Connection¶
Read url and token from the discovery file, for example:
POST http://127.0.0.1:19830/mcp
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/json, text/event-stream
initialize response header contains mcp-session-id, subsequent requests must bring it back; DELETE /mcp ends the session. MCP-Protocol-Version must be a revision supported by the server (README lists 2025-06-18, 2025-03-26, 2024-11-05, etc.), otherwise 400.
Applicable Scenarios and Notes¶
Who is it for: Already using DSH Desktop to manage sessions, but want Cursor, Claude Code, Codex, Antigravity, etc., to drive the same live session via standard MCP, and handle approvals and questions on the MCP side; scenarios requiring local loopback integration and rejecting cloud relay.
Permissions and Security: The plugin runs with the current DSH Host process and tools can access sessions and operations under the Host’s existing permissions. Please read the repository source code and MIT license before installing to evaluate whether to include it in your work profile.
Ecosystem Note: DSH follows the “Everything is a plugin” philosophy; sites like SkillHub are community directories with no official affiliation with DeepSeek / Hypersphere; this article does not state them as official app stores.
Conclusion¶
dsh-mcp-bridge turns the DSH currently running in the desktop into a local MCP service: discovery file + stdio proxy reduces configuration costs for restarts and port changes, and the no-duplicate-replay strategy reduces the risk of accidentally sending two user messages. Enable the plugin as needed from npm or local bundle, then connect your MCP client via stdio or HTTP.
- Directory page: https://www.skillhub.cn/plugins/google-q-dot/dsh-mcp-bridge
- Repository: https://github.com/google-q-dot/dsh-mcp-bridge