dsh-mcp 1.11.1 → 1.12.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 CHANGED
@@ -9,9 +9,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ## Compatibility
11
11
 
12
- - **Supported DSH version**: **dsh `0.1.5-rc.1`** — developed and verified on `0.1.5-rc.1` (declared in `package.json` → `dsh.supported`). When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check the `cordis.patch.yml` row → restart `dsh web` → hard-refresh → upgrade both sides).
12
+ - **Supported DSH version**: **dsh `0.1.6-alpha.2`** — developed and verified on `0.1.6-alpha.2` (declared in `package.json` → `dsh.supported`). When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check the `cordis.patch.yml` row → 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.
14
14
 
15
+ ## [1.12.0] - 2026-09-18
16
+
17
+ - **Supported DSH version**: **dsh `0.1.6-alpha.2`**
18
+
19
+ ### Changed
20
+
21
+ - **Migrated to the official split MCP SDK 2.0 packages**: since DSH `0.1.6-alpha.1`, the in-box `dsh-mcp-client` derives from `@modelcontextprotocol/{client,server,node}@2.0.0` instead of the monolithic `@modelcontextprotocol/sdk@1.x`, and the old package is no longer a DSH dependency. This plugin migrates with it (`lib/transport.js`, `lib/probe.js`, `lib/mcp-client.js`, `lib/oauth.js`) and declares `@modelcontextprotocol/client@2.0.0` and `zod@^4.2.0` explicitly in `package.json` instead of relying on the host profile's dependency hoisting — without this, DSH `0.1.6-alpha.1` fails the plugin load with `ERR_MODULE_NOT_FOUND: Cannot find package '@modelcontextprotocol/sdk'`, taking the Settings page and tool search down with it
22
+ - **Adapted to two breaking changes in SDK 2.0**: `Client` options no longer accept `authProvider` (the OAuth provider now travels on the **transport**; this plugin's `createTransport` already reads `config.authProvider` and passes it to the transport, so the OAuth flow is unchanged), and `setNotificationHandler`'s first argument is now a **method name** rather than a schema, so the tool-list-changed notification registers as `notifications/tools/list_changed`
23
+ - **Result schemas now come from the new package's `specTypeSchemas`**: `ListToolsResultSchema` → `specTypeSchemas.ListToolsResult`; `ToolListChangedNotificationSchema` is no longer needed since notifications register by method name
24
+ - **Regenerated the client half for the Typert `create()` contract**: the `@deepseek-ai/dsh-typert-generator` output in `src/client/remote-contribution.js` carried only `schema: TypertSchema`, but since DSH `0.1.6-alpha.1` that field is `create: () => TypertSchema` and the registry calls it unconditionally (`record.value ??= record.create()`) — so the Settings page's Remote descriptors threw `create is not a function` on mount and the whole MCP settings page failed. Regenerated with the current generator (all 21 strict descriptors now carry `create`) and rebuilt `lib/client.js` to match. This stayed hidden because the long-running host had been on `0.1.5-rc.1` since Sep 14, whose contract was still `schema`
25
+
26
+ ### Fixed
27
+
28
+ - **The "do not open a browser from a tool call" OAuth guard works again**: `startConnection`'s `opts` never carried `url` or `authProvider`, so the branch that should return an authorization link when a stored token is missing or expired never ran — the SDK opened a browser mid-tool-call instead (a single session could open several tabs). `opts` now carries both fields, restoring the documented behavior
29
+
15
30
  ## [1.11.1] - 2026-09-13
16
31
 
17
32
  ### Fixed
package/CHANGELOG.md CHANGED
@@ -9,9 +9,24 @@
9
9
 
10
10
  ## 兼容性
11
11
 
12
- - **支持版本**:**dsh `0.1.5-rc.1`** —— 本插件在 `0.1.5-rc.1` 上开发与验证(`package.json` → `dsh.supported` 同步声明)。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 `cordis.patch.yml` 注册行 → 重启 `dsh web` → 硬刷新 → 同步升级)。
12
+ - **支持版本**:**dsh `0.1.6-alpha.2`** —— 本插件在 `0.1.6-alpha.2` 上开发与验证(`package.json` → `dsh.supported` 同步声明)。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 `cordis.patch.yml` 注册行 → 重启 `dsh web` → 硬刷新 → 同步升级)。
13
13
  - **发版约定**:每个版本条目都要声明 `- **支持版本**:dsh <版本>`,并在 GitHub Release notes 中同步。
