dsh-mcp-manager
Manage Model Context Protocol servers inside DeepSeek Harness (DSH) from the Web UI:
- Settings → MCP servers: list, add, edit, remove, enable/disable and test servers.
- Composer
+menu → MCP servers: turn any server on or off for the current session only.
Every configured server is mounted as a real @deepseek-ai/dsh-mcp-client instance, so its tools (mcp__<name>__<tool>), resources, and server instructions behave exactly like a hand-written MCP row in the profile.
Install
Requires a DSH build with the plugin system, e.g. DSH 0.2.1-rc.2 desktop.
- Clone or copy this directory somewhere stable.
- Install it as a profile bundle: Plugins → Add plugin → local directory, or the plugin manager tool's
install_bundlewith this folder's absolute path. - Keep the folder: a local-directory install is linked, not copied.
Use
Servers
| Field | Notes |
|---|---|
| Name | Becomes the tool namespace mcp__<name>__<tool>. Letters, digits, _, -, max 32. |
| Transport | stdio for a local program, streamable-http for a remote service. |
| Command / arguments / working directory | stdio only; one argument per line. |
| Environment | stdio only; KEY=VALUE per line. Values may use ${ENV_VAR}. |
| URL / headers | streamable-http only; headers are Name: Value per line, ${ENV_VAR} allowed. |
| Enabled | Off means no connection and no tools. |
Changes are staged as a draft and applied with Save. The host reconciles immediately: removed or edited servers are disconnected, new ones are connected.
Test mounts the server in an isolated scope and reports the tool count and names without touching the live tool list. ${ENV_VAR} references are expanded from the harness process environment; a missing variable fails that server with a clear message.
Servers that already exist as MCP rows in the profile (for example a mcp-anysearch row) are listed read-only under From the profile; their tools still participate in per-session switches.
Per-session switches
Open the composer's + menu (the same menu as / commands) and pick MCP servers. The same popup area that held the menu now shows the server list with tool counts and a switch per server:
- off → that server's tools are hidden from the agent (
tools.restrictdeny) and itsmcp:<name>prompt section is dropped for this session; - on → both come back.
Click outside or press Escape to close it, exactly like the command menu.
The state is a durable per-session plugin record (plugin:mcp-manager/toggles), so it survives reload and does not leak into other sessions. Subagents start with every server enabled.
How it works
- The host row owns one volatile
serversconfig.applymounts one child@deepseek-ai/dsh-mcp-clientplugin per enabled server withctx.plugin(...), so Cordis owns connection lifetime and disposal. system-prompt/assembleremovesmcp:<name>sections for servers the session switched off.agent/created,agent/disposedandtools/changekeep per-agent tool restrictions in sync; restrictions are recomputed as MCP tools appear or disappear.- The browser half talks to a small same-origin JSON API (
/dsh-mcp-manager/api/...) for status, tests, and session switches, renders its manager page as asettings.sectionpage (Settings → MCP servers), and contributes a/mcpcommand whose action opens an overlay panel inconversation.input.overlay— the same anchor the composer popup menus use. It is unauthenticated like every other route on the loopback Web server — do not expose this host beyond loopback.
Compatibility and risk
- Developed against DSH 0.2.1-rc.2. It relies on plugin-facing APIs (
ctx.plugin,tools.restrict,system-prompt/assemble,appendPluginRecord) that are not a public compatibility promise. - A stdio server command runs with the harness process's environment. Only add servers you trust.
- Tool hiding is per session and per agent; it is not a security boundary against the model calling a tool through another provider.
- Removing a server does not delete anything it wrote; it only disconnects it.
Development
node --test test/model.test.mjs
lib/model.js is pure: server normalization, ${VAR} expansion, MCP tool-name mapping, and the dsh-mcp-client config builder, all testable without a harness.
License
MIT.
No comments yet. Be the first to write one.