zsvd
dsh-mcp-manager
用于DSH的MCP管理器
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 17, 2026
- Updated
- Aug 17, 2026
Introduction
dsh-mcp-manager
Manage MCP servers from the DSH (DeepSeek Harness) Web settings panel — add, edit and delete
@deepseek-ai/dsh-mcp-clientservers with live connection status, all hot-reloaded with no process restart.在 DSH Web 设置面板里管理 MCP 服务器:增删改
@deepseek-ai/dsh-mcp-client服务器并显示实时连接状态,保存即热重载,无需重启。
Features
- Settings entry — a new page in Settings → MCP 服务, at the same level as General / Models / Plugins (
settings.section, idmcp-manager). - Full CRUD — add, edit and delete MCP servers through a simple form (stdio or streamable-http, command/args/cwd/env/url/headers).
- Live connection status — each row shows whether the server actually registered tools (
mcp__<server>__<tool>present in the tool runtime) and how many; refresh on demand with the button next to the title, plus a 30s poll. - No restart needed — edits rewrite the profile's
cordis.patch.yml, which the host watches through Cordis HMR and re-applies transactionally;dsh-mcp-clientreconnects in place. - YAML-safe — the writer quotes reserved YAML indicators (
-y,@pkg/name, …) so the generated patch always parses in the loader's dialect; other patch content is preserved.
Install
Requires a DSH Web profile (e.g. the default web). Two steps: install the package as a dependency, then add one row to the profile's patch layer.
# $DSH_HOME/profiles/web/cordis.patch.yml
- insert:
- id: mcp-manager
name: dsh-mcp-manager
# optional: manage another profile's patch layer
# config:
# targetProfile: tui
cd "$HOME/.dsh/profiles/web" # or your profile dir
pnpm add dsh-mcp-manager # when published to npm
# or, from this repo:
pnpm add "file:../dsh-mcp-manager" # or the built .tgz
Restart dsh web (or wait for the user-patch HMR to pick up the row), refresh the browser, and the MCP 服务 page appears in Settings.
To remove: drop the dependency and delete the patch row.
The managed servers are the
@deepseek-ai/dsh-mcp-clientrows inside the samecordis.patch.yml— there is no separate store. The manager only rewrites its own mcp-client rows and leaves everything else in the file untouched.
Settings page
| Column | Meaning |
|---|---|
| Server | serverName + config id |
| Status | 🟢 Connected · N (N = tools registered) / ⚪ Disconnected (hover for details) |
| Env | env key names (values visible in Edit) |
| Actions | Edit (opens the full form: transport, command/args/cwd/env or url/headers) · Delete (with confirm) |
The Refresh button next to the title re-reads the list and re-probes every server's connection immediately.
HTTP API (same origin)
| Method | Path | Description |
|---|---|---|
| GET | /mcp-manager/servers | List servers + connection status (connected, toolCount) |
| POST | /mcp-manager/servers | Upsert one server (JSON body; id present → update) |
| DELETE | /mcp-manager/servers/:id | Remove one server |
Writes are serialized through a single queue, so concurrent edits cannot interleave.
Architecture
- Host half (
src/host/index.js) — dependency-free plain ESM (the loader passes its own ctx; importing cordis would break plugin identity). Parses/rewrites the profile patch layer with a small purpose-built YAML subset parser and serves the HTTP API. Connection probing readsctx.tools.schemas()for themcp__<serverName>__prefix. - Browser half (
src/client/, bundled tolib/client.jsby tsdown) — registers the Settings page and calls the same-origin API. - Default profile is
web; override with the plugin row'sconfig.targetProfile.
Build & verify (maintainers)
pnpm install
pnpm run typecheck
pnpm run build # tsdown → lib/client.js, copy-host.mjs → lib/index.js
pnpm run verify # host YAML round-trip + client bundle vm smoke test
pnpm pack # build a publishable .tgz (prepack runs the checks)
pnpm publish runs prepack automatically (typecheck → build → verify) before packing.
中文说明
功能
- 设置入口:设置 → MCP 服务,与「通用设置 / 模型 / 插件」同级。
- 完整增删改:表单支持 stdio / streamable-http,可配 command / args / cwd / env / url / headers。
- 实时连接状态:每行显示该服务器是否已注册工具(
mcp__<服务器>__<工具>是否存在于工具运行时)及工具数量;标题旁「刷新」按钮立即重测,另有 30s 轮询。 - 无需重启:改动写入 profile 的
cordis.patch.yml,宿主通过 Cordis HMR 事务性热重载,dsh-mcp-client原地重连。 - YAML 安全:
-y、@包名等 YAML 保留指示符自动加引号,生成内容保证 loader 方言可解析,且保留文件里其它 patch 内容。
安装
- 在 profile 目录安装依赖(npm 发布后
pnpm add dsh-mcp-manager,或本地pnpm add file:<路径>/dsh-mcp-manager-0.1.0.tgz)。 - 在
$DSH_HOME/profiles/web/cordis.patch.yml加一行:
- insert:
- id: mcp-manager
name: dsh-mcp-manager
- 重启
dsh web(或等 HMR 热挂载),刷新浏览器即可在设置里看到入口。
说明
- 被管理的服务器就是同一份
cordis.patch.yml里的@deepseek-ai/dsh-mcp-client行,无独立存储;管理器只重写自己的 mcp-client 行。 - 默认管理
webprofile 的 patch 层,可在插件行config.targetProfile改。 - 在 Windows 上用
npx启动某些 MCP 服务器(如@modelcontextprotocol/server-filesystem)可能失败(npm 配置警告 + cmd bin 解析),建议改用直接命令或 streamable-http。
License
MIT