14
14
 
15
+ ## [1.12.0] - 2026-09-18
16
+
17
+ - **支持版本**:**dsh `0.1.6-alpha.2`**
18
+
19
+ ### 变更
20
+
21
+ - **迁移到官方 MCP SDK 2.0 拆分包**:DSH `0.1.6-alpha.1` 起,框架内的 `dsh-mcp-client` 已从单体包 `@modelcontextprotocol/sdk@1.x` 迁到 `@modelcontextprotocol/{client,server,node}@2.0.0`,旧包不再是 DSH 的依赖。本插件同步迁移 `lib/transport.js`、`lib/probe.js`、`lib/mcp-client.js`、`lib/oauth.js`,并在 `package.json` 显式声明 `@modelcontextprotocol/client@2.0.0` 与 `zod@^4.2.0`,不再依赖宿主 profile 的依赖提升——否则在 DSH `0.1.6-alpha.1` 上会以 `ERR_MODULE_NOT_FOUND: Cannot find package '@modelcontextprotocol/sdk'` 加载失败,设置页与 tool search 一并不可用
22
+ - **适配 SDK 2.0 的两处破坏性变更**:其一,`Client` 选项不再接受 `authProvider`,OAuth provider 改由 **transport** 携带(本插件的 `createTransport` 一直从 `config.authProvider` 读取并传给 transport,因此 OAuth 流程行为不变);其二,`setNotificationHandler` 的第一个参数由 schema 改为**方法名**,工具列表变更通知改用 `notifications/tools/list_changed`
23
+ - **结果 schema 改从新包的 `specTypeSchemas` 取**:`ListToolsResultSchema` → `specTypeSchemas.ListToolsResult`;`ToolListChangedNotificationSchema` 不再需要(通知按方法名注册)
24
+ - **重新生成客户端半以适配 Typert `create()` 契约**:`@deepseek-ai/dsh-typert-generator` 生成的 `src/client/remote-contribution.js` 此前只携带 `schema: TypertSchema`,而 DSH 自 `0.1.6-alpha.1` 起把该字段改成 `create: () => TypertSchema`,registry 以 `record.value ??= record.create()` **无条件调用**它——于是设置页的 Remote 描述符在挂载时抛 `create is not a function`,整块 MCP 设置页失效。现已用当前生成器重新生成(21 个 strict 描述符全部补上 `create`)并重建 `lib/client.js`。此前一直没暴露,是因为常驻宿主自 9/14 起跑的是 `0.1.5-rc.1`(当时契约仍是 `schema`)
25
+
26
+ ### 修复
27
+
28
+ - **OAuth 工具调用的「不弹浏览器」保护恢复生效**:`startConnection` 的 `opts` 一直缺少 `url` 与 `authProvider` 两个字段,于是「已存 token 缺失/过期时不要从工具调用里打开浏览器,改为返回授权链接」这段判断从未触发——实际行为是让 SDK 在工具调用中弹浏览器(同一会话可能连开多个标签)。现在在 `opts` 中补上这两项,行为回到代码注释所述
29
+
15
30
  ## [1.11.1] - 2026-09-13
16
31
 
17
32
  ### 修复
