dsh-mcp-glue: Loading Project-Level MCP Declarations by Workspace in DSH

Preface

When building agents in DeepSeek Harness (DSH), MCP servers are often already defined in the repository: .mcp.json in the root directory, .cursor/mcp.json for Cursor, .codex/config.toml for Codex, and so on. Each client reads its own file, and if you switch to a DSH session and still rely on manual alignment via a global profile, it tends to drift from the project declarations and undermines the isolation of “one workspace, one session.”

Below we introduce the community plugin dsh-mcp-glue (maintainer AkotaP): it reads existing MCP declarations in the current workspace within DSH, connects servers within their respective Agent scopes, and does not write configuration into the DSH global profile nor modify the original declaration files in the repository. It is categorized as “Workflow” and can be viewed on the SkillHub plugin page; source code and documentation are on GitHub.

What Is This

dsh-mcp-glue targets DeepSeek Harness >=0.2.0-rc.2 (the README states the offline test baseline is 0.2.0-rc.2, with the primary verified version being 0.2.1-rc.2). In one sentence: it loads session-isolated workspace-level MCP declarations for DSH, and comes with preset parsing, a management UI, trust policies, a tool-calling gate, auto-reconnect, and more.

The plugin’s runtime code intentionally does not import any @deepseek-ai/dsh-* modules; instead it works with the host Cordis loader and the native MCP bridge. peerDependencies declares @deepseek-ai/dsh: >=0.2.0-rc.2 (optional), used for version compatibility checks at install and startup.

Built-in Presets: Aligning Common Client Configurations

The plugin uses “presets” to describe “where the file is, what format it uses, and under which key the server list lives.” The built-in presets are as follows (all paths are relative to the workspace root):

ID Relative Location Server Table Key Format
root .mcp.json mcpServers or servers (they cannot coexist) JSONC
vscode .vscode/mcp.json servers JSONC
codex .codex/config.toml mcp_servers TOML
cursor .cursor/mcp.json mcpServers JSONC
gemini .gemini/settings.json mcpServers JSONC

The new VS Code portable configuration is also loaded via the root preset. Beyond the built-in items, you can add or remove custom presets in the “Preset Management” section of the plugin detail page (file location, format, server table path, dialect, interpolation, field mapping, etc.); on save, the frontend and backend validate using the same parser. Presets are merely data in the Host configuration and do not execute project scripts.

Management UI and Connection Behavior

Two entry points:

  1. The MCP control to the left of the input tool row: displays the declarations and connection status for the current session workspace (e.g. ● MCP connected/declared). Clicking it allows you to “Connect / Disconnect” each server, “Reload” declarations, “Connect all / Disconnect all.” A manual connection represents explicit authorization for that session and declaration fingerprint; “Disconnect” is sticky—declarations will not trigger an auto-reconnect even if they change.
  2. Preset management on the plugin detail page (Settings → Plugins → dsh-mcp-glue): toggle built-in presets and maintain custom presets. Configuration lives in plugins.bundle.config (keyed by package name); configuration fields that take effect immediately after saving are volatile items, requiring no Harness restart.

The client half is the build artifact lib/client.js (generated by pnpm run build); if it is missing, the host will refuse activation. After modifying host-side code, you need to restart Harness for it to re-import the module.

Trust, Auto-Connect, and the Tool Gate

Whether to auto-connect is decided in three layers (any layer hit allows auto-loading):

  1. trustMode: all — trusts all repositories (high risk; do not use with untrusted code).
  2. trustedWorkspaces — directories in the list (exact match, not including subdirectories) allow all declarations within to be auto-loaded.
  3. workspaceAllowances[].allowMcp — within a specified workspace, only the listed servers may be auto-loaded.

When none of the three layers are hit, the plugin does not proactively pop up an approval box; you need to click “Connect” in the panel or enable “Always trust this workspace.” Allowing a directory to auto-load is equivalent to allowing the declarations inside to launch local programs; DSH’s native MCP stdio is launched directly by the SDK and is not restricted by the file tool sandbox.

Tool calls are separate from “the server has started”: when a server is allowed but a particular tool is not in allowTools, the plugin provides “Allow once / Always allow this tool / Deny” via contextual prompts at the tools/pre-execute gate. The project’s own includeTools / excludeTools take precedence over the panel toggle; tools disabled by the project will not be prompted. The gate only applies to servers mounted by this plugin.

