dsh-mcp 1.0.0
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/CHANGELOG.en.md +29 -0
- package/CHANGELOG.md +29 -0
- package/LICENSE +21 -0
- package/README.en.md +106 -0
- package/README.md +89 -0
- package/lib/client.js +15820 -0
- package/lib/index.js +894 -0
- package/lib/probe.js +53 -0
- package/lib/transport.js +25 -0
- package/package.json +47 -0
- package/scripts/build.mjs +144 -0
- package/src/client/McpSettingsSection.module.css +236 -0
- package/src/client/McpSettingsSection.tsx +351 -0
- package/src/client/ServerForm.module.css +196 -0
- package/src/client/ServerForm.tsx +301 -0
- package/src/client/ToolControlSection.module.css +100 -0
- package/src/client/ToolControlSection.tsx +137 -0
- package/src/client/index.ts +160 -0
- package/src/client/locales.ts +152 -0
- package/src/client/mcp-store.ts +249 -0
- package/src/client/remote-contribution.js +339 -0
- package/src/client/types.ts +124 -0
- package/src/css-modules.d.ts +6 -0
- package/static/snapshot.webp +0 -0
package/CHANGELOG.en.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
**[简体中文](CHANGELOG.zh.md) | English**
|
|
4
|
+
|
|
5
|
+
All notable changes to this project are documented in this file.
|
|
6
|
+
|
|
7
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
8
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - 2026-08-15
|
|
11
|
+
|
|
12
|
+
First stable release.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Managed MCP server registry** (host half, `lib/index.js`):
|
|
17
|
+
- Persistent server definitions (storage-domain `mcp_servers`)
|
|
18
|
+
- Per-server `@deepseek-ai/dsh-mcp-client` mounts; tools registered as `mcp__<serverName>__<tool>`
|
|
19
|
+
- Environment variable injection (plain values in the definition, secrets via the credentials document)
|
|
20
|
+
- Connection probe (`test`)
|
|
21
|
+
- **Web settings page** (client half, `src/client/*`):
|
|
22
|
+
- Settings → MCP: server list / create / edit / delete / test connection
|
|
23
|
+
- Server-level enable/disable (tools unregister immediately when disabled)
|
|
24
|
+
- Per-server refresh button (re-pulls server status and tool list)
|
|
25
|
+
- **Tool control**:
|
|
26
|
+
- Injection modes: `search` (on-demand, default — the model hot-injects tools via `mcp_tool_search`) and `full` (inject every enabled tool each request)
|
|
27
|
+
- Expandable per-server tool list, all checked by default; unchecking a tool keeps it out of injection, applied immediately
|
|
28
|
+
- **Remote self-mount**: the client half mounts the `mcpManager` Remote namespace itself via `ctx.remote.$mount()` in `apply()`, so no in-box package modification is required
|
|
29
|
+
- Zero npm runtime dependencies (`@deepseek-ai/*` resolve from the DSH profiles module fallback)
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# 更新日志(Changelog)
|
|
2
|
+
|
|
3
|
+
**[English](CHANGELOG.en.md) | 简体中文**
|
|
4
|
+
|
|
5
|
+
本项目的所有重要变更都会记录在此文件中。
|
|
6
|
+
|
|
7
|
+
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),
|
|
8
|
+
版本号遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - 2026-08-15
|
|
11
|
+
|
|
12
|
+
首个正式版本。
|
|
13
|
+
|
|
14
|
+
### 新增
|
|
15
|
+
|
|
16
|
+
- **MCP 服务器托管**(host 半部,`lib/index.js`):
|
|
17
|
+
- 持久化服务器注册表(storage-domain `mcp_servers`)
|
|
18
|
+
- 按服务器挂载 `@deepseek-ai/dsh-mcp-client` 实例,工具以 `mcp__<serverName>__<tool>` 注册
|
|
19
|
+
- 环境变量注入(明文入定义、secret 走凭据文档)
|
|
20
|
+
- 连接探测(test)
|
|
21
|
+
- **Web 设置管理页**(client 半部,`src/client/*`):
|
|
22
|
+
- Settings → MCP:服务器列表 / 新建 / 编辑 / 删除 / 测试连接
|
|
23
|
+
- 服务器级启用 / 禁用(禁用后工具即时注销)
|
|
24
|
+
- 每服务器刷新按钮(重新拉取服务器状态与工具列表)
|
|
25
|
+
- **工具控制**:
|
|
26
|
+
- 注入模式:`search`(按需检索,默认,模型通过 `mcp_tool_search` 热注入)与 `full`(全量注入)
|
|
27
|
+
- 每服务器展开工具列表,默认全选,可取消勾选指定加载部分工具,立即生效
|
|
28
|
+
- **Remote 自挂载**:client 半部在 `apply()` 内自行 `ctx.remote.$mount()` 挂载 `mcpManager` 命名空间,无需任何 in-box 包改动
|
|
29
|
+
- 零 npm 运行时依赖(`@deepseek-ai/*` 从 DSH profiles 模块解析)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Arvin.qi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# dsh-mcp — MCP server management plugin for DeepSeek Harness (standalone)
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
Migrated and merged from uncommitted MCP work in the `deepseek-harness` repository:
|
|
6
|
+
|
|
7
|
+
| Original package | Migrated to |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `packages/mcp/mcp-manager` (host registry) | `lib/index.js` (host half) |
|
|
10
|
+
| `packages/client/ui-settings-mcp` (settings UI) | `src/client/*` → `lib/client.js` (browser half) |
|
|
11
|
+
| `packages/bundle/web-mcp` (bundle assembly) | single row registered via `cordis.patch.yml` |
|
|
12
|
+
| `packages/mcp/mcp-client/src/probe.ts` + `transport.ts` | `lib/probe.js` + `lib/transport.js` (vendored; no in-box changes) |
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **Managed MCP server registry** (host): persistent definitions (storage-domain `mcp_servers`), per-server
|
|
17
|
+
`@deepseek-ai/dsh-mcp-client` mounts, environment variable injection (plain values in the definition, secrets via credentials),
|
|
18
|
+
connection probe (`test`).
|
|
19
|
+
- **Web settings page** (client): Settings → MCP — list / edit / delete / test servers.
|
|
20
|
+
- **Server-level enable/disable**: disabling a server unmounts it and unregisters its tools immediately.
|
|
21
|
+
- **Per-server refresh** button: re-pulls server status and tool list.
|
|
22
|
+
- **Tool control**:
|
|
23
|
+
- Injection mode: `search` (on-demand, default — the model hot-injects tools via `mcp_tool_search`) and `full` (inject every enabled tool each request).
|
|
24
|
+
- Expandable per-server tool list, all checked by default; unchecking a tool keeps it out of injection. Changes take effect immediately.
|
|
25
|
+
- **Remote self-mount**: the client half mounts the `mcpManager` Remote namespace itself via `ctx.remote.$mount()` in `apply()`,
|
|
26
|
+
so no in-box package modification is required.
|
|
27
|
+
- Zero npm runtime dependencies (`@deepseek-ai/*` resolve from the DSH profiles module fallback).
|
|
28
|
+
|
|
29
|
+
## Structure
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
dsh-mcp/
|
|
33
|
+
├── package.json name=dsh-mcp; dsh.client declaration; zero npm dependencies
|
|
34
|
+
├── lib/
|
|
35
|
+
│ ├── index.js host half (McpManagerService, built from mcp-manager)
|
|
36
|
+
│ ├── probe.js vendored connection probe (from mcp-client/src/probe.ts)
|
|
37
|
+
│ ├── transport.js vendored transport factory (from mcp-client/src/transport.ts)
|
|
38
|
+
│ └── client.js browser half (esbuild bundle, ModuleLoader wire format)
|
|
39
|
+
├── src/client/ browser half source (TSX + CSS Modules + local types + remote-contribution)
|
|
40
|
+
└── scripts/build.mjs build script (esbuild resolved from a DSH checkout, see below)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Build
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
node scripts/build.mjs
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- esbuild is resolved from a DSH source checkout: `$DSH_SOURCE`, or `~/.dsh/source/current` when unset.
|
|
50
|
+
- Runtime dependencies (`@deepseek-ai/*`, `zod`, `@modelcontextprotocol/sdk`) are not installed as npm packages;
|
|
51
|
+
they resolve from `$DSH_HOME/profiles/node_modules` (DSH profiles module fallback, `$DSH_HOME` defaults to `~/.dsh`);
|
|
52
|
+
the build points `nodePaths` at the same directory.
|
|
53
|
+
- CSS Modules are handled by an esbuild onLoad plugin: styles are injected into a
|
|
54
|
+
`<style data-plugin="dsh-mcp" data-file="…">` tag, and the module default-exports an identity class-name map.
|
|
55
|
+
|
|
56
|
+
## Install
|
|
57
|
+
|
|
58
|
+
### Option 1: npm (after publishing)
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
dsh plugin --profile web add dsh-mcp
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Option 2: GitHub git source
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
dsh plugin --profile web add github:ArvinQi/dsh-mcp
|
|
68
|
+
# or
|
|
69
|
+
dsh plugin --profile web add git+https://github.com/ArvinQi/dsh-mcp.git
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Option 3: local development (link)
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
dsh plugin --profile web add link:<absolute path to this repo>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> Note: with a local `link:` install, the plugin directory needs a `node_modules -> $DSH_HOME/profiles/node_modules`
|
|
79
|
+
> symlink (development-only, not committed); otherwise the linked symlink is realpath-resolved and `@deepseek-ai/*`
|
|
80
|
+
> cannot be resolved.
|
|
81
|
+
|
|
82
|
+
### Registration (all install options)
|
|
83
|
+
|
|
84
|
+
Append to `$DSH_HOME/profiles/web/cordis.patch.yml` (`$DSH_HOME` defaults to `~/.dsh`):
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
- insert:
|
|
88
|
+
- id: dsh-mcp
|
|
89
|
+
name: dsh-mcp
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then **restart `dsh web`** (client roster changes require a restart); afterwards hard-refresh the browser
|
|
93
|
+
(`Cmd/Ctrl + Shift + R`) to load the settings page.
|
|
94
|
+
|
|
95
|
+
## Versioning notes
|
|
96
|
+
|
|
97
|
+
- The host half `lib/index.js` is a **build artifact** of mcp-manager (spec/types inlined); edit the lib files
|
|
98
|
+
directly, or rebuild from TypeScript with the repository toolchain.
|
|
99
|
+
- After changing `src/client/*`, re-run `node scripts/build.mjs`; host-half changes take effect without
|
|
100
|
+
reinstalling (link install).
|
|
101
|
+
- Configuration changes (bundle additions/removals, new plugin rows) require restarting `dsh web` to enter
|
|
102
|
+
the client roster.
|
|
103
|
+
|
|
104
|
+
## Changelog
|
|
105
|
+
|
|
106
|
+
See [CHANGELOG.md](CHANGELOG.md). Released under the [MIT License](LICENSE).
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# dsh-mcp — MCP 服务器管理插件(独立版)
|
|
2
|
+
|
|
3
|
+
**[English](README.en.md) | 简体中文**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## 功能
|
|
8
|
+
|
|
9
|
+
- **托管 MCP 服务器注册表**(host):持久化定义(storage-domain `mcp_servers`)、按服务器挂载
|
|
10
|
+
`@deepseek-ai/dsh-mcp-client` 实例、环境变量注入(明文入定义、secret 走 credentials)、
|
|
11
|
+
连接探测(test)。
|
|
12
|
+
- **Web 设置管理页**(client):Settings → MCP,列表/编辑/删除/测试服务器。
|
|
13
|
+
- **Remote 自挂载**:client 半部在 `apply()` 里自行 `ctx.remote.$mount()` 挂载 `mcpManager`
|
|
14
|
+
命名空间(原实现依赖 api-remotes 的 in-box 修改,独立版不再需要任何 in-box 包改动)。
|
|
15
|
+
|
|
16
|
+
## 结构
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
dsh-mcp/
|
|
20
|
+
├── package.json name=dsh-mcp;dsh.client 声明;零 npm dependencies
|
|
21
|
+
├── lib/
|
|
22
|
+
│ ├── index.js host 半部(McpManagerService,源自 mcp-manager 构建产物)
|
|
23
|
+
│ ├── probe.js vendored 连接探测(源自 mcp-client/src/probe.ts)
|
|
24
|
+
│ ├── transport.js vendored 传输工厂(源自 mcp-client/src/transport.ts)
|
|
25
|
+
│ └── client.js 浏览器半部(esbuild 打包,ModuleLoader wire format)
|
|
26
|
+
├── src/client/ 浏览器半部源码(TSX + CSS Modules + 本地 types + remote-contribution)
|
|
27
|
+
└── scripts/build.mjs 构建脚本(esbuild 取自 DSH checkout,见下)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 构建
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
node scripts/build.mjs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- esbuild 从 DSH 源码 checkout 解析:`$DSH_SOURCE` 未设置时尝试
|
|
37
|
+
`~/.dsh/source/current`。
|
|
38
|
+
- 运行时依赖(`@deepseek-ai/*`、`zod`、`@modelcontextprotocol/sdk`)不装 npm 包,
|
|
39
|
+
从 `$DSH_HOME/profiles/node_modules`(DSH profiles 模块 fallback,`$DSH_HOME` 默认 `~/.dsh`)解析;构建时经
|
|
40
|
+
`nodePaths` 指向同一目录。
|
|
41
|
+
- CSS Modules 由 esbuild onLoad 插件处理:样式注入
|
|
42
|
+
`<style data-plugin="dsh-mcp" data-file="…">`,默认导出 identity 类名映射。
|
|
43
|
+
|
|
44
|
+
## 安装
|
|
45
|
+
|
|
46
|
+
### 方式一:npm(发布到 npm 后)
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
dsh plugin --profile web add dsh-mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 方式二:GitHub git 源
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
dsh plugin --profile web add github:ArvinQi/dsh-mcp
|
|
56
|
+
# 或
|
|
57
|
+
dsh plugin --profile web add git+https://github.com/ArvinQi/dsh-mcp.git
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 方式三:本地开发(link)
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
dsh plugin --profile web add link:<本仓库绝对路径>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> 注意:本地 `link:` 安装时,插件目录内含 `node_modules -> $DSH_HOME/profiles/node_modules`
|
|
67
|
+
> symlink(本机开发用,不入库),否则 `link:` 安装的 symlink 被 realpath 后无法解析
|
|
68
|
+
> `@deepseek-ai/*`。
|
|
69
|
+
|
|
70
|
+
### 注册与生效(三种方式通用)
|
|
71
|
+
|
|
72
|
+
在 `$DSH_HOME/profiles/web/cordis.patch.yml`(`$DSH_HOME` 默认 `~/.dsh`)追加:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
- insert:
|
|
76
|
+
- id: dsh-mcp
|
|
77
|
+
name: dsh-mcp
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
然后**重启 `dsh web`**(client roster 变更需重启);之后浏览器硬刷新(`Cmd/Ctrl + Shift + R`)
|
|
81
|
+
加载设置页。
|
|
82
|
+
|
|
83
|
+
## 版本注意
|
|
84
|
+
|
|
85
|
+
- host 半部 `lib/index.js` 是 mcp-manager 的**构建产物**(spec/types 已内联),改动请直接编辑
|
|
86
|
+
lib 下文件,或改回 TS 后重新用仓库工具链构建。
|
|
87
|
+
- 浏览器半部改 `src/client/*` 后重新 `node scripts/build.mjs`;host 半部改动无需重装
|
|
88
|
+
(link 安装直接生效)。
|
|
89
|
+
- 配置变更(bundles 增删、新插件行)需重启 `dsh web` 才进入 client roster。
|