package/README.en.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![dshfind](https://dshfind.com/api/badge/ArvinQi/dsh-mcp?lang=en)](https://dshfind.com/en/plugins/ArvinQi/dsh-mcp?ref=badge)
4
4
 
5
- > **Supported DSH version**: `dsh 0.1.5-rc.1` — developed and verified on `0.1.5-rc.1`, declared in `package.json` → `dsh.supported`. When the DSH and plugin versions do not match, the Settings page shows a diagnosis (check the registration row → restart `dsh web` → hard-refresh → upgrade both sides).
5
+ > **Supported DSH version**: `dsh 0.1.6-alpha.2` — developed and verified on `0.1.6-alpha.2`, declared in `package.json` → `dsh.supported`. When the DSH and plugin versions do not match, the Settings page shows a diagnosis (check the registration row → restart `dsh web` → hard-refresh → upgrade both sides).
6
6
 
7
7
  ![Settings preview](static/snapshot.en.webp)
8
8
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![dshfind](https://dshfind.com/api/badge/ArvinQi/dsh-mcp?lang=zh)](https://dshfind.com/zh/plugins/ArvinQi/dsh-mcp?ref=badge)
6
6
 
7
- > **支持版本**:`dsh 0.1.5-rc.1` —— 本插件在 `0.1.5-rc.1` 上开发与验证,`package.json` → `dsh.supported` 同步声明。DSH 与插件两侧版本不匹配时,设置页会给出排查诊断(检查注册行 → 重启 `dsh web` → 硬刷新 → 同步升级)。
7
+ > **支持版本**:`dsh 0.1.6-alpha.2` —— 本插件在 `0.1.6-alpha.2` 上开发与验证,`package.json` → `dsh.supported` 同步声明。DSH 与插件两侧版本不匹配时,设置页会给出排查诊断(检查注册行 → 重启 `dsh web` → 硬刷新 → 同步升级)。
8
8
 
9
9
  ![设置页预览](static/snapshot.webp)
10
10
 
package/lib/client.js CHANGED
@@ -14952,14 +14952,16 @@ var TYPERT_REMOTE = {
14952
14952
  codec: {
14953
14953
  mode: "strict",
14954
14954
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveRequest",
14955
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema
14955
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
14956
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema
14956
14957
  }
14957
14958
  }
14958
14959
  ],
14959
14960
  result: {
14960
14961
  mode: "strict",
14961
14962
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveResult",
14962
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema
14963
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
14964
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema
14963
14965
  },
14964
14966
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 399, "column": 9 }
14965
14967
  },
@@ -14973,7 +14975,8 @@ var TYPERT_REMOTE = {
14973
14975
  result: {
14974
14976
  mode: "strict",
14975
14977
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerListResult",
14976
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema
14978
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
14979
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema
14977
14980
  },
14978
14981
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 314, "column": 9 }
14979
14982
  },
@@ -14991,14 +14994,16 @@ var TYPERT_REMOTE = {
14991
14994
  codec: {
14992
14995
  mode: "strict",
14993
14996
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerTestRequest",
14994
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema
14997
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
14998
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema
14995
14999
  }
14996
15000
  }
14997
15001
  ],
14998
15002
  result: {
14999
15003
  mode: "strict",
15000
15004
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerTestResult",
15001
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema
15005
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
15006
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema
15002
15007
  },
15003
15008
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 422, "column": 9 }
15004
15009
  },
@@ -15016,14 +15021,16 @@ var TYPERT_REMOTE = {
15016
15021
  codec: {
15017
15022
  mode: "strict",
15018
15023
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertRequest",
15019
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema
15024
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
15025
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema
15020
15026
  }
15021
15027
  }
15022
15028
  ],
15023
15029
  result: {
15024
15030
  mode: "strict",
15025
15031
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertResult",
15026
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema
15032
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
15033
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema
15027
15034
  },
15028
15035
  sourceLocation: { "file": "packages/mcp/mcp-manager/src/index.ts", "line": 329, "column": 9 }
15029
15036
  },
@@ -15041,14 +15048,16 @@ var TYPERT_REMOTE = {
15041
15048
  codec: {
15042
15049
  mode: "strict",
15043
15050
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonRequest",
15044
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema
15051
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
15052
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema
15045
15053
  }
15046
15054
  }
15047
15055
  ],
15048
15056
  result: {
15049
15057
  mode: "strict",
15050
15058
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonResult",
15051
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema
15059
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
15060
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema
15052
15061
  },
15053
15062
  sourceLocation: { "file": "lib/index.js" }
15054
15063
  },
@@ -15062,7 +15071,8 @@ var TYPERT_REMOTE = {
15062
15071
  result: {
15063
15072
  mode: "strict",
15064
15073
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsListResult",
15065
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema
15074
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
15075
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema
15066
15076
  },
15067
15077
  sourceLocation: { "file": "lib/index.js" }
15068
15078
  },
