dsh-mcp-bridge: Registering stdio MCP Services as DSH Native Tools

Preface

When building agents in DeepSeek Harness (DSH), browser automation often requires a separate integration layer: you either write your own tool wrappers or let the model indirectly call MCP via generic interfaces. The official Microsoft Playwright MCP uses the stdio protocol, which does not align directly with DSH’s ctx.tools.register.

imaused/dsh-mcp-bridge (npm package name dsh-mcp-host) acts as a bridge: upon loading, it launches a stdio MCP subprocess, converts the tools listed in tools/list into DSH parameter schemas and registers them. Upon invocation, it forwards tools/call requests. The default scenario attaches to the Edge/Chrome browser you are already using, driving the current browser session via Playwright MCP rather than launching a separate blank instance.

What is this

Maintainer: imaused. Repository: https://github.com/imaused/dsh-mcp-bridge. Community Directory (independent site, not officially affiliated with DeepSeek / High-Flyer): https://www.skillhub.cn/plugins/imaused/dsh-mcp-bridge. Categorized as Workflow; a Host-only plugin with no browser UI. The plugin itself introduces no npm dependencies (it launches the MCP service via npx at runtime based on your configuration).

In short: It exposes any stdio MCP service (the documentation uses Playwright MCP + an existing Edge/Chrome instance as an example) as native DSH tools.

Core Features

The workflow after loading can be summarized in three steps:

  1. Start an MCP service process (default command see configuration table below).
  2. Execute initialize and tools/list, convert each tool’s JSON Schema into a DSH parameter schema, and register them via ctx.tools.register.
  3. When the agent calls a tool, the bridge layer forwards it as an MCP tools/call, returning the result as JSON. Screenshot results are written to a temporary file, and the path is returned instead of base64 data.

Tool names are prefixed: for example, browser_navigate on the MCP side becomes edge_navigate under the default prefix. The prefix can be modified via environment variables.

By default, only the 12 tools provided by Playwright MCP are registered (the full set is 25; registering all of them consumes prompt space in every session turn):

  • edge_navigate, edge_navigate_back, edge_snapshot, edge_click, edge_type, edge_fill_form, edge_press_key, edge_tabs, edge_take_screenshot, edge_evaluate, edge_wait_for, edge_close

To enable all tools, set MCP_BRIDGE_ALL=1; you can also use MCP_BRIDGE_TOOLS to define a comma-separated whitelist.

If the MCP process fails to start or initialization times out, the plugin does not register any tools, explains the reason in the logs, and does not throw errors that would crash the Host startup. You can view the tail of stderr in the DSH console and adjust MCP_BRIDGE_INIT_TIMEOUT as needed.

The bridge layer itself does not initiate external network requests; it only spawns the subprocess you configured and relays traffic between tool calls and its stdin/stdout. When using --cdp-endpoint to attach to an existing browser, MCP can access and operate on your currently open tabs, effectively handing over the browser session to the agent. Please assess the risks yourself before use.

Installation and Activation

The installation examples in the documentation target the Windows DSH directory, using rollback.cmd guard add to point to the local plugin path (replace with the actual path on your machine):

cd E:\dsh
.\rollback.cmd guard add "file:C:\path\to\dsh-mcp-bridge"
.\rollback.cmd health

Restart DSH (or rely on hot-loading) and start a new session. The plugin requires Node.js >=18; License: MIT (package.json version 0.1.0).

Configuration

Control the MCP command and the exposed toolset via environment variables:

Environment Variable Default Value Description
MCP_BRIDGE_COMMAND npx --yes @playwright/mcp@latest --cdp-endpoint=msedge The stdio MCP service startup command (can be changed to any stdio MCP)
MCP_BRIDGE_PREFIX edge Prefix for tool names registered to DSH
MCP_BRIDGE_ALL Unset Set to 1 to register all tools provided by the server
MCP_BRIDGE_TOOLS Unset Comma-separated whitelist of MCP tool names
MCP_BRIDGE_TIMEOUT 120000 Timeout for a single tool call (milliseconds)
MCP_BRIDGE_INIT_TIMEOUT 30000 Timeout for MCP startup and initialization (milliseconds)

Attaching to Existing Edge / Chrome (Default Playwright Scenario)

To allow Playwright MCP to attach to the browser you are currently using (preserving login states and extensions) instead of launching a brand-new instance:

  1. Open edge://inspect/#remote-debugging in the browser (for Chrome, use chrome://inspect/#remote-debugging).
  2. Enable Allow remote debugging for this browser instance.
  3. Keep the --cdp-endpoint=msedge in the default MCP_BRIDGE_COMMAND (for Chrome, change to =chrome).

If remote debugging is not enabled, Playwright will launch a new browser process.

Typical Usage

After installation and environment variable configuration, the agent will see the prefixed tools (e.g., edge_navigate, edge_snapshot) in a new DSH session. Common workflows:

  1. Use edge_navigate to open the target URL.
  2. Use edge_snapshot or edge_take_screenshot to get the page structure or screenshot path.
  3. Use edge_click, edge_type, edge_fill_form, etc., to interact with the page.
  4. Use edge_tabs to manage tabs if needed, and edge_close to end browser-related operations.

Specific parameters depend on the schema at registration time (derived from the MCP tool’s JSON Schema).

Use Cases and Notes

This is suitable for developers who want to use Playwright MCP (or other stdio MCPs) directly within DSH workflows without writing a layer of tool registration and forwarding manually. The default set of 12 tools strikes a compromise between “daily web operations” and “session prompt consumption.”

Before installing, it is recommended to read the repository source code and LICENSE to ensure the behavior meets expectations. The plugin runs with the permissions of the current DSH process; the subprocess command line and CDP attachment scope are configured by you. When involving accounts, cookies, and local files, please use the principle of least privilege.

Conclusion

dsh-mcp-bridge connects stdio MCP with the DSH tool surface, defaulting to browser automation for “Existing Edge/Chrome + Playwright MCP”. Directory Page: https://www.skillhub.cn/plugins/imaused/dsh-mcp-bridge; Source Code & README: https://github.com/imaused/dsh-mcp-bridge.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye