@moon16u/dsh-plugin-mcp-console 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -28
- package/README.zh-CN.md +54 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
# @moon16u/dsh-plugin-mcp-console
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** | [中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The **MCP server console** for the DSH (DeepSeek Harness) web GUI: add, edit,
|
|
6
|
+
enable/disable, reconnect and delete MCP servers from the settings page, with
|
|
7
|
+
live status and tool lists, mcpServers JSON import, and automatic migration of
|
|
8
|
+
profile-YAML MCP entries.
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
**Zero MCP protocol code** — connections, reconnect backoff, tool
|
|
11
|
+
discovery/registration, `mcp__<server>__<tool>` naming and image bridging all
|
|
12
|
+
belong to the official `@deepseek-ai/dsh-mcp-client`; this plugin is only
|
|
13
|
+
"config storage + lifecycle orchestration + HTTP API + GUI".
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
8
16
|
|
|
9
17
|
```bash
|
|
10
|
-
#
|
|
18
|
+
# Recommended: the whole pouch bundle (this plugin ships inside it)
|
|
11
19
|
dsh plugin --profile web add @moon16u/dsh-pouch
|
|
12
|
-
#
|
|
20
|
+
# Or standalone:
|
|
13
21
|
dsh plugin --profile web add @moon16u/dsh-plugin-mcp-console
|
|
14
22
|
```
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
**Restart `dsh web` once** after installing (bundle layers compose at startup).
|
|
25
|
+
Then open DSH Web → bottom-left Settings → **"MCP servers"**.
|
|
17
26
|
|
|
18
|
-
##
|
|
27
|
+
## Capabilities
|
|
19
28
|
|
|
20
|
-
|
|
|
29
|
+
| Capability | Description |
|
|
21
30
|
|---|---|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
| JSON
|
|
26
|
-
| Auto-
|
|
27
|
-
| YAML
|
|
31
|
+
| Server management | Add (stdio / streamable-http forms), edit, delete, enable/disable, reconnect; config changes take effect immediately, no DSH restart |
|
|
32
|
+
| Per-tool switches | Expand a server card and click tool pills to toggle individual tools; disabled tools are denied at execution time by a guard |
|
|
33
|
+
| Live status | running / connecting / starting / disabled / failed grading; SSE push updates, tool counts in real time |
|
|
34
|
+
| JSON import | Paste Claude / Cursor style `mcpServers` JSON, preview, import; existing names skipped and reported |
|
|
35
|
+
| Auto-ingest | MCP entries written into `cordis.patch.yml` by external agents/scripts are migrated into dynamic management on boot and on "Sync config & refresh status" (store persists before the YAML is trimmed — configuration is never lost) |
|
|
36
|
+
| YAML export | `POST /api/dsh-mcp-console/export-yaml` restores dynamic config as standard `cordis.patch.yml` entries (uninstall/backup reversibility) |
|
|
28
37
|
|
|
29
|
-
##
|
|
38
|
+
## Config storage
|
|
30
39
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
40
|
+
- Dynamic config: `~/.dsh/dsh-mcp.json` (versioned JSON, atomic writes: temp file + rename; deletions are explicit user intent, no backup files are kept)
|
|
41
|
+
- Profile layer: `~/.dsh/profiles/web/cordis.patch.yml` (the ingest engine touches only mcp-client entries; other entries and comments are preserved verbatim)
|
|
33
42
|
|
|
34
|
-
## HTTP API
|
|
43
|
+
## HTTP API (loopback-only, prefix `/api/dsh-mcp-console/`)
|
|
35
44
|
|
|
36
|
-
`GET /health` · `GET/POST /servers` · `PATCH/DELETE /servers/:name` · `POST /servers/:name/enable|disable|reconnect` · `POST /refresh
|
|
45
|
+
`GET /health` · `GET/POST /servers` · `PATCH/DELETE /servers/:name` · `POST /servers/:name/enable|disable|reconnect` · `POST /refresh` (ingest YAML + retry failed) · `POST /import` · `POST /export-yaml` · `GET /events` (SSE) · `GET/PUT /config` (UI config)
|
|
37
46
|
|
|
38
|
-
##
|
|
47
|
+
## Known limitations (honest wording)
|
|
39
48
|
|
|
40
|
-
1.
|
|
41
|
-
2.
|
|
42
|
-
3.
|
|
43
|
-
4. **rc
|
|
49
|
+
1. **Connection-level status**: the official client exposes no structured connection events, so "connecting" vs "reconnecting, attempt N" cannot be distinguished; the status model is "fiber lifecycle + tool prefix count".
|
|
50
|
+
2. **Per-tool disable exposure**: `tools.restrict()` requires an agent scope in dsh-tools (context-global restriction is explicitly forbidden), so a disabled tool still appears in the model's tool list — but its calls are denied by the guard with a clear reason.
|
|
51
|
+
3. **First-migration boot race**: with small probability the loader and the ingest engine assemble the same serverName during boot; the loader-side fiber logs one duplicate error (harmless — the YAML is already trimmed, so it does not recur on the next boot).
|
|
52
|
+
4. **rc-version coupling**: depends on cordis/webserver/tools contracts of the official packages; all official-package coupling is isolated in `clientAdapter.js` (the official client is resolved dynamically from the profile's module graph, sharing the loader's module instance) and `routes.js`.
|
|
44
53
|
|
|
45
|
-
##
|
|
54
|
+
## Development
|
|
46
55
|
|
|
47
56
|
```bash
|
|
48
|
-
pnpm --filter @moon16u/dsh-plugin-mcp-console test #
|
|
49
|
-
node scripts/sync-root-client.mjs #
|
|
57
|
+
pnpm --filter @moon16u/dsh-plugin-mcp-console test # 43 tests
|
|
58
|
+
node scripts/sync-root-client.mjs # after editing lib/client.js, sync into the pouch root bundle
|
|
50
59
|
```
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
The marked section inside `lib/client.js` is kept identical to the dsh-pouch
|
|
62
|
+
root `lib/client.js` by the sync script; tests pin it against drift.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
[MIT](../../LICENSE)
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @moon16u/dsh-plugin-mcp-console
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | **中文**
|
|
4
|
+
|
|
5
|
+
DSH(DeepSeek Harness)Web GUI 的 **MCP 服务器管理控制台**:在设置页里增删改查、启停、重连 MCP 服务器,实时状态与工具列表,`mcpServers` JSON 一键导入,profile YAML 自动吸纳与回写。
|
|
6
|
+
|
|
7
|
+
**不实现任何 MCP 协议代码**——连接、重连退避、工具发现/注册、`mcp__<server>__<tool>` 命名、图片桥接全部由官方 `@deepseek-ai/dsh-mcp-client` 完成;本插件只做「配置存储 + 生命周期编排 + HTTP API + GUI」。
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# dsh-pouch 已装则跳过(本包随 pouch bundle 分发)
|
|
13
|
+
dsh plugin --profile web add @moon16u/dsh-pouch
|
|
14
|
+
# 独立安装(发布后):
|
|
15
|
+
dsh plugin --profile web add @moon16u/dsh-plugin-mcp-console
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
安装后**重启一次 `dsh web`**(bundle 层只在启动时组合)。之后打开 DSH Web → 左下角设置 → **「MCP 服务器」**。
|
|
19
|
+
|
|
20
|
+
## 能力
|
|
21
|
+
|
|
22
|
+
| 能力 | 说明 |
|
|
23
|
+
|---|---|
|
|
24
|
+
| 服务器管理 | 新增(stdio / streamable-http 双模式表单)、编辑、删除、启停、重连;改配置即时生效,无需重启 dsh(删除即用户意志,不留备份文件) |
|
|
25
|
+
| 工具级开关 | 展开服务器卡片,点击工具胶囊单独启停;禁用的工具调用会被执行期 guard 拒绝 |
|
|
26
|
+
| 实时状态 | 运行中/连接中/启动中/已停用/失败 分级;SSE 推送刷新,工具数实时联动 |
|
|
27
|
+
| JSON 导入 | 粘贴 Claude / Cursor 风格 `mcpServers` JSON,预览后导入,同名跳过并报告 |
|
|
28
|
+
| Auto-Ingest | 外部 agent / 脚本按官方推荐写入 `cordis.patch.yml` 的 MCP 条目,在启动与「同步配置并刷新状态」时自动移入动态管理(store 持久化成功才修剪 YAML,绝不丢配置) |
|
|
29
|
+
| YAML 回写 | `POST /api/dsh-mcp-console/export-yaml` 把动态配置一键还原为标准 `cordis.patch.yml` 条目(卸载/备份可逆) |
|
|
30
|
+
|
|
31
|
+
## 配置存储
|
|
32
|
+
|
|
33
|
+
- 动态配置:`~/.dsh/dsh-mcp.json`(版本化 JSON,原子写:临时文件 + rename,不产生备份文件)
|
|
34
|
+
- profile 层:`~/.dsh/profiles/web/cordis.patch.yml`(ingest 引擎只动其中的 mcp-client 条目,其余条目与注释原样保留)
|
|
35
|
+
|
|
36
|
+
## HTTP API(loopback-only,前缀 `/api/dsh-mcp-console/`)
|
|
37
|
+
|
|
38
|
+
`GET /health` · `GET/POST /servers` · `PATCH/DELETE /servers/:name` · `POST /servers/:name/enable|disable|reconnect` · `POST /refresh`(吸纳 YAML + 重试失败)· `POST /import` · `POST /export-yaml` · `GET /events`(SSE)· `GET/PUT /config`(UI 配置)
|
|
39
|
+
|
|
40
|
+
## 已知限制(诚实口径)
|
|
41
|
+
|
|
42
|
+
1. **连接级状态**:官方 client 未暴露结构化连接事件,「连接中」与「重连中第 N 次」不可区分;状态口径为「fiber 装载态 + 工具前缀计数」。
|
|
43
|
+
2. **工具级禁用的暴露面**:`tools.restrict()` 在 dsh-tools 中要求 agent-scope(全局限制被明确禁止),故被禁用的工具仍出现在模型工具列表中,但调用被 guard 拒绝并在结果中说明。
|
|
44
|
+
3. **首次迁移的启动竞态**:极小概率下 boot 期 loader 与 ingest 引擎同时装配同一 serverName,loader 侧 fiber 会报一次 duplicate 错误(无害,下次启动 YAML 已修剪,不再复现)。
|
|
45
|
+
4. **rc 版本耦合**:依赖官方包的 cordis/webserver/tools 契约,收敛在 `clientAdapter.js`(动态解析 profile 里的官方 client,与 loader 共享同一模块实例)与 `routes.js`。
|
|
46
|
+
|
|
47
|
+
## 开发
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pnpm --filter @moon16u/dsh-plugin-mcp-console test # 42 个测试
|
|
51
|
+
node scripts/sync-root-client.mjs # 改 lib/client.js 后同步进 dsh-pouch 根 bundle
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
包内 `lib/client.js` 与 dsh-pouch 根 `lib/client.js` 中的标记段由同步脚本保持一致,测试锁定防漂移。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moon16u/dsh-plugin-mcp-console",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Web GUI console for MCP servers: manages the official @deepseek-ai/dsh-mcp-client at runtime — add/edit/enable/disable/reconnect/delete servers, live status, mcpServers JSON import. No MCP protocol code: connection and tool registration are 100% the official client, resolved from the running DSH profile.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|