@@ -15080,14 +15090,16 @@ var TYPERT_REMOTE = {
15080
15090
  codec: {
15081
15091
  mode: "strict",
15082
15092
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetRequest",
15083
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema
15093
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
15094
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema
15084
15095
  }
15085
15096
  }
15086
15097
  ],
15087
15098
  result: {
15088
15099
  mode: "strict",
15089
15100
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetResult",
15090
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema
15101
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
15102
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema
15091
15103
  },
15092
15104
  sourceLocation: { "file": "lib/index.js" }
15093
15105
  },
@@ -15105,14 +15117,16 @@ var TYPERT_REMOTE = {
15105
15117
  codec: {
15106
15118
  mode: "strict",
15107
15119
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeRequest",
15108
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema
15120
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
15121
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema
15109
15122
  }
15110
15123
  }
15111
15124
  ],
15112
15125
  result: {
15113
15126
  mode: "strict",
15114
15127
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeResult",
15115
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema
15128
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
15129
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema
15116
15130
  },
15117
15131
  sourceLocation: { "file": "lib/index.js" }
15118
15132
  },
@@ -15126,7 +15140,8 @@ var TYPERT_REMOTE = {
15126
15140
  result: {
15127
15141
  mode: "strict",
15128
15142
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvListResult",
15129
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema
15143
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
15144
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema
15130
15145
  },
15131
15146
  sourceLocation: { "file": "lib/index.js" }
15132
15147
  },
@@ -15144,14 +15159,16 @@ var TYPERT_REMOTE = {
15144
15159
  codec: {
15145
15160
  mode: "strict",
15146
15161
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetRequest",
15147
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema
15162
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
15163
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema
15148
15164
  }
15149
15165
  }
15150
15166
  ],
15151
15167
  result: {
15152
15168
  mode: "strict",
15153
15169
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetResult",
15154
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema
15170
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
15171
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema
15155
15172
  },
15156
15173
  sourceLocation: { "file": "lib/index.js" }
15157
15174
  },
@@ -15169,14 +15186,16 @@ var TYPERT_REMOTE = {
15169
15186
  codec: {
15170
15187
  mode: "strict",
15171
15188
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptRequest",
15172
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema
15189
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
15190
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema
15173
15191
  }
15174
15192
  }
15175
15193
  ],
15176
15194
  result: {
15177
15195
  mode: "strict",
15178
15196
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptResult",
15179
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema
15197
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
15198
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema
15180
15199
  },
15181
15200
  sourceLocation: { "file": "lib/index.js" }
15182
15201
  },
@@ -15194,14 +15213,16 @@ var TYPERT_REMOTE = {
15194
15213
  codec: {
15195
15214
  mode: "strict",
15196
15215
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseRequest",
15197
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema
15216
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
15217
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema
15198
15218
  }
15199
15219
  }
15200
15220
  ],
15201
15221
  result: {
15202
15222
  mode: "strict",
15203
15223
  typeSymbol: "@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseResult",
15204
- schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema
15224
+ schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
15225
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema
15205
15226
  },
15206
15227
  sourceLocation: { "file": "lib/index.js" }
15207
15228
  }
package/lib/mcp-client.js CHANGED
@@ -1,9 +1,8 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
3
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
4
- import { ListToolsResultSchema, ToolListChangedNotificationSchema } from "@modelcontextprotocol/sdk/types.js";
5
- import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
6
- import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
3
+ import { Client, specTypeSchemas } from "@modelcontextprotocol/client";
4
+ import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
5
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
7
6
  import { scrubbedParentEnv } from "@deepseek-ai/dsh-subprocess";
8
7
  import { createHash } from "node:crypto";
9
8
  import { isDeepStrictEqual } from "node:util";
@@ -92,7 +91,7 @@ function listToolsUncached(client, cursor) {
92
91
  return client.request({
93
92
  method: "tools/list",
94
93
  ...cursor === void 0 ? {} : { params: { cursor } }
95
- }, ListToolsResultSchema);
94
+ }, specTypeSchemas.ListToolsResult);
96
95
  }
97
96
  /** Call without the SDK pre-validating an output schema the bridge may not support. */