Auto-Reconnect and HTTP Disconnect Detection

For servers that meet the policy and are still selected, the plugin provides auto-reconnect with backoff (1, 2, 4, 8, 16, 30, 60 seconds with jitter, then retry at the 60-second tier; the backoff resets after 30 seconds of stable connection). When a required server is unavailable, it will reject model requests until it recovers. For connected HTTP servers, a read-only HEAD probe can be performed (no credentials); stdio relies on subprocess exit events. Manual disconnects remain sticky; boundaries such as declaration changes are documented in docs/management-ui.md in the repository.

Installation and Activation

Choose either installation method; after installation, dsh.bundle.patch inserts the workspace-mcp-glue entry, and confirm that dsh-mcp-glue is enabled on the plugin page.

Install from Git repository (standard method after release):

pnpm dsh plugin --profile <profile> add 'github:<owner>/dsh-mcp-glue'
# Recommend locking to a specific commit: 'github:<owner>/dsh-mcp-glue#<sha>'

This path does not require a local build: lib/client.js is already committed to the repository. Before installing, use dsh plugin --help to check the current CLI parameters.

Link installation (suitable for modifying the plugin itself): run pnpm add link:<absolute path to this project> in the profile directory. After modifying client source code, run pnpm run build; after modifying host source code, you must restart Harness.

tgz installation: run pnpm pack in this project, then install the generated tgz from the plugin UI.

The current version in package.json is 0.3.0, license MIT. The SkillHub entry shows 0 stars; this is directory information only and does not represent a quality judgment.

Typical Configuration Example

Six hot-swappable fields can be saved via the plugin settings page, or written directly into the profile patch (the same config as the form writes):

- id: workspace-mcp-glue
  config:
    enabledBuiltins: [root, vscode, codex, cursor, gemini]
    trustMode: manual          # manual | all
    trustedWorkspaces:
      - 'D:\Data\Project\trusted-project'
    workspaceAllowances:
      - workspace: 'D:\Data\Project\other-repo'
        allowMcp: [team-tools]
        allowTools: ['mcp__team-tools__identity']
    conflictPolicy: error
    webControl: true           # when false, the management UI cannot read status

Typical workflow:

  1. Keep the MCP declaration files you already use in Cursor / VS Code / Codex, etc. in the target repository (or create a new .mcp.json, etc.).
  2. Install and enable the plugin, and check the corresponding built-in preset in Preset Management.
  3. Set the workspace to trustedWorkspaces or manually “Connect” via the MCP panel, and configure allowTools as needed.
  4. Check MCP status in the session tool row, and if necessary, use the panel “+ New / Manage” to edit declarations (targeted modifications to JSONC / YAML / TOML, preserving comments and other keys).

The panel supports editing fields by connection method (stdio / http); sse is not supported and will be blocked before writing.

Use Cases and Cautions

Who it’s for: teams or individuals who already maintain MCP configurations in their projects, want to reuse the same set of declarations in DSH, and need per-workspace connection isolation and fine-grained tool permissions.

Be aware:

  • The plugin and DSH run with the current process’s privileges; trustMode: all or trusting untrusted repositories may launch arbitrary local programs. Before installing, you should read the source code and the MIT license and assess the risks yourself.
  • Do not directly import a project’s MCP list into the profile to replace this plugin’s design; this plugin reads workspace files and does not write to a global profile.
  • The community directory SkillHub is an independent site with no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “everything is a plugin,” and this introduction is based only on the public README and package.json.

Closing

dsh-mcp-glue “wires” the common project-level MCP configuration files from various clients into DSH sessions: preset parsing, GUI management, layered trust, and a tool gate, reducing the need to maintain a duplicate global MCP list inside Harness. For detailed contracts, gates, and security boundaries, refer to the repository README and the documentation under docs/.

  • Directory page: https://www.skillhub.cn/plugins/AkotaP/dsh-mcp-glue
  • GitHub: https://github.com/AkotaP/dsh-mcp-glue
羽毛球分组比赛记分
小程序二维码

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

Xiaoye