dsh-mcp-tools 1.0.1 → 1.0.2

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.en.md CHANGED
@@ -1,149 +1,111 @@
1
- # dsh-mcp-tools
1
+ <p align="center">
2
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/logo.png" width="72" height="72" alt="dsh-mcp-tools" />
3
+ </p>
2
4
 
3
- **The most minimal, elegant MCP tool manager for DeepSeek Harness.**
5
+ <h1 align="center">dsh-mcp-tools</h1>
4
6
 
5
- [![npm](https://img.shields.io/npm/v/dsh-mcp-tools?color=black)](https://www.npmjs.com/package/dsh-mcp-tools)
6
- [![npm downloads](https://img.shields.io/npm/dm/dsh-mcp-tools?color=black)](https://www.npmjs.com/package/dsh-mcp-tools)
7
- [![license](https://img.shields.io/badge/license-MIT-black.svg)](LICENSE)
8
- [![node](https://img.shields.io/badge/node-%3E%3D22.13-black.svg)](https://nodejs.org)
9
- [![GitHub](https://img.shields.io/badge/GitHub-hxlog%2Fdsh--mcp--tools-black?logo=github)](https://github.com/hxlog/dsh-mcp-tools)
7
+ <p align="center">
8
+ <b>The most minimal, elegant MCP tool manager for DeepSeek Harness.</b><br />
9
+ Cursor-style global MCP control: add, disable and remove MCP servers and tools freely — for MCP testing, on-demand requests and context expansion.
10
+ </p>
10
11
 
11
- [GitHub repository](https://github.com/hxlog/dsh-mcp-tools) · [npm](https://www.npmjs.com/package/dsh-mcp-tools) · [Issues](https://github.com/hxlog/dsh-mcp-tools/issues)
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools"><img src="https://img.shields.io/npm/v/dsh-mcp-tools?color=black" alt="npm version" /></a>
14
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools"><img src="https://img.shields.io/npm/dm/dsh-mcp-tools?color=black" alt="npm downloads" /></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-black.svg" alt="license" /></a>
16
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.13-black.svg" alt="node" /></a>
17
+ <a href="https://github.com/hxlog/dsh-mcp-tools"><img src="https://img.shields.io/badge/GitHub-hxlog%2Fdsh--mcp--tools-black?logo=github" alt="GitHub" /></a>
18
+ </p>
12
19
 
13
- English | [简体中文](README.md)
20
+ <p align="center">
21
+ <a href="https://github.com/hxlog/dsh-mcp-tools">GitHub</a> ·
22
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools">npm</a> ·
23
+ <a href="https://github.com/hxlog/dsh-mcp-tools/issues">Issues</a> ·
24
+ <a href="README.md">简体中文</a>
25
+ </p>
14
26
 
15
- Manage your MCP servers and toggle MCP tools on demand, inside DeepSeek Harness (Web GUI or Desktop). Disabled tools **never reach the model**: no context cost, no accidental calls.
27
+ <p align="center">
28
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-overview.png" width="70%" alt="MCP servers in Settings" />
29
+ </p>
16
30
 
17
- ![MCP servers in Settings](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-overview.png)
31
+ > All-in-one MCP server management with per-tool switches. Disabled tools **never reach the model**: no context cost, no accidental calls.
18
32
 
19
- ---
33
+ ## ✨ Features
20
34
 
21
- ## Why this exists
35
+ | Capability | Details |
36
+ | --- | --- |
37
+ | **Server management** | Two transports: `streamable-http` (URL + headers) and `stdio` (command / args / env / cwd); fill fields or paste `{"mcpServers": { ... }}` to import many at once. |
38
+ | **Postman-style secrets** | Headers are key/value rows, not a JSON textarea; a default `x-mcp-key` row is provided, values are masked and can be revealed per row, duplicate names error inline. |
39
+ | **Real per-tool control** | Every tool is a chip; disable it and it disappears from the model's tool list entirely (not "registered then errors"). Search, select all, invert, disable all — hover for the full description. |
40
+ | **Connectivity test & event log** | Temporary connection: `initialize → tools/list → close`, reporting latency / protocol version / tool count without touching the live server. The "Recent events" log records connects, reloads, tests and failures. |
41
+ | **Server toggle & config copy** | Turning a server off disconnects it and unregisters all its tools (config kept); one click copies that server's `mcpServers` snippet. |
42
+ | **Native DSH look** | Reuses `--dsw-*` design tokens, flat rows and 32px inputs; light/dark and zh/en adapt automatically. The client is a classic script — no build step. |
22
43
 
23
- MCP servers are great until a single "all-in-one" server drops 95 tools into every request. DSH's native configuration is a YAML/JSON file: editing it means restarting or recomposing the profile, and there is no way to say *"keep this server, but give the model only 12 of its tools."*
44
+ <p align="center">
45
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-add-server.png" width="48%" alt="Add server: key/value headers" />
46
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tools.png" width="48%" alt="Per-tool chips" />
47
+ </p>
24
48
 
25
- dsh-mcp-tools moves all of that into **Settings → MCP**:
49
+ ## 🚀 Install
26
50
 
27
- - add, edit, disable and delete servers without touching config files;
28
- - paste secrets as Postman-style key/value headers (headers stay on your machine);
29
- - verify connectivity and see the tool count before enabling anything;
30
- - toggle tools per server, with search, select-all, invert and disable-all.
51
+ Requires **DeepSeek Harness 0.2.x** (Web GUI `dsh web` or DSH Desktop) and **Node.js ≥ 22.13**. Available on npm: [dsh-mcp-tools](https://www.npmjs.com/package/dsh-mcp-tools).
31
52
 
32
- ---
53
+ > ⚠️ This is a **DeepSeek Harness plugin**, not a plain npm library: `npm i dsh-mcp-tools` only downloads the package — it still has to be installed into a DSH profile as below.
33
54
 
34
- ## Features
35
-
36
- ### Server management
37
-
38
- - **Two transports**: `streamable-http` (URL + headers) and `stdio` (command, args, env, cwd).
39
- - **Two ways to add**: fill in fields, or paste an `{"mcpServers": { ... }}` block — the same shape DSH and Claude Desktop use — to import several servers at once.
40
- - **Server switch**: turning a server off disconnects it and unregisters all of its tools. Nothing is deleted.
41
- - **Copy config**: one click copies that server back out as an `mcpServers` snippet.
42
-
43
- ### Secrets, the Postman way
44
-
45
- Header rows are key/value pairs, not a JSON textarea. A new server starts with an `x-mcp-key` row: paste the secret into the value column and save.
46
-
47
- ![Adding a server with key/value headers](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-add-server.png)
48
-
49
- Values are masked by default and can be revealed per row. Duplicate header names are rejected inline. Prefer JSON? Switch to **Paste JSON** — it syncs name, URL, transport and headers back into the form.
50
-
51
- ![Pasting an mcpServers JSON block](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-json-import.png)
52
-
53
- ### Real per-tool control
54
-
55
- Every tool is a chip. Click to disable; the tool disappears from the model's tool list immediately (it is not registered at all). Search, select all, invert, disable all.
56
-
57
- ![Per-tool chips](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tools.png)
58
-
59
- Hover a chip for its full description, even while the server is disabled.
60
-
61
- ![Tool description tooltip](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tooltip.png)
62
-
63
- ### Connectivity test and event log
64
-
65
- The test button opens a throwaway connection: `initialize` → `tools/list` → close. It reports latency, protocol version and tool count, and never mutates the running server. A compact event log records connects, reloads, tests and failures.
66
-
67
- ### Native fit
68
-
69
- Same design tokens (`--dsw-*`), same flat rows, same 32px inputs as DSH itself. Light and dark, Chinese and English, keyboard focus rings included. No build step: the client bundle is a classic script that only requires `react` and the official UI primitives.
70
-
71
- See it in dark mode:
72
-
73
- ![MCP manager in dark mode](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-dark.png)
74
-
75
- ![Disabled tools](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tool-toggles.png)
76
-
77
- ---
78
-
79
- ## Install
80
-
81
- Requires **DeepSeek Harness 0.2.x** (Web GUI `dsh web` or DSH Desktop) and **Node.js ≥ 22.13**. Published on npm as [dsh-mcp-tools](https://www.npmjs.com/package/dsh-mcp-tools) `1.0.1`.
82
-
83
- > ⚠️ This is a **DeepSeek Harness plugin**, not a plain npm library. `npm i dsh-mcp-tools` only downloads the package; it still has to be installed into a DSH profile as described below.
84
-
85
- ### From the Plugins page (recommended)
55
+ **From the Plugins page (recommended)**
86
56
 
87
57
  1. Open DSH Web (or DSH Desktop) → **Plugins** in the sidebar (Desktop: **Settings → Plugins**).
88
58
  2. Choose **Install**, enter `dsh-mcp-tools`, and confirm.
89
- 3. Enable the new bundle, then refresh the page once.
90
- 4. Open **Settings → MCP**.
59
+ 3. Enable the new bundle, refresh the page, then open **Settings → MCP**.
91
60
 
92
- ### From the CLI
61
+ **From the CLI**
93
62
 
94
63
  ```bash
95
64
  dsh plugin --profile web add dsh-mcp-tools # Web
96
65
  dsh plugin --profile desktop add dsh-mcp-tools # Desktop
97
66
  ```
98
67
 
99
- The command installs from npm and records the bundle in that profile's `dsh.profile.bundles`. If the Plugins page does not show it, enable the bundle once; if the section still does not appear, restart `dsh web`.
100
-
101
- > Upgrading the package requires a restart of `dsh web` (or reopening DSH Desktop) to load the new host module generation.
68
+ > Upgrading the package requires a restart of `dsh web` / reopening DSH Desktop.
102
69
 
103
- ---
70
+ ## ⚡ Quick start
104
71
 
105
- ## Quick start
72
+ 1. **Settings → MCP → Add server**: for remote servers enter the URL and paste the secret into the header row (default `x-mcp-key`).
73
+ 2. Hit **Test connection** — expect something like `connected · 95 tools · 478 ms` — then save and flip the server switch on.
74
+ 3. Let the model call the tools; DSH registers them as `mcp__<server>__<tool>`. Disable unused tools to shrink the tool schema in every request.
106
75
 
107
- 1. **Settings → MCP → Add server.**
108
- 2. For a remote server: paste its URL, then put the key in the header row (`x-mcp-key` by default).
109
- 3. Hit **Test connection** — you should see something like `Connected · 95 tools · 478 ms`.
110
- 4. Save. Enable the server if it is not on yet.
111
- 5. In a session, ask the model to use a tool. DSH registers each one as `mcp__<server>__<tool>`.
76
+ ## 🖼 More screenshots
112
77
 
113
- To trim context, open the server's tools and disable what you do not need. Fewer enabled tools means a smaller tool schema in every request.
78
+ | Dark mode | Some tools disabled |
79
+ | --- | --- |
80
+ | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-dark.png" width="100%" alt="Dark mode" /> | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tool-toggles.png" width="100%" alt="Some tools disabled" /> |
114
81
 
115
- ---
82
+ | Paste `mcpServers` JSON | Tool tooltip |
83
+ | --- | --- |
84
+ | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-json-import.png" width="100%" alt="Paste mcpServers JSON" /> | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/en/mcp-tooltip.png" width="100%" alt="Tool tooltip" /> |
116
85
 
117
- ## How it works
86
+ ## 🧩 How it works
118
87
 
119
88
  ```
120
89
  DeepSeek Harness Web (dsh web)
121
- ├── Host plugin (lib/) ← cordis bundle patch, native MCP client
122
- │ ├── manager.js connections, tool registry, enable/disable
123
- │ ├── store.js ~/.dsh/dsh-mcp-tools/state.json (atomic, watched)
124
- │ └── routes.js /mcp-tools/api/*
90
+ ├── Host plugin (lib/) ← cordis bundle patch, reuses the native MCP client
91
+ │ ├── manager.js connect, register tools, enable/disable
92
+ │ ├── store.js ~/.dsh/dsh-mcp-tools/state.json (atomic writes, watches external edits)
93
+ │ └── routes.js /mcp-tools/api/*
125
94
  └── Client bundle (client/client.js)
126
95
  └── Settings section "MCP" (id: mcp, order: 18) — classic script, no build
127
96
  ```
128
97
 
129
- - The host plugin wraps DSH's native MCP client, so tools appear in sessions exactly like hand-configured ones (`mcp__server__tool`).
130
- - Enablement is enforced at **registration** time, not on call: a disabled tool is absent from the model's tool list.
131
- - State lives in `~/.dsh/dsh-mcp-tools/state.json`, written atomically. External edits are picked up and applied live.
132
-
133
- REST surface (used by the panel, also scriptable): `GET /mcp-tools/api/state`, `POST /servers/{test,save,delete,toggle,refresh}`, `POST /tools/{toggle,bulk}`, `POST /import`, `POST /reload`, `GET /logs`. See [docs/API.md](docs/API.md).
134
-
135
- ---
98
+ - Enable/disable happens at **registration** time, not call time: disabled tools never appear in the model's tool list.
99
+ - State lives in `~/.dsh/dsh-mcp-tools/state.json`, written atomically; external edits are watched and hot-applied.
100
+ - REST API: `GET /mcp-tools/api/state`, `POST /servers/{test,save,delete,toggle,refresh}`, `POST /tools/{toggle,bulk}`, `POST /import`, `POST /reload`, `GET /logs`. See [docs/API.md](docs/API.md).
136
101
 
137
- ## Security notes
102
+ ## 🔒 Security
138
103
 
139
- - Server headers are stored **in plaintext** in the local state file. The file is yours, on your machine — do not commit it or sync it to a public location.
140
- - Use a dedicated, least-privilege key per MCP server.
141
- - The plugin makes no network calls except to the MCP servers you configure. No telemetry.
142
- - Deleting a server removes its tools from every future request.
104
+ - Headers are stored **in plain text** in the local state file — local only; never commit or sync it to a public location.
105
+ - Use a dedicated, least-privilege key for every MCP server.
106
+ - No network requests beyond the MCP servers you configure, and no telemetry; deleting a server removes its tools from subsequent requests.
143
107
 
144
- ---
145
-
146
- ## Development
108
+ ## 🛠 Development
147
109
 
148
110
  ```bash
149
111
  git clone https://github.com/hxlog/dsh-mcp-tools.git
@@ -152,36 +114,28 @@ node --check client/client.js
152
114
  npm run selftest
153
115
  ```
154
116
 
155
- For live development, link the checkout into your profile instead of installing a copy (Windows example):
117
+ Link the source tree into a profile instead of installing a copy (Windows example):
156
118
 
157
119
  ```bat
158
120
  rmdir "C:\Users\<you>\.dsh\profiles\web\node_modules\dsh-mcp-tools"
159
121
  mklink /J "C:\Users\<you>\.dsh\profiles\web\node_modules\dsh-mcp-tools" "D:\path\to\dsh-mcp-tools"
160
122
  ```
161
123
 
162
- - **Client changes**: refresh the page. The bundle is served from disk, no build involved.
163
- - **Host changes**: touch the profile's `cordis.patch.yml` (e.g. append a comment) to trigger HMR recomposition; the log line `MCP manager started` confirms it.
164
-
165
- The panel is written as a single classic script because DSH's Web loader evaluates client bundles as classic scripts. Only `react` and `@deepseek-ai/dsh-client-ui-primitives` may be required.
166
-
167
- ---
168
-
169
- ## FAQ
170
-
171
- **The MCP section is missing.** The bundle is probably not enabled. Check Plugins → the bundle, refresh, and restart `dsh web` if needed.
172
-
173
- **Tools do not show up in a session.** Make sure the server is enabled and the individual tool chips are on. Disabled tools are never registered.
174
-
175
- **Test connection fails.** Verify the URL, that the server speaks `streamable-http` (not plain SSE), and that the header name matches what the server expects. Network/proxy issues surface here too.
176
-
177
- **Where is the state?** `~/.dsh/dsh-mcp-tools/state.json`. Deleting it resets everything to empty; the plugin recreates it on next launch.
124
+ - **Client changes**: just refresh the page; the bundle is served from disk, no build.
125
+ - **Host changes**: touch the profile's `cordis.patch.yml` (e.g. append a comment) to trigger HMR; once the log shows `MCP 管理器已启动` it is active.
126
+ - The panel is a single classic script and may only `require` `react` and `@deepseek-ai/dsh-client-ui-primitives`.
178
127
 
179
- ---
128
+ ## ❓ FAQ
180
129
 
181
- ## License
130
+ | Question | Answer |
131
+ | --- | --- |
132
+ | No MCP section in Settings | The bundle is probably not enabled — confirm on the Plugins page, refresh, restart `dsh web` if needed. |
133
+ | Tools missing in a session | Make sure the server switch is on and the tool chips are enabled; disabled tools are never registered. |
134
+ | Connection test fails | Check the URL, that the server speaks `streamable-http` (not plain SSE), and the header names; network/proxy problems surface here too. |
135
+ | Where is the state file? | `~/.dsh/dsh-mcp-tools/state.json`; delete it to reset to empty — it is recreated on next start. |
182
136
 
183
- [MIT](LICENSE)
137
+ ## 📄 License
184
138
 
185
- ---
139
+ [MIT](LICENSE) · Powered by [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
186
140
 
187
141
  [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
package/README.md CHANGED
@@ -1,151 +1,112 @@
1
- # dsh-mcp-tools
1
+ <p align="center">
2
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/logo.png" width="72" height="72" alt="dsh-mcp-tools" />
3
+ </p>
2
4
 
3
- **DeepSeek Harness 最简洁、优雅的MCP工具管理器。**
5
+ <h1 align="center">dsh-mcp-tools</h1>
4
6
 
5
- [![npm](https://img.shields.io/npm/v/dsh-mcp-tools?color=black)](https://www.npmjs.com/package/dsh-mcp-tools)
6
- [![npm downloads](https://img.shields.io/npm/dm/dsh-mcp-tools?color=black)](https://www.npmjs.com/package/dsh-mcp-tools)
7
- [![license](https://img.shields.io/badge/license-MIT-black.svg)](LICENSE)
8
- [![node](https://img.shields.io/badge/node-%3E%3D22.13-black.svg)](https://nodejs.org)
9
- [![GitHub](https://img.shields.io/badge/GitHub-hxlog%2Fdsh--mcp--tools-black?logo=github)](https://github.com/hxlog/dsh-mcp-tools)
7
+ <p align="center">
8
+ <b>DeepSeek Harness 简洁、优雅的 MCP 工具管理器。</b><br />
9
+ 类 Cursor 风格的全局 MCP 控制:自由添加、停用、删除 MCP 接口与工具,适合 MCP 测试、按需请求、拓展上下文等场景。
10
+ </p>
10
11
 
11
- [GitHub 仓库](https://github.com/hxlog/dsh-mcp-tools) · [npm](https://www.npmjs.com/package/dsh-mcp-tools) · [问题反馈](https://github.com/hxlog/dsh-mcp-tools/issues)
12
+ <p align="center">
13
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools"><img src="https://img.shields.io/npm/v/dsh-mcp-tools?color=black" alt="npm version" /></a>
14
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools"><img src="https://img.shields.io/npm/dm/dsh-mcp-tools?color=black" alt="npm downloads" /></a>
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-black.svg" alt="license" /></a>
16
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D22.13-black.svg" alt="node" /></a>
17
+ <a href="https://github.com/hxlog/dsh-mcp-tools"><img src="https://img.shields.io/badge/GitHub-hxlog%2Fdsh--mcp--tools-black?logo=github" alt="GitHub" /></a>
18
+ </p>
12
19
 
13
- [English](README.en.md) | 简体中文
20
+ <p align="center">
21
+ <a href="https://github.com/hxlog/dsh-mcp-tools">GitHub 仓库</a> ·
22
+ <a href="https://www.npmjs.com/package/dsh-mcp-tools">npm</a> ·
23
+ <a href="https://github.com/hxlog/dsh-mcp-tools/issues">问题反馈</a> ·
24
+ <a href="README.en.md">English</a>
25
+ </p>
14
26
 
15
- 管理用户的 MCP Server,按需开关 MCP Tools。被停用的工具**不会注册进模型**,既不占上下文,也无法被误调用。
27
+ <p align="center">
28
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-overview.png" width="49%" alt="设置服务器" />
29
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-detail.png" width="49%" alt="MCP 工具详情" />
30
+ </p>
16
31
 
17
- ![设置中的 MCP 服务器](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-overview.png)
32
+ > 一站式管理用户的 MCP Server,按需开关 MCP Tools。被停用的 MCP 工具**不会注册进模型**,既不占上下文,也无法被误调用。
18
33
 
19
- ---
34
+ ## ✨ 功能
20
35
 
21
- ## 为什么做这个
36
+ | 能力 | 说明 |
37
+ | --- | --- |
38
+ | **服务器管理** | 两种传输:`streamable-http`(URL + 请求头)与 `stdio`(命令 / 参数 / 环境变量 / 工作目录);分字段填写,或直接粘贴 `{"mcpServers": { ... }}` 一次导入多个。 |
39
+ | **像 Postman 一样填密钥** | 请求头是键值对行而不是 JSON 文本框,默认带一行 `x-mcp-key`;值默认掩码、可逐行显示;名称重复就地报错。 |
40
+ | **真正的逐工具控制** | 每个工具是一个 chip,点击即从模型工具列表消失(不是注册了再报错);支持搜索 / 全选 / 反选 / 全部停用,悬停查看完整描述。 |
41
+ | **连通性测试与事件日志** | 临时建连 `initialize → tools/list → 关闭`,回报耗时 / 协议版本 / 工具数,不影响运行中的服务器;「最近事件」记录连接、重载、测试与失败。 |
42
+ | **服务器开关与配置复制** | 关闭服务器即断开并注销其全部工具(不删配置);一键复制该服务器的 `mcpServers` 片段。 |
43
+ | **与 DSH 原生一致** | 沿用 `--dsw-*` 设计 token、平铺行与 32px 输入框,深浅色 / 中英文自适应;客户端是 classic script,无构建步骤。 |
22
44
 
23
- MCP 很好用,直到某个「全家桶」服务器把 95 个工具塞进每一次请求。DSH 原生配置是 YAML/JSON 文件:改一次要重组 profile 甚至重启,而且没法表达「保留这个服务器,但只给模型 12 个工具」。
45
+ <p align="center">
46
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-add-server.png" width="48%" alt="添加服务器:键值对请求头" />
47
+ <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tools.png" width="48%" alt="逐工具 chip" />
48
+ </p>
24
49
 
25
- dsh-mcp-tools 把这些搬进了 **设置 → MCP**:
50
+ ## 🚀 安装
26
51
 
27
- - 增删改停服务器,不碰配置文件;
28
- - 请求头按 Postman 的方式一行一个键值对,密钥只留在本机;
29
- - 启用前先验证连通性和工具数量;
30
- - 按服务器逐工具开关,支持搜索、全选、反选、全部停用。
52
+ 需要 **DeepSeek Harness 0.2.x**(Web GUI `dsh web` 或 DSH Desktop)与 **Node.js ≥ 22.13**,包已发布到 npm:[dsh-mcp-tools](https://www.npmjs.com/package/dsh-mcp-tools)。
31
53
 
32
- ---
54
+ > ⚠️ 这是 **DeepSeek Harness 插件**,不是普通 npm 依赖库:`npm i dsh-mcp-tools` 只会下载包,运行时仍需装进 DSH profile。
33
55
 
34
- ## 功能
35
-
36
- ### 服务器管理
37
-
38
- - **两种传输**:`streamable-http`(URL + 请求头)与 `stdio`(命令、参数、环境变量、工作目录)。
39
- - **两种录入**:分字段填写,或直接粘贴 `{"mcpServers": { ... }}`(与 DSH 原生配置同格式),一次导入多个服务器。
40
- - **服务器开关**:关闭即断开连接并注销该服务器全部工具,不会删除配置。
41
- - **复制配置**:一键复制该服务器的 `mcpServers` 片段。
42
-
43
- ### 像 Postman 一样填密钥
44
-
45
- 请求头是键值对行,而不是 JSON 文本框。新服务器默认带一行 `x-mcp-key`,把密钥粘进「值」即可保存。
46
-
47
- ![添加服务器:键值对请求头](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-add-server.png)
48
-
49
- 值默认掩码显示,可逐行切换显示;名称重复会就地报错。也可以切到「粘贴 JSON」——解析后会把名称、URL、传输方式和请求头同步回表单。
50
-
51
- ![粘贴 mcpServers JSON](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-json-import.png)
52
-
53
- ### 真正的逐工具控制
54
-
55
- 每个工具是一个 chip。点击即停用,工具会立刻从模型工具列表中消失(不是注册了再报错)。支持搜索、全选、反选、全部停用。
56
-
57
- ![逐工具 chip](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tools.png)
58
-
59
- 悬停 chip 可查看完整描述,服务器停用时也能看。
60
-
61
- ![工具描述 tooltip](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tooltip.png)
62
-
63
- ### 连通性测试与事件日志
64
-
65
- 测试按钮会临时建连:`initialize` → `tools/list` → 关闭,回报耗时、协议版本与工具数量,不改动正在运行的服务器。下方「最近事件」记录连接、重载、测试与失败。
66
-
67
- ### 与 DSH 原生一致
68
-
69
- 沿用 `--dsw-*` 设计 token、平铺行、32px 输入框,深浅色与中英文自适应,键盘焦点环完整。客户端没有构建步骤:它是 classic script,只依赖 `react` 与官方 UI primitives。
70
-
71
- 深色模式:
72
-
73
- ![深色模式](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-dark.png)
74
-
75
- 停用部分工具:
76
-
77
- ![停用工具](https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tool-toggles.png)
78
-
79
- ---
80
-
81
- ## 安装
82
-
83
- 需要 **DeepSeek Harness 0.2.x**(Web GUI `dsh web` 或 DSH Desktop)与 **Node.js ≥ 22.13**。包已发布到 npm:[dsh-mcp-tools](https://www.npmjs.com/package/dsh-mcp-tools) `1.0.1`。
84
-
85
- > ⚠️ 这是一个 **DeepSeek Harness 插件**,不是普通 npm 依赖库。`npm i dsh-mcp-tools` 只会下载包,运行时仍要通过下面的方式装进 DSH profile。
86
-
87
- ### 通过插件页安装(推荐)
56
+ **通过插件页安装(推荐)**
88
57
 
89
58
  1. 打开 DSH Web(或 DSH Desktop)→ 侧边栏 **插件**(Desktop 在 **设置 → 插件**)。
90
59
  2. 点击安装,填入 `dsh-mcp-tools`,确认。
91
- 3. 启用新 bundle,然后刷新一次页面。
92
- 4. 打开 **设置 → MCP**。
60
+ 3. 启用新 bundle,刷新页面,打开 **设置 → MCP**。
93
61
 
94
- ### 通过命令行安装
62
+ **通过命令行安装**
95
63
 
96
64
  ```bash
97
65
  dsh plugin --profile web add dsh-mcp-tools # Web
98
66
  dsh plugin --profile desktop add dsh-mcp-tools # Desktop
99
67
  ```
100
68
 
101
- 命令会从 npm 安装并写入该 profile 的 `dsh.profile.bundles`。若插件页未出现,启用一次该 bundle;分区仍未出现就重启 `dsh web`。
69
+ > 升级包版本后需要重启 `dsh web` / 重启 DSH Desktop。
102
70
 
103
- > 升级包版本后需要重启 `dsh web` / 重开 DSH Desktop,才会加载新的 host 模块。
71
+ ## ⚡ 快速开始
104
72
 
105
- ---
73
+ 1. **设置 → MCP → 添加服务器**:远程服务器填 URL,把密钥粘贴进请求头行(默认 `x-mcp-key`)。
74
+ 2. 点 **测试连接**,看到类似 `已连接 · 95 个工具 · 478 ms` 后保存,并打开服务器开关。
75
+ 3. 在会话中直接让模型调用工具,DSH 会注册为 `mcp__<服务器>__<工具>`;用不到的工具展开列表停用即可,启用的工具越少,每次请求里的 tool schema 越小。
106
76
 
107
- ## 快速开始
77
+ ## 🖼 更多界面
108
78
 
109
- 1. **设置 → MCP → 添加服务器**。
110
- 2. 远程服务器:填 URL,把密钥粘贴进请求头行(默认 `x-mcp-key`)。
111
- 3. 点 **测试连接**,应看到类似 `已连接 · 95 个工具 · 478 ms`。
112
- 4. 保存,并打开服务器开关。
113
- 5. 在会话中直接让模型调用工具。DSH 会把它注册为 `mcp__<服务器>__<工具>`。
79
+ | 深色模式 | 停用部分工具 |
80
+ | --- | --- |
81
+ | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-dark.png" width="100%" alt="深色模式" /> | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tool-toggles.png" width="100%" alt="停用部分工具" /> |
114
82
 
115
- 想省上下文,就展开工具列表,把用不到的停用。启用的工具越少,每次请求里的工具 schema 越小。
83
+ | 粘贴 mcpServers JSON | 工具描述 tooltip |
84
+ | --- | --- |
85
+ | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-json-import.png" width="100%" alt="粘贴 mcpServers JSON" /> | <img src="https://cdn.jsdelivr.net/gh/hxlog/dsh-mcp-tools@main/docs/screenshots/zh/mcp-tooltip.png" width="100%" alt="工具描述 tooltip" /> |
116
86
 
117
- ---
118
-
119
- ## 工作原理
87
+ ## 🧩 工作原理
120
88
 
121
89
  ```
122
90
  DeepSeek Harness Web (dsh web)
123
- ├── Host 插件(lib/) ← cordis bundle patch,复用原生 MCP 客户端
124
- │ ├── manager.js 连接、工具注册、启停
125
- │ ├── store.js ~/.dsh/dsh-mcp-tools/state.json(原子写、监听外部修改)
126
- │ └── routes.js /mcp-tools/api/*
91
+ ├── Host 插件(lib/) ← cordis bundle patch,复用原生 MCP 客户端
92
+ │ ├── manager.js 连接、工具注册、启停
93
+ │ ├── store.js ~/.dsh/dsh-mcp-tools/state.json(原子写、监听外部修改)
94
+ │ └── routes.js /mcp-tools/api/*
127
95
  └── 客户端 bundle(client/client.js)
128
96
  └── 设置分区「MCP」(id: mcp,order: 18)—— classic script,无需构建
129
97
  ```
130
98
 
131
- - Host 插件包装 DSH 原生 MCP 客户端,工具与会话的接入方式与手写配置完全一致(`mcp__服务器__工具`)。
132
99
  - 启停生效于**注册时**而非调用时:停用的工具根本不出现在模型工具列表里。
133
- - 状态在 `~/.dsh/dsh-mcp-tools/state.json`,原子写入;外部修改会被监听并热应用。
134
-
135
- REST 接口(面板在用,也可脚本调用):`GET /mcp-tools/api/state`、`POST /servers/{test,save,delete,toggle,refresh}`、`POST /tools/{toggle,bulk}`、`POST /import`、`POST /reload`、`GET /logs`。详见 [docs/API.md](docs/API.md)。
100
+ - 状态存于 `~/.dsh/dsh-mcp-tools/state.json`,原子写入;外部修改会被监听并热应用。
101
+ - REST 接口:`GET /mcp-tools/api/state`、`POST /servers/{test,save,delete,toggle,refresh}`、`POST /tools/{toggle,bulk}`、`POST /import`、`POST /reload`、`GET /logs`;详见 [docs/API.md](docs/API.md)。
136
102
 
137
- ---
103
+ ## 🔒 安全说明
138
104
 
139
- ## 安全说明
140
-
141
- - 服务器请求头以**明文**保存在本地状态文件里。文件只在本机,请不要提交到仓库或同步到公开位置。
105
+ - 请求头以**明文**保存在本地状态文件里,只在本机——不要提交到仓库或同步到公开位置。
142
106
  - 给每个 MCP 服务器使用独立、最小权限的密钥。
143
- - 插件除你配置的 MCP 服务器外不发起任何网络请求,没有遥测。
144
- - 删除服务器后,它的工具会从后续所有请求中移除。
145
-
146
- ---
107
+ - 除你配置的 MCP 服务器外不发起任何网络请求,没有遥测;删除服务器后它的工具会从后续所有请求中移除。
147
108
 
148
- ## 开发
109
+ ## 🛠 开发
149
110
 
150
111
  ```bash
151
112
  git clone https://github.com/hxlog/dsh-mcp-tools.git
@@ -154,36 +115,28 @@ node --check client/client.js
154
115
  npm run selftest
155
116
  ```
156
117
 
157
- 调试时把源码目录链接进 profile,而不是安装副本(Windows 示例):
118
+ 把源码目录链接进 profile 调试(Windows 示例):
158
119
 
159
120
  ```bat
160
121
  rmdir "C:\Users\<你>\.dsh\profiles\web\node_modules\dsh-mcp-tools"
161
122
  mklink /J "C:\Users\<你>\.dsh\profiles\web\node_modules\dsh-mcp-tools" "D:\path\to\dsh-mcp-tools"
162
123
  ```
163
124
 
164
- - **客户端改动**:刷新页面。bundle 直接从磁盘提供,无构建。
165
- - **Host 改动**:修改一次 profile 的 `cordis.patch.yml`(例如追加一行注释)触发 HMR 重组;日志出现 `MCP 管理器已启动` 即生效。
166
-
167
- 面板是单个 classic script,因为 DSH Web loader 以 classic script 方式执行客户端 bundle。只能 require `react` 与 `@deepseek-ai/dsh-client-ui-primitives`。
168
-
169
- ---
170
-
171
- ## 常见问题
172
-
173
- **设置里没有 MCP 分区。** 多半是 bundle 未启用:去插件页确认并刷新页面,必要时重启 `dsh web`。
174
-
175
- **会话里看不到工具。** 确认服务器开关已打开、对应工具 chip 也是启用状态;停用的工具不会被注册。
176
-
177
- **测试连接失败。** 检查 URL、服务器是否使用 `streamable-http`(而非普通 SSE)、请求头名称是否与服务端要求一致;网络/代理问题也会在这里暴露。
178
-
179
- **状态文件在哪?** `~/.dsh/dsh-mcp-tools/state.json`。删除即重置为空,下次启动会自动重建。
125
+ - **客户端改动**:刷新页面即可,bundle 直接从磁盘提供,无构建。
126
+ - **Host 改动**:改一次 profile 的 `cordis.patch.yml`(例如追加一行注释)触发 HMR 重组,日志出现 `MCP 管理器已启动` 即生效。
127
+ - 面板是单个 classic script,只能 `require` `react` 与 `@deepseek-ai/dsh-client-ui-primitives`。
180
128
 
181
- ---
129
+ ## ❓ 常见问题
182
130
 
183
- ## License
131
+ | 问题 | 处理 |
132
+ | --- | --- |
133
+ | 设置里没有 MCP 分区 | 多半是 bundle 未启用:插件页确认并刷新,必要时重启 `dsh web`。 |
134
+ | 会话里看不到工具 | 确认服务器开关已打开、对应工具 chip 也已启用;停用的工具不会被注册。 |
135
+ | 测试连接失败 | 检查 URL、服务器是否使用 `streamable-http`(而非普通 SSE)、请求头名称是否与服务端要求一致;网络 / 代理问题也会在这里暴露。 |
136
+ | 状态文件在哪 | `~/.dsh/dsh-mcp-tools/state.json`;删除即重置为空,下次启动自动重建。 |
184
137
 
185
- [MIT](LICENSE)
138
+ ## 📄 License
186
139
 
187
- ---
140
+ [MIT](LICENSE) · Powered by [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
188
141
 
189
142
  [![](https://img.shields.io/badge/powered_by-dsh-4D6BFE?style=flat-square&logo=deepseek&logoColor=white)](https://github.com/deepseek-ai/deepseek-harness)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp-tools",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "Manage your MCP servers and toggle MCP tools on demand inside DeepSeek Harness settings",
6
6
  "icon": "icon.svg",
package/scripts/smoke.mjs CHANGED
@@ -63,8 +63,8 @@ check('README screenshots exist (zh primary + en)', () => {
63
63
  })
64
64
  check('Chinese README is the npm/GitHub landing page', () => {
65
65
  const text = read('README.md')
66
- assert(text.includes('DeepSeek Harness 最简洁'), 'tagline missing from README.md')
67
- assert(text.includes('[English](README.en.md)'), 'language switch missing from README.md')
66
+ assert(text.includes('DeepSeek Harness 简洁'), 'tagline missing from README.md')
67
+ assert(text.includes('README.en.md'), 'language switch missing from README.md')
68
68
  })
69
69
  check('npm files whitelist contains runtime paths', () => {
70
70
  for (const entry of ['lib', 'client/client.js', 'locale', 'cordis.patch.yml', 'icon.svg', 'README.md', 'README.en.md', 'LICENSE']) {