98
97
  function callToolUncached(client, rawName, args, exec, opts) {
@@ -558,7 +557,11 @@ function startConnection(ctx, config, policy) {
558
557
  const opts = {
559
558
  registrationFailure: "contain",
560
559
  serverName: config.serverName,
561
- toolCallTimeoutMs: config.toolCallTimeoutMs
560
+ toolCallTimeoutMs: config.toolCallTimeoutMs,
561
+ // Read by the per-tool-call OAuth guard: the server URL drives discovery,
562
+ // and the provider reports whether a stored token is still usable.
563
+ url: config.url,
564
+ authProvider: config.authProvider
562
565
  };
563
566
  const startupOpts = config.failOnStartupError ? {
564
567
  ...opts,
@@ -659,13 +662,12 @@ function startConnection(ctx, config, policy) {
659
662
  * @param startup - Whether this is the plugin's activation attempt.
660
663
  */
661
664
  async function connectGeneration(startup) {
665
+ // SDK 2.0 no longer accepts `authProvider` in ClientOptions; the transport
666
+ // created by createTransport(config) carries it (config.authProvider).
662
667
  const generation = new Client({
663
668
  name: "dsh-mcp-client",
664
669
  version: "0.0.1"
665
- }, {
666
- capabilities: {},
667
- ...(opts.authProvider === void 0 ? {} : { authProvider: opts.authProvider })
668
- });
670
+ }, { capabilities: {} });
669
671
  const closed = Promise.withResolvers();
670
672
  let attemptSettled = false;
671
673
  let closeObserved = false;
@@ -677,7 +679,7 @@ function startConnection(ctx, config, policy) {
677
679
  closed.resolve();
678
680
  if (attemptSettled) generationDown(generation);
679
681
  };
680
- generation.setNotificationHandler(ToolListChangedNotificationSchema, async () => {
682
+ generation.setNotificationHandler("notifications/tools/list_changed", async () => {
681
683
  if (!isCurrent(generation)) return;
682
684
  ctx.logger.info(`${label}: tool list changed, re-syncing`);
683
685
  try {
@@ -783,7 +785,7 @@ async function runProbe(client, config) {
783
785
  const response = await client.request({
784
786
  method: "tools/list",
785
787
  ...cursor === void 0 ? {} : { params: { cursor } }
786
- }, ListToolsResultSchema);
788
+ }, specTypeSchemas.ListToolsResult);
787
789
  for (const tool of response.tools) tools.push({
788
790
  name: tool.name,
789
791
  ...tool.description === void 0 ? {} : { description: tool.description }
package/lib/oauth.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  exchangeAuthorization,
20
20
  registerClient,
21
21
  startAuthorization,
22
- } from "@modelcontextprotocol/sdk/client/auth.js";
22
+ } from "@modelcontextprotocol/client";
23
23
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
24
24
  import { hostText } from "./host-locales.js";
25
25
 
package/lib/probe.js CHANGED
@@ -1,5 +1,4 @@
1
- import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
- import { ListToolsResultSchema } from "@modelcontextprotocol/sdk/types.js";
1
+ import { Client, specTypeSchemas } from "@modelcontextprotocol/client";
3
2
  import { createTransport } from "./transport.js";
4
3
  const DEFAULT_PROBE_TIMEOUT_MS = 15e3;
5
4
  function probeErrorMessage(error) {
@@ -12,7 +11,7 @@ async function runProbe(client, config) {
12
11
  do {
13
12
  const response = await client.request(
14
13
  { method: "tools/list", ...cursor === void 0 ? {} : { params: { cursor } } },
15
- ListToolsResultSchema
14
+ specTypeSchemas.ListToolsResult
16
15
  );
17
16
  for (const tool of response.tools) {
18
17
  tools.push({
@@ -37,12 +36,11 @@ async function probeConnection(config, options = {}) {
37
36
  // the tokens and the next probe succeeds.
38
37
  const OAUTH_PROBE_BUDGET_MS = 5 * 60e3;
39
38
  const budgetMs = options.authProvider === void 0 ? timeoutMs : Math.max(timeoutMs, OAUTH_PROBE_BUDGET_MS);
39
+ // Client options no longer carry `authProvider`; the SDK reads it from the
40
+ // transport (see the transportConfig below).
40
41
  const client = new Client(
41
42
  { name: "dsh-mcp-client", version: "0.0.1" },
42
- {
43
- capabilities: {},
44
- ...(options.authProvider === void 0 ? {} : { authProvider: options.authProvider })
45
- }
43
+ { capabilities: {} }
46
44
  );
47
45
  const timeout = new Promise((_, reject) => {
48
46
  const timer = setTimeout(() => reject(new Error(`connection probe timed out after ${budgetMs}ms`)), budgetMs);
@@ -50,7 +48,7 @@ async function probeConnection(config, options = {}) {
50
48
  });
51
49
  try {
52
50
  // The SDK performs OAuth in the transport layer, so the authProvider must
53
- // reach the transport config (not only the Client options).
51
+ // reach the transport config.
54
52
  const transportConfig = {
55
53
  ...config,
56
54
  ...(options.authProvider === void 0 ? {} : { authProvider: options.authProvider })
package/lib/transport.js CHANGED
@@ -1,5 +1,5 @@
1
- import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
2
- import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
1
+ import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
2
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
3
3
  import { scrubbedParentEnv } from "@deepseek-ai/dsh-subprocess";
4
4
  function buildChildEnv(extra) {
5
5
  return { ...scrubbedParentEnv(), ...extra };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "MCP 管理界面 + tool search:可视化配置/启停/刷新 MCP 服务器与工具勾选,按需检索(tool search)热注入;工具列表稳定命中缓存、不撑爆上下文。DeepSeek Harness plugin: MCP management UI + tool search — stable tool list, cache-friendly, no context bloat.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -24,6 +24,10 @@
24
24
  "build": "node scripts/build.mjs",
25
25
  "test": "node scripts/test.mjs"
26
26
  },
27
+ "dependencies": {
28
+ "@modelcontextprotocol/client": "2.0.0",
29
+ "zod": "^4.2.0"
30
+ },
27
31
  "author": "Arvin.qi <arvin.qi@qq.com>",
28
32
  "license": "MIT",
29
33
  "repository": {
@@ -35,7 +39,7 @@
35
39
  "url": "https://github.com/ArvinQi/dsh-mcp/issues"
36
40
  },
37
41
  "dsh": {
38
- "supported": "0.1.5-rc.1",
42
+ "supported": "0.1.6-alpha.2",
39
43
  "client": {
40
44
  "inject": [
41
45
  "@deepseek-ai/dsh-api-remotes",
@@ -414,6 +414,7 @@ export const TYPERT_REMOTE = {
414
414
  mode: 'strict',
415
415
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveRequest',
416
416
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
417
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_parameter_0$schema,
417
418
  },
418
419
  },
419
420
  ],
@@ -421,6 +422,7 @@ export const TYPERT_REMOTE = {
421
422
  mode: 'strict',
422
423
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerRemoveResult',
423
424
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
425
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_delete_result$schema,
424
426
  },
425
427
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":399,"column":9},
426
428
  },
@@ -436,6 +438,7 @@ export const TYPERT_REMOTE = {
436
438
  mode: 'strict',
437
439
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerListResult',
438
440
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
441
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_list_result$schema,
439
442
  },
440
443
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":314,"column":9},
441
444
  },
@@ -454,6 +457,7 @@ export const TYPERT_REMOTE = {
454
457
  mode: 'strict',
455
458
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerTestRequest',
456
459
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
460
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_parameter_0$schema,
457
461
  },
458
462
  },
459
463
  ],
@@ -461,6 +465,7 @@ export const TYPERT_REMOTE = {
461
465
  mode: 'strict',
462
466
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerTestResult',
463
467
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
468
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_test_result$schema,
464
469
  },
465
470
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":422,"column":9},
466
471
  },
@@ -479,6 +484,7 @@ export const TYPERT_REMOTE = {
479
484
  mode: 'strict',
480
485
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertRequest',
481
486
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
487
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_parameter_0$schema,
482
488
  },
483
489
  },
484
490
  ],
@@ -486,6 +492,7 @@ export const TYPERT_REMOTE = {
486
492
  mode: 'strict',
487
493
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertResult',
488
494
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
495
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsert_result$schema,
489
496
  },
490
497
  sourceLocation: {"file":"packages/mcp/mcp-manager/src/index.ts","line":329,"column":9},
491
498
  },
@@ -504,6 +511,7 @@ export const TYPERT_REMOTE = {
504
511
  mode: 'strict',
505
512
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonRequest',
506
513
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
514
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_parameter_0$schema,
507
515
  },
508
516
  },
509
517
  ],
@@ -511,6 +519,7 @@ export const TYPERT_REMOTE = {
511
519
  mode: 'strict',
512
520
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerUpsertJsonResult',
513
521
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
522
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_upsertJson_result$schema,
514
523
  },
515
524
  sourceLocation: {"file":"lib/index.js"},
516
525
  },
@@ -526,6 +535,7 @@ export const TYPERT_REMOTE = {
526
535
  mode: 'strict',
527
536
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsListResult',
528
537
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
538
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsList_result$schema,
529
539
  },
530
540
  sourceLocation: {"file":"lib/index.js"},
531
541
  },
@@ -544,6 +554,7 @@ export const TYPERT_REMOTE = {
544
554
  mode: 'strict',
545
555
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetRequest',
546
556
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
557
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_parameter_0$schema,
547
558
  },
548
559
  },
549
560
  ],
@@ -551,6 +562,7 @@ export const TYPERT_REMOTE = {
551
562
  mode: 'strict',
552
563
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsSetResult',
553
564
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
565
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsSet_result$schema,
554
566
  },
555
567
  sourceLocation: {"file":"lib/index.js"},
556
568
  },
@@ -569,6 +581,7 @@ export const TYPERT_REMOTE = {
569
581
  mode: 'strict',
570
582
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeRequest',
571
583
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
584
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_parameter_0$schema,
572
585
  },
573
586
  },
574
587
  ],
@@ -576,6 +589,7 @@ export const TYPERT_REMOTE = {
576
589
  mode: 'strict',
577
590
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerToolsModeResult',
578
591
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
592
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_toolsMode_result$schema,
579
593
  },
580
594
  sourceLocation: {"file":"lib/index.js"},
581
595
  },
