dsh-mcp 1.15.3 → 1.16.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 +58 -0
- package/CHANGELOG.md +58 -0
- package/README.en.md +48 -4
- package/README.md +51 -3
- package/lib/client.js +928 -211
- package/lib/host-locales.js +42 -6
- package/lib/index.js +382 -30
- package/lib/oauth-server-url.js +37 -0
- package/lib/oauth.js +12 -1
- package/lib/tool-admission.js +7 -4
- package/lib/tool-assembly.js +7 -1
- package/lib/tool-search.js +106 -0
- package/package.json +2 -2
- package/scripts/build.mjs +22 -6
- package/src/client/McpIcon.tsx +20 -0
- package/src/client/McpPage.module.css +41 -0
- package/src/client/McpPage.tsx +27 -0
- package/src/client/McpSettingsSection.module.css +349 -13
- package/src/client/McpSettingsSection.tsx +495 -46
- package/src/client/ServerForm.module.css +53 -1
- package/src/client/ServerForm.tsx +107 -72
- package/src/client/index.ts +209 -11
- package/src/client/locales.ts +86 -4
- package/src/client/remote-contribution.js +69 -0
- package/src/client/types.ts +31 -0
package/CHANGELOG.en.md
CHANGED
|
@@ -12,6 +12,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
12
12
|
- **Supported DSH version**: **dsh `0.2.2-rc.3`** — the latest release is developed and verified on `0.2.2-rc.3` (declared in `package.json` → `dsh.supported`); older entries state the version verified at their time. When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
|
|
13
13
|
- **Release convention**: every version entry states `- **Supported DSH version**: dsh <version>`, mirrored in the GitHub Release notes. The release body is written in **Chinese** (matching [CHANGELOG.md](CHANGELOG.md)), with heading levels mirroring the entry.
|
|
14
14
|
|
|
15
|
+
## [1.16.0] - 2026-11-27
|
|
16
|
+
|
|
17
|
+
- **Supported DSH**: **`0.2.2-rc.3`** (developed and verified on `0.2.2-rc.5`)
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- **Choose where the page lives: sidebar / Settings / both.** The "Show in" picker at the top of the page applies immediately — the rail icon and the Settings entry are added/removed on the fly while servers, OAuth state and per-tool switches stay untouched.
|
|
22
|
+
- Default is **sidebar** (`placement: "sidebar"`): the rail icon opens the full page, with its own title, padding and scroll area.
|
|
23
|
+
- Choosing **Settings** removes the rail entry (if you are sitting on that panel it returns you to the conversation); choosing **both** keeps both entries.
|
|
24
|
+
- The choice is persisted by the Host (storage domain `mcp_ui` → table `prefs` → row `view`) and survives restarts; `config.placement` in `cordis.patch.yml` sets the first-run default.
|
|
25
|
+
- New Remote endpoints `mcpManager/uiPrefs` and `mcpManager/uiPrefsSet`, plus the `McpPage` / `McpIcon` renderers in `lib/client.js`.
|
|
26
|
+
- **Pinned (resident) tools**: pin the tools you use daily and they stay in the model's tool set even in `search` mode — no "search first" round-trip in a fresh Session. Pins are persisted in `mcp_ui` and read from an in-memory mirror each model step; **a switched-off tool never comes back just because it is pinned**.
|
|
27
|
+
- The "Pinned tools" block groups by server with content-sized chips: remove one, **unpin a whole MCP** (other servers untouched), or clear everything; "Pinned only" narrows the list.
|
|
28
|
+
- **`mcp_tool_search` upgrades**:
|
|
29
|
+
- New `server` (search within one server) and `list` (names + one-line descriptions only, token-cheap) parameters; without `query` it returns the list.
|
|
30
|
+
- **Chinese search**: queries are expanded into 2-grams (`提交代码` hits both `提交` and `代码`), instead of one opaque token that never matched.
|
|
31
|
+
- **Per-server aliases**: each server can carry its own words (e.g. `提交, MR, 评审`) which participate in scoring.
|
|
32
|
+
- **`/mcp` command** (enabled when the core provides the commands service, skipped otherwise): `/mcp` for status, `/mcp on|off <server>`, `/mcp mode search|full`, `/mcp pin|unpin <mcp__server__tool or server>`.
|
|
33
|
+
- **Bulk selection inside the tool list**: clicking a tool name (or the row's empty area) toggles whether that tool is injected; **press and drag across rows** flips them all to the state of the row you pressed on and **submits once on release**; disabled tools are struck through and dimmed.
|
|
34
|
+
- **In-list search**: filters by server name / tool name / description / aliases and expands matching cards; servers whose tool sets overlap by ≥70% are labelled "N tools overlap with X".
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- **One dirty stored record used to fail the whole plugin** (the Settings page and every `mcp__*` tool disappeared, `fiberPhase=failed`, diagnosis `stored record '…' does not match its schema`). A hand-written server row carried a value outside the schema (`origin: "user"`, where only `plugin` / `cordis` are valid); opening the domain failed validation and `Service.init` threw.
|
|
39
|
+
- Data side: the row was repaired (`origin: "user"` → `"plugin"`) with a backup at `~/.dsh/storages/mcp_servers.json.bak-originfix-*`.
|
|
40
|
+
- Code side: the new UI preferences live in their **own storage domain** `mcp_ui`; a failure there now only loses the remembered placement instead of taking the plugin down.
|
|
41
|
+
- **Style bleed from global CSS class collisions** (`.row`, `.muted`, `.panel`, `.section` reused across sheets). Every sheet is injected globally with an identity class map, so the sheet injected last silently restyled the others — the process-env editor (a four-column grid) inherited the server card's `.row` and rendered as stacked bordered boxes, and tool rows were padded out. The build now namespaces each module's classes (`<Module>__<class>`, in both the stylesheet text and the exported map) and a test forbids two sheets from defining the same selector.
|
|
42
|
+
- **Pinning failed with `outcome.pins is not iterable`**: the Remote result arrives as a carrier `{ ok, value }` and `pins` was read off the carrier. It now goes through `unwrap()` like every other call, with fallbacks when `pins` / `aliases` are missing.
|
|
43
|
+
- **"Pinned" looked lost after switching pages**: the prefs were always on disk; the page was rendering the inject snapshot taken at mount. It now re-reads the durable prefs on every mount (`prefsRead`).
|
|
44
|
+
- **The JSON editor had no visible way back**: the same button toggles it but its label never changed. It now reads **"Back to list"** while open, and "Add server" closes the panel first.
|
|
45
|
+
- **A brand-new server form looked like an error**: an empty name turned the hint red and greyed Save out. The hint now only turns red after editing or pressing Save, Save stays enabled, and pressing it with an empty name just marks the field.
|
|
46
|
+
- **Chinese copy fell back to English** (`Back to list`): `serversJsonBack` was only added to the English dictionary. Both are filled in now, and the dictionary test checks **each dictionary separately**.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
|
|
50
|
+
- **The tool catalog merged into the MCP config list**: the standalone "Tool directory" module is gone — the config list is the main line, and each card owns its tools (expand). There is exactly one tool list.
|
|
51
|
+
- **The tool list is a flow with multiple columns**: a tool no longer takes a whole row (2–3 per row on a wide panel), ordered checkbox → name → `?` (description popup) → pin.
|
|
52
|
+
- **The pin is a text button**: `Pin` (outlined) and `Pinned` (outlined blue pill), with the hit area matching what is drawn. Pin accents use a dedicated blue (`#2f6fed`) because the light theme's `brand-primary` is near-black and tinting it only produced grey.
|
|
53
|
+
- **The server editor replaces its row**: clicking Edit puts the form in the row's slot (it used to be inserted below the card, which read like two different servers); the title carries the server name; **Delete moved to the footer's far left** instead of sitting under the card's Edit button; short fields share a two-column row, switches are grouped, and the action row is sticky.
|
|
54
|
+
- **The process-env editor moved up and is one variable per line**: display location → injection mode → env → config JSON → server list.
|
|
55
|
+
- **The card's "Disable" button uses the error colour**: stopping a server removes it from the model, so it is coloured apart from ordinary actions.
|
|
56
|
+
|
|
57
|
+
### Notes
|
|
58
|
+
|
|
59
|
+
- Search hits still return the parameter schema (so they can be called directly); `list` returns names + descriptions only. The two modes are deliberately split.
|
|
60
|
+
- Aliases are keyed by `serverName`; renaming a server drops its old aliases (no migration).
|
|
61
|
+
- Not in this release: per-Session scoping and usage statistics (next batch).
|
|
62
|
+
|
|
63
|
+
## [1.15.4] - 2026-11-21
|
|
64
|
+
|
|
65
|
+
- **Supported DSH version**: **dsh `0.2.2-rc.3`**
|
|
66
|
+
|
|
67
|
+
### Fixed
|
|
68
|
+
|
|
69
|
+
- **OAuth token exchange failed: the callback rebuilt the authorization-server URL from `authorizationUrl.origin`, dropping the issuer's path (issue #27)**: `createToolAuthorizationUrlOnce()` already receives the path-bearing `info.authorizationServerUrl` from `discoverOAuthServerInfo()` (Appwrite's `https://fra.cloud.appwrite.io/v1/oauth2/console`, Keycloak's `/realms/<realm>`, …), but the token-exchange callback used `new URL(authorizationUrl.origin)`. For a path-based issuer that requests `<host>/.well-known/oauth-authorization-server`, which answers 404, so the SDK throws before sending any token request — the browser shows a successful authorization while tokens are never stored, and mount retries keep re-opening the authorization page
|
|
70
|
+
- New dependency-free `lib/oauth-server-url.js`: prefers the discovered authorization-server URL and falls back to the authorization page's origin only when no discovery result exists; the callback in `lib/oauth.js` now uses that helper
|
|
71
|
+
- New `test/oauth-server-url.test.mjs`: covers a path-based issuer (Appwrite), a string discovery result, the no-discovery fallback, and an invalid discovery result — asserting it never degrades to the origin
|
|
72
|
+
|
|
15
73
|
## [1.15.3] - 2026-11-18
|
|
16
74
|
|
|
17
75
|
- **Supported DSH version**: **dsh `0.2.2-rc.3`**
|
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,64 @@
|
|
|
12
12
|
- **支持版本**:**dsh `0.2.2-rc.3`** —— 最新版本在 `0.2.2-rc.3` 上开发与验证(`package.json` → `dsh.supported` 同步声明);历史版本条目各自声明当时验证的版本。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
|
|
13
13
|
- **发版约定**:每个版本条目都要声明 `- **支持版本**:dsh <版本>`,并在 GitHub Release notes 中同步。Release 正文用**中文**(与本文档一致),标题层级与条目一致。
|
|
14
14
|
|
|
15
|
+
## [1.16.0] - 2026-11-27
|
|
16
|
+
|
|
17
|
+
- **支持版本**:**dsh `0.2.2-rc.3`**(本版在 `0.2.2-rc.5` 上开发与实测)
|
|
18
|
+
|
|
19
|
+
### 新增
|
|
20
|
+
|
|
21
|
+
- **管理页入口可选:左侧栏 / 设置页 / 两处都显示**。页面顶部「显示位置」切换**立即生效**:左栏图标与设置页入口按选择增删,服务器配置、OAuth 授权状态与工具开关都不受影响
|
|
22
|
+
- 默认 **左侧栏**(`placement: "sidebar"`),点图标打开整页管理界面(自带标题、内边距与独立滚动区)
|
|
23
|
+
- 选「设置页」时左栏入口消失(若正停在该面板会自动回到会话);选「两者都显示」时两处并存
|
|
24
|
+
- 选择由宿主持久化(存储域 `mcp_ui` → 表 `prefs` → 行 `view`),重启保持;`cordis.patch.yml` 的 `config.placement` 可作为首启默认值
|
|
25
|
+
- 新增 Remote 端点 `mcpManager/uiPrefs`、`mcpManager/uiPrefsSet`,以及 `lib/client.js` 的 `McpPage` / `McpIcon` 渲染件
|
|
26
|
+
- **常驻工具(pin)**:把常用工具固定后,即使注入模式是 `search`,这些工具也始终出现在模型可用的工具里——新会话不必「先搜一次才能用」。固定集合持久化在 `mcp_ui`,模型每个步直接读内存镜像,不查存储;**被关掉的工具即使被固定也不会复活**
|
|
27
|
+
- 「已固定工具」区按服务器分组、只占内容的紧凑 chip,可单个取消、**按 MCP 批量取消**(不影响其它服务器),也可一次「全部取消」;「只看已固定」把列表缩到固定项
|
|
28
|
+
- **`mcp_tool_search` 检索增强**:
|
|
29
|
+
- 新增 `server`(只在一台服务器里找)与 `list`(只列名称 + 一行描述,省 token)参数;不给 `query` 时按清单返回
|
|
30
|
+
- **中文检索**:中文查询按 2-gram 展开(`提交代码` 会同时命中 `提交` 与 `代码`),不再整段当一个 token 而永远搜不到英文工具
|
|
31
|
+
- **服务器别名**:每台服务器可配一组中文/习惯词(如 `提交, MR, 评审`),参与打分
|
|
32
|
+
- **`/mcp` 命令**(核心提供 commands 服务时启用,缺省自动跳过):`/mcp` 看状态、`/mcp on|off <server>`、`/mcp mode search|full`、`/mcp pin|unpin <mcp__server__tool 或 server>`
|
|
33
|
+
- **工具行内的批量选择**:点工具名(或行内空白)即切换该工具是否注入模型;**按住拖动划过多个工具**可批量切到同一状态(以按下的那一行为准),**松开时合并提交**,不是每划过一个发一次请求;停用的工具显示删除线灰字
|
|
34
|
+
- **列表内搜索**:按服务器名 / 工具名 / 描述 / 检索别名过滤,命中自动展开对应卡片;同族服务器(工具集 ≥70% 重复)在卡片信息行标注「与 X 重复 N 个」
|
|
35
|
+
|
|
36
|
+
### 修复
|
|
37
|
+
|
|
38
|
+
- **存储里一行脏记录会把整个插件打成 `failed`**(现象:设置页 MCP 消失、所有 `mcp__*` 工具消失,`fiberPhase=failed`,诊断 `stored record '…' does not match its schema`)。根因是手工写入的服务器行带了 schema 之外的值(本次是 `origin: "user"`,合法值只有 `plugin` / `cordis`),domain 打开即校验失败、`Service.init` 抛错,整行连带页面一起挂掉
|
|
39
|
+
- 数据侧:该行已修复(`origin: "user"` → `"plugin"`),并留了 `~/.dsh/storages/mcp_servers.json.bak-originfix-*` 备份
|
|
40
|
+
- 代码侧:新的 UI 偏好放在**独立存储域** `mcp_ui`,打开失败只降级为「记不住显示位置」,不再拖垮整个插件
|
|
41
|
+
- **样式串味:CSS 类名全局冲突**(`.row` / `.muted` / `.panel` / `.section` 在多份样式表里重名)。所有样式表都是全局注入、类名映射又是恒等的,后注入的那份会直接改写前一份的布局——进程环境变量本该是「一行一个变量」的四列网格,实际继承了服务器卡片的 `.row`,于是变成一堆堆叠的带框方块,工具行也被撑高。构建期改为**每个 module 的类名加 `<Module>__<class>` 命名空间**(样式文本与导出映射同时改写),并新增测试「任意两份样式表不得定义同一选择器」防回归
|
|
42
|
+
- **点固定报 `outcome.pins is not iterable`**:Remote 返回的是载体 `{ ok, value }`,写偏好时把 `pins` 直接从载体上取再展开。现与其它调用一致走 `unwrap()` 取 `value`,并对 `pins` / `aliases` 缺失做降级;补了回归测试
|
|
43
|
+
- **切换页面回来后「已固定」看起来消失了**:偏好一直在磁盘里,是页面挂载时拿到的 inject 快照是旧的。现在每次挂载向宿主重读一次偏好(`prefsRead`),快照只用于首屏
|
|
44
|
+
- **「JSON 维护配置」打开后没有返回入口**:按钮本身是开关但文案不变。现在打开后变成**「返回列表」**;点「添加服务器」也会先关掉 JSON 面板
|
|
45
|
+
- **新建服务器一打开就报红**:名称为空时提示直接变红、保存置灰,像默认报错。现在只有编辑过或点过保存才标红,保存按钮不再因空表单置灰;空名点保存只在字段下提示
|
|
46
|
+
- **中文词条缺失导致回退英文**(`Back to list`):`serversJsonBack` 只补了英文侧。现已补齐,并把字典测试改为**逐个词典校验**(zh / en 各自都必须定义页面用到的 key)
|
|
47
|
+
|
|
48
|
+
### 变更
|
|
49
|
+
|
|
50
|
+
- **工具目录并入 MCP 配置列表**:删掉独立的「工具目录」模块——配置列表才是主线,工具的查看/开关/固定都在它自己的卡片里(「展开工具」)。工具列表只有一份
|
|
51
|
+
- **工具列表改为流式多列**:一个工具不再撑满整行,宽屏一行 2–3 个;顺序是「勾选 → 名称 → `?`(描述浮层)→ 固定」
|
|
52
|
+
- **固定控件是文字按钮**:`固定`(描边)与 `已固定`(蓝色描边胶囊),点击热区即按钮本身;固定相关的强调色用专用蓝 `#2f6fed`(亮色主题的 `brand-primary` 是近黑色,做浅底只会得到一片灰)
|
|
53
|
+
- **编辑服务器改为「就地替换」**:点「编辑」后表单占据该行位置(之前会在卡片下方再插一块,看着像两台服务器);标题带服务器名;**「删除」移到表单底栏最左**,不再正对卡片「编辑」按钮的位置;短字段两列、选项分组、保存行吸底
|
|
54
|
+
- **进程环境变量上移并改为一行一个变量**:页面顺序 显示位置 → 注入模式 → 进程环境变量 → 配置 JSON → 服务器列表
|
|
55
|
+
- **服务器卡片「禁用」用错误色**:停用一台服务器会把它从模型里摘掉,按钮标红以区分于普通操作
|
|
56
|
+
|
|
57
|
+
### 说明
|
|
58
|
+
|
|
59
|
+
- 检索结果的参数 schema 仍在命中时返回(可直接调用);`list` 模式只回名称 + 描述,两者按用途分工
|
|
60
|
+
- 别名按 `serverName` 存;服务器改名后旧别名不会再命中(按名索引,不做迁移)
|
|
61
|
+
- 本轮未做:会话级作用域与用量统计(下一批)
|
|
62
|
+
|
|
63
|
+
## [1.15.4] - 2026-11-21
|
|
64
|
+
|
|
65
|
+
- **支持版本**:**dsh `0.2.2-rc.3`**
|
|
66
|
+
|
|
67
|
+
### 修复
|
|
68
|
+
|
|
69
|
+
- **OAuth 换 token 失败:回调里用 `authorizationUrl.origin` 重建授权服务器地址,丢掉 issuer 的路径(issue #27)**:`createToolAuthorizationUrlOnce()` 已经通过 `discoverOAuthServerInfo()` 拿到带路径的 `info.authorizationServerUrl`(如 Appwrite 的 `https://fra.cloud.appwrite.io/v1/oauth2/console`、Keycloak 的 `/realms/<realm>`),但回调换 token 时改成了 `new URL(authorizationUrl.origin)`。对带路径的 issuer,这会请求 `<host>/.well-known/oauth-authorization-server` 并得到 404,SDK 在发出 token 请求之前就抛错——浏览器已显示授权成功,token 却永远不落库,挂载重试还会反复弹出授权页
|
|
70
|
+
- 新增无依赖模块 `lib/oauth-server-url.js`:优先使用发现结果中的授权服务器 URL,仅在没有任何发现结果时回退到授权页的 origin;`lib/oauth.js` 的回调改用该 helper
|
|
71
|
+
- 新增 `test/oauth-server-url.test.mjs`:覆盖带路径 issuer(Appwrite)、字符串形式的发现结果、无发现结果回退、以及非法发现结果回退,断言不会退化成 origin
|
|
72
|
+
|
|
15
73
|
## [1.15.3] - 2026-11-18
|
|
16
74
|
|
|
17
75
|
- **支持版本**:**dsh `0.2.2-rc.3`**
|
package/README.en.md
CHANGED
|
@@ -17,13 +17,20 @@
|
|
|
17
17
|
**Highlights:**
|
|
18
18
|
|
|
19
19
|
- **Visual management**: server list / create / edit / delete / test connection / enable-disable / refresh, all in the UI
|
|
20
|
+
- **Selectable entry point (1.16.0)**: the management page lives in the **left sidebar** by default (one MCP rail icon opens a full page); it can also sit back in **Settings** or in **both**. The "Show in" picker applies immediately and the Host persists it; `config.placement` sets the first-run default
|
|
20
21
|
- **Process-level environment variables**: a global key-value list (expanded by default, batch-add supported); injected into every stdio server's child process and referenced by streamable-http header values by bare name or `${NAME}`, substituted at connect time (e.g. `Authorization: Bearer ${TOKEN}`); a per-server env entry wins on collision
|
|
21
22
|
- **Whole-list JSON config**: the "JSON config editor" panel views/edits every server as one JSON array; applying saves immediately (create/update/delete)
|
|
22
|
-
- **Fine-grained tool control**:
|
|
23
|
+
- **Fine-grained tool control**: a server's tools live inside its own card (all checked by default; uncheck to drop one). Each card also carries the search aliases, and a tool row shows its full description on hover
|
|
23
24
|
- **Image result passthrough**: images returned by MCP tools (screenshots/charts) are projected through the attachment service into model image context, with strict preflight and bounded fallbacks (PR #4)
|
|
24
25
|
- **Two injection modes**: `search` (on-demand, token-saving) and `full` (inject everything)
|
|
26
|
+
- **Pinned tools (1.16.0)**: pin the tools you use daily and they stay visible even in `search` mode — no "search first" round-trip in a fresh Session, and a switched-off tool never comes back just because it is pinned
|
|
27
|
+
- **Search upgrades (1.16.0)**: `server` scoping and a `list` mode; Chinese queries match by 2-gram (`提交代码` hits `提交` / `代码`), and each server can carry its own aliases (`提交,MR,评审`)
|
|
28
|
+
- **`/mcp` command (1.16.0)**: `/mcp` for status, `on|off <server>`, `mode search|full`, `pin|unpin <tool or server>` — no browser needed
|
|
29
|
+
- **Pinning (1.16.0)**: a "Pin / Pinned" text button at the end of each tool row pins or unpins it. Pinning means **always visible**: the tool stays in the model's set even in `search` mode, so no lookup is needed. The "Pinned tools" block above the list groups pins by server and can remove one, **unpin a whole MCP**, or clear everything; "Pinned only" narrows the list
|
|
30
|
+
- **Bulk tool toggling (1.16.0)**: click a tool name to toggle whether it is injected, or **press and drag across rows** to flip a run of tools to the same state (taken from the row you pressed on); the change is submitted once on release, and disabled tools are struck through
|
|
31
|
+
- **In-list search (1.16.0)**: the box above the list filters by server / tool name / description / alias and auto-expands the matching cards; same-family servers (≥70% shared tools) are flagged on the card meta row as "shares N tools with X"
|
|
25
32
|
- **Zero npm dependencies**: plugs into DeepSeek Harness internals, install and go
|
|
26
|
-
- **OAuth authentication**: for `streamable-http` servers using MCP OAuth (authorization-code + PKCE), the server card has an **Authorize** button and the **Host opens the system browser** for the login; the page then polls the authorization status every 5 seconds. Tokens and OAuth client info are persisted in the credentials document; when the access token expires the SDK **renews it silently** with the stored refresh token (no interruption, no browser), and only a revoked/expired refresh token needs re-authorization. **Before you authorize it only says "authorizing"; a real failure reports its reason**
|
|
33
|
+
- **OAuth authentication**: for `streamable-http` servers using MCP OAuth (authorization-code + PKCE), the server card has an **Authorize** button and the **Host opens the system browser** for the login; the page then polls the authorization status every 5 seconds. Tokens and OAuth client info are persisted in the credentials document; when the access token expires the SDK **renews it silently** with the stored refresh token (no interruption, no browser), and only a revoked/expired refresh token needs re-authorization. **Before you authorize it only says "authorizing"; a real failure reports its reason**. **Path-based issuers are supported** (Appwrite's `/v1/oauth2/console`, Keycloak's `/realms/<realm>`, …): both discovery and the token exchange keep the issuer's full path instead of degrading to the site root (which makes `.well-known` answer 404 and leaves a completed authorization without stored tokens)
|
|
27
34
|
- **HTTPS verified against the system trust store by default**: intranet/corporate CAs (roots installed in the OS keychain) no longer need `NODE_OPTIONS=--use-system-ca` on `dsh web`; the plugin merges the OS store into Node's default root store at startup
|
|
28
35
|
- **Three install paths**: npm / GitHub git source / local link; bilingual UI and docs
|
|
29
36
|
|
|
@@ -41,12 +48,13 @@ Migrated and merged from uncommitted MCP work in the `deepseek-harness` reposito
|
|
|
41
48
|
- **Managed MCP server registry** (host): persistent definitions (storage-domain `mcp_servers`), per-server
|
|
42
49
|
`@deepseek-ai/dsh-mcp-client` mounts, environment variable injection (plain values in the definition, secrets via credentials),
|
|
43
50
|
connection probe (`test`).
|
|
44
|
-
- **Web
|
|
51
|
+
- **Web management page** (client): the same page can occupy the **left-sidebar panel** (default) and/or **Settings → MCP** — list / edit / delete / test servers.
|
|
52
|
+
- **Display-location preference** (host, `lib/index.js` → `uiPrefs` / `uiPrefsSet`): stored in its own domain `mcp_ui` (table `prefs`, row `view`), separate from the server definitions — a damaged preference costs at most the remembered location, never the management page. A page-level choice wins over `config.placement` in `cordis.patch.yml`.
|
|
45
53
|
- **Server-level enable/disable**: disabling a server unmounts it and unregisters its tools immediately.
|
|
46
54
|
- **Per-server refresh** button: re-pulls server status and tool list.
|
|
47
55
|
- **Tool control**:
|
|
48
56
|
- Injection mode: `search` (on-demand, default — the model hot-injects tools via `mcp_tool_search`) and `full` (inject every enabled tool each request).
|
|
49
|
-
-
|
|
57
|
+
- Per-server tools live in the tool catalog (all checked by default); unchecking a tool keeps it out of injection. Changes take effect immediately.
|
|
50
58
|
- **OAuth authentication** (host, `lib/oauth.js`): on a 401 + OAuth challenge from a `streamable-http`
|
|
51
59
|
server, runs the authorization-code + PKCE flow — receives the callback on a loopback server,
|
|
52
60
|
persists tokens, and refreshes them on demand; the settings page offers an "Authorize" button
|
|
@@ -89,6 +97,42 @@ Since 1.11.0 those declarations appear in Settings → MCP, badged "cordis decla
|
|
|
89
97
|
- **Safe degradation when the hot reload does not commit**: if the native tools have not unregistered within 5 seconds of writing the disable block (that profile's patch hot reload did not commit — a sibling entry failing its re-apply rolls the whole generation back), the plugin **registers the takeover without mounting** (the managed row is marked `pendingTakeover`); the next dsh start mounts it, and "Give back" reports the same need for a restart. A mount is also always skipped when same-named `mcp__<server>__` tools already exist without a local mount, so the plugin never fights a still-mounted declaration for one name.
|
|
90
98
|
- **Tool search covers them**: search/hot injection and per-tool switches work by `mcp__` prefix across the whole tool set, so declared tools need no extra configuration.
|
|
91
99
|
|
|
100
|
+
## Display location (left sidebar / Settings)
|
|
101
|
+
|
|
102
|
+
The page has one implementation and two seats:
|
|
103
|
+
|
|
104
|
+
| Seat | Slot | Notes |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| Left sidebar (default) | `sidebar.panellist` entry + `main` panel | Rail icon opens a full page with its own heading, padding and scroll container |
|
|
107
|
+
| Settings | `settings.section` (id `mcp`) | the classic Settings → MCP |
|
|
108
|
+
| Both | both seats registered | handy from either direction |
|
|
109
|
+
|
|
110
|
+
- **Switch in the page**: the "Show in" radios take effect immediately (entries only — server configuration is untouched) and the Host stores the choice in the `mcp_ui` domain, so it survives restarts.
|
|
111
|
+
- **First-run default** comes from `config.placement` when nothing is stored:
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
- id: dsh-mcp
|
|
115
|
+
config:
|
|
116
|
+
placement: sidebar # sidebar (default) | settings | both
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- Choosing **Settings** withdraws the rail entry; if the panel is selected at that moment the UI returns to the Conversation, so no page is left without an entry. The `main` panel itself stays registered, so a panel selection never points at a missing key.
|
|
120
|
+
|
|
121
|
+
## Search, pinned tools and `/mcp`
|
|
122
|
+
|
|
123
|
+
- **`mcp_tool_search`**: `query` searches (returns name/description/parameter schema, callable right away); `server` narrows to one server; `list: true` (or no query) returns a cheap catalog of names + one-line descriptions.
|
|
124
|
+
- **Pin**: click the pin icon left of a tool name (or `/mcp pin <tool>`); pinned tools stay resident in `search` mode, and the "Pinned tools" strip at the top of the list shows the whole set. It lives in `mcp_ui` → `prefs.pins`; the Host reads an in-memory mirror every model step.
|
|
125
|
+
- **Aliases**: each card's tool panel carries its keywords (comma separated); they join the search and are keyed by `serverName`, so renaming a server requires re-entering them.
|
|
126
|
+
- **`/mcp`**:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
/mcp status: mode / servers / tools / pins / per-server phase
|
|
130
|
+
/mcp on|off <server> enable or disable one server
|
|
131
|
+
/mcp mode search|full switch the injection mode
|
|
132
|
+
/mcp pin|unpin <mcp__s__tool> pin or unpin one tool
|
|
133
|
+
/mcp pin|unpin <server> pin or unpin a whole server
|
|
134
|
+
```
|
|
135
|
+
|
|
92
136
|
## Structure
|
|
93
137
|
|
|
94
138
|
```
|
package/README.md
CHANGED
|
@@ -19,13 +19,20 @@
|
|
|
19
19
|
**功能优势:**
|
|
20
20
|
|
|
21
21
|
- **可视化管理**:服务器列表 / 新建 / 编辑 / 删除 / 测试连接 / 启停 / 刷新,全 UI 操作
|
|
22
|
+
- **入口可选(1.16.0)**:管理页默认在**左侧栏**(一个 MCP 图标点开整页),也可放回**设置页**或**两处都显示**;页面顶部「显示位置」切换立即生效并由宿主持久化,另有 `config.placement` 作为首启默认值
|
|
22
23
|
- **进程级环境变量**:全局 KV 配置(默认展开、支持批量添加);stdio 服务器的子进程直接注入,streamable-http 服务器的请求头 value 写 `变量名` 或 `${变量名}` 即可在连接时自动替换为配置值(如 `Authorization: Bearer ${TOKEN}`);同名时服务器自身 env 优先
|
|
23
24
|
- **JSON 全量配置**:「JSON 维护配置」面板以一段 JSON 数组查看/编辑全部服务器配置,应用即保存(新增/更新/删除)
|
|
24
|
-
-
|
|
25
|
+
- **工具级精细控制**:工具就在每台服务器的卡片里(默认全选,取消勾选即不注入);卡片顶部填「检索别名」,工具行悬停可看完整描述
|
|
25
26
|
- **图片结果透传**:MCP 工具返回的图片(截图/图表等)经附件服务投影为图片引用进入模型上下文,带严格预检与有界降级文案(PR #4)
|
|
26
27
|
- **双注入模式**:`search`(按需检索,省 token)与 `full`(全量注入)
|
|
28
|
+
- **常驻工具(1.16.0)**:把常用工具 pin 住,`search` 模式下也始终可见——新会话不用再「先搜一次才能用」,且被关掉的工具不会被 pin 复活
|
|
29
|
+
- **检索增强(1.16.0)**:`mcp_tool_search` 支持 `server` 限定、`list` 清单模式;中文按 2-gram 匹配(`提交代码` 能命中 `提交`/`代码`),每台服务器可配中文别名(`提交,MR,评审`)
|
|
30
|
+
- **`/mcp` 命令(1.16.0)**:`/mcp` 看状态、`/mcp on|off <server>`、`/mcp mode search|full`、`/mcp pin|unpin <tool 或 server>`,改配置不用开页面
|
|
31
|
+
- **固定(pin)(1.16.0)**:工具行末尾的「固定 / 已固定」文字按钮,点击即固定 / 取消;固定 = **常驻可见**,`search` 模式下也始终出现在模型可用的工具里,不用再检索。列表顶部有「已固定工具」区,按服务器分组展示,可单个取消、**按 MCP 批量取消**或全部取消;「只看已固定」可把列表缩到固定项
|
|
32
|
+
- **工具批量开关(1.16.0)**:点工具名即切换该工具是否注入模型;**按住拖动划过多个工具**可批量切到同一状态(以按下的那一行为准),松开时合并提交;停用的工具显示删除线灰字
|
|
33
|
+
- **列表内搜索(1.16.0)**:列表顶部的搜索框按 服务器名 / 工具名 / 描述 / 检索别名 过滤,命中时自动展开对应卡片;同族服务器(工具集 ≥70% 重复)在卡片信息行直接标注「与 X 重复 N 个」
|
|
27
34
|
- **零 npm 依赖**:直接对接 DeepSeek Harness 内部能力,安装即用
|
|
28
|
-
- **OAuth 认证支持**:`streamable-http` 服务器若走 MCP OAuth(授权码 + PKCE),服务器卡片点「OAuth 授权」按钮,**由宿主打开系统浏览器**完成授权,本页每 5 秒轮询授权状态;token 与 client 信息持久化在凭据文档;access token 过期后由 SDK 用存储的 refresh token **静默续期**(不会打断使用、也不会再弹浏览器),只有 refresh token
|
|
35
|
+
- **OAuth 认证支持**:`streamable-http` 服务器若走 MCP OAuth(授权码 + PKCE),服务器卡片点「OAuth 授权」按钮,**由宿主打开系统浏览器**完成授权,本页每 5 秒轮询授权状态;token 与 client 信息持久化在凭据文档;access token 过期后由 SDK 用存储的 refresh token **静默续期**(不会打断使用、也不会再弹浏览器),只有 refresh token 也被吊销/过期时才需要重新授权。**授权完成前只显示「授权中」,授权失败会写明原因**。**支持 issuer 带路径的授权服务器**(如 Appwrite 的 `/v1/oauth2/console`、Keycloak 的 `/realms/<realm>`):元数据发现与换 token 都使用 issuer 的完整路径,不会退化成站点根路径(否则 `.well-known` 会 404、授权成功但 token 落不了库)
|
|
29
36
|
- **HTTPS 默认按系统证书校验**:内网/公司 CA(只装在系统钥匙串里的根证书)无需再给 `dsh web` 加 `NODE_OPTIONS=--use-system-ca`,插件启动时把系统信任库并入 Node 默认根证书库
|
|
30
37
|
- **三种安装方式**:npm / GitHub git 源 / 本地 link;中英文界面与文档
|
|
31
38
|
|
|
@@ -34,7 +41,10 @@
|
|
|
34
41
|
- **托管 MCP 服务器注册表**(host):持久化定义(storage-domain `mcp_servers`)、按服务器挂载
|
|
35
42
|
`@deepseek-ai/dsh-mcp-client` 实例、环境变量注入(明文入定义、secret 走 credentials)、
|
|
36
43
|
连接探测(test)。
|
|
37
|
-
- **Web
|
|
44
|
+
- **Web 管理页**(client):同一套页面可挂在**左侧栏面板**(默认)与/或 **Settings → MCP**,列表/编辑/删除/测试服务器。
|
|
45
|
+
- **入口位置偏好**(host,`lib/index.js` → `uiPrefs` / `uiPrefsSet`):保存于独立存储域
|
|
46
|
+
`mcp_ui`(表 `prefs`,行 `view`),与服务器定义分离——偏好数据损坏最多丢掉「记住的位置」,
|
|
47
|
+
不会连带 MCP 管理页一起起不来。页内选择优先于 `cordis.patch.yml` 的 `config.placement`。
|
|
38
48
|
- **OAuth 认证**(host,`lib/oauth.js`):`streamable-http` 服务器遇 401 + OAuth 挑战时走
|
|
39
49
|
授权码 + PKCE 流程,回环回调收码、token 持久化并按需自动刷新;设置页提供「OAuth 授权」按钮
|
|
40
50
|
(Remote `oauthStart`,浏览器由宿主用系统浏览器打开)与每 5 秒一次的 `oauthStatus` 轮询
|
|
@@ -95,6 +105,44 @@ DSH 原生支持在组合里直接声明 MCP 服务器:**一行一台**,`nam
|
|
|
95
105
|
- **tool search 覆盖**:检索/热注入与单工具开关按 `mcp__` 前缀处理整个工具集,声明式服务器的
|
|
96
106
|
工具天然纳入,无需额外配置。
|
|
97
107
|
|
|
108
|
+
## 入口位置(左侧栏 / 设置页)
|
|
109
|
+
|
|
110
|
+
管理页只有一个实现,可以挂在两个席位:
|
|
111
|
+
|
|
112
|
+
| 位置 | 席位 | 说明 |
|
|
113
|
+
|---|---|---|
|
|
114
|
+
| 左侧栏(默认) | `sidebar.panellist` 入口 + `main` 面板 | 左栏 MCP 图标,点开是整页管理界面(自带标题/内边距/滚动) |
|
|
115
|
+
| 设置页 | `settings.section`(id `mcp`) | 经典的 Settings → MCP |
|
|
116
|
+
| 两者都显示 | 两个席位同时注册 | 适合想随手可达、又习惯从设置里进的人 |
|
|
117
|
+
|
|
118
|
+
- **页内切换**:页面顶部「显示位置」单选,选完立即生效(只增删入口,不动服务器配置);
|
|
119
|
+
偏好由宿主存入存储域 `mcp_ui`,重启后保持。
|
|
120
|
+
- **首启默认值**:没有页内选择时读 `cordis.patch.yml` 的 `config.placement`:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
- id: dsh-mcp
|
|
124
|
+
config:
|
|
125
|
+
placement: sidebar # sidebar(默认)| settings | both
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
- 选到「设置页」时左栏入口消失;若此时正停在 MCP 面板,界面自动回到会话,不会留下一个
|
|
129
|
+
没有入口的页面。`main` 面板本身始终保持注册——面板选择永远不会指向一个不存在的 key。
|
|
130
|
+
|
|
131
|
+
## 检索、常驻工具与 `/mcp`
|
|
132
|
+
|
|
133
|
+
- **`mcp_tool_search`**:`query` 检索(返回名称/描述/参数 schema,可直接调用);`server` 只看一台;`list: true`(或不给 `query`)按清单返回「名称 + 一行描述」,适合先摸清有什么。
|
|
134
|
+
- **pin(常驻)**:工具行左侧图钉点一下(或 `/mcp pin`)就固定,`search` 模式也常驻可见;列表顶部「已固定工具」条能看全部固定项并单个取消。集合存在 `mcp_ui` 域的 `prefs.pins`;服务端每步读内存镜像,不走存储。
|
|
135
|
+
- **别名**:每台服务器卡片的工具区顶部可填中文/习惯词(逗号分隔,回车或失焦自动保存),参与检索打分;按 `serverName` 索引,改名后需重填。
|
|
136
|
+
- **`/mcp`**:
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
/mcp 状态:模式 / 服务器 / 工具 / 固定数 / 每台连接状态
|
|
140
|
+
/mcp on|off <server> 启停一台
|
|
141
|
+
/mcp mode search|full 切换注入模式
|
|
142
|
+
/mcp pin|unpin <mcp__s__tool> 固定/取消单个工具
|
|
143
|
+
/mcp pin|unpin <server> 整台一起固定/取消
|
|
144
|
+
```
|
|
145
|
+
|
|
98
146
|
## 结构
|
|
99
147
|
|
|
100
148
|
```
|