@@ -591,6 +605,7 @@ export const TYPERT_REMOTE = {
591
605
  mode: 'strict',
592
606
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvListResult',
593
607
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
608
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envList_result$schema,
594
609
  },
595
610
  sourceLocation: {"file":"lib/index.js"},
596
611
  },
@@ -609,6 +624,7 @@ export const TYPERT_REMOTE = {
609
624
  mode: 'strict',
610
625
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetRequest',
611
626
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
627
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_parameter_0$schema,
612
628
  },
613
629
  },
614
630
  ],
@@ -616,6 +632,7 @@ export const TYPERT_REMOTE = {
616
632
  mode: 'strict',
617
633
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerEnvSetResult',
618
634
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
635
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_envSet_result$schema,
619
636
  },
620
637
  sourceLocation: {"file":"lib/index.js"},
621
638
  },
@@ -634,6 +651,7 @@ export const TYPERT_REMOTE = {
634
651
  mode: 'strict',
635
652
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptRequest',
636
653
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
654
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_parameter_0$schema,
637
655
  },
638
656
  },
639
657
  ],
@@ -641,6 +659,7 @@ export const TYPERT_REMOTE = {
641
659
  mode: 'strict',
642
660
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerAdoptResult',
643
661
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
662
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_adopt_result$schema,
644
663
  },
645
664
  sourceLocation: {"file":"lib/index.js"},
646
665
  },
@@ -659,6 +678,7 @@ export const TYPERT_REMOTE = {
659
678
  mode: 'strict',
660
679
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseRequest',
661
680
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
681
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_parameter_0$schema,
662
682
  },
663
683
  },
664
684
  ],
@@ -666,6 +686,7 @@ export const TYPERT_REMOTE = {
666
686
  mode: 'strict',
667
687
  typeSymbol: '@deepseek-ai/dsh-mcp-manager/types#McpManagerReleaseResult',
668
688
  schema: _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
689
+ create: () => _deepseek_ai_dsh_mcp_manager_mcpManager_release_result$schema,
669
690
  },
670
691
  sourceLocation: {"file":"lib/index.js"},
671
692
  },