DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

my-dsh /

my-dsh/dsh-mcp-status

Verified

MCP connection panel for DeepSeek Harness: a composer-toolbar button that lists every configured MCP server and switches its connection on or off, so DSH starts without connecting to any of them

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@80a9d726

dsh-mcp-status

English | 中文

DeepSeek Harness 的 MCP 连接面板插件。

它在对话输入框下方的工具栏里加一个按钮,列出本机所有 MCP 服务器,并逐个开关连接。 装了它之后,DSH 启动时不再连接任何 MCP 服务器。

为什么需要它

DSH 里每个 MCP 服务器都是一行 @deepseek-ai/dsh-mcp-client。这些行一旦启用,Loader 在启动时就会逐个拉起连接;连不上时 supervisor 进入重连退避(500ms → 30s,最多 10 次), 于是后台每几十秒就重试一次。对不常用的服务器来说,这既拖慢启动,也一直在烧子进程和 连接尝试。

本插件把「要不要连」这件事从启动时挪到用户手上:行保留为纯配置,连接由面板按需建立。

安装

需要一个 web surface profile(dsh web 的默认 profile 名是 web)。git 和 pnpm 都要在 PATH 上。

# 从 GitHub 直装
dsh plugin --profile web add github:my-dsh/dsh-mcp-status

# 或安装已发布到 npm 的版本
dsh plugin --profile web add @my-dsh/dsh-mcp-status

包声明了 dsh.bundle,安装后自动加入 profile 的 bundle 层栈,重启 DSH 生效。

装完之后要做的一件事

把已有的 MCP 行关掉,让 disabled: true 写进 profile,这样下次启动才不会自动连。 在 GUI 里点一下对应的开关即可(关闭会写回 profile),或者直接改 ~/.dsh/profiles/<name>/cordis.patch.yml:

- id: mcp-chrome
  disabled: true
- id: mcp-mysql
  disabled: true

界面

位置在输入框下方那行工具栏:和「+」号、「工作区内修改」在同一个 flex 容器(.tools)里, 紧挨「工作区内修改」右侧。

  • 按钮显示 MCP 2/3 已连接,左侧圆点表示是否有连接(有连接=绿色,读取失败=红色)。
  • 点开是一个面板,每个服务器一行:名称、传输方式、连接目标、工具数、连接状态、开关。
  • 面板打开时每 4 秒刷新一次;关闭时不发请求。
  • 尺寸与相邻 chip 一致:高 28px、radius-sm、13px/20px、同样的 hover 底色。
  • 中英文案跟随界面语言。

它是怎么工作的

行是纯配置。 每个 @deepseek-ai/dsh-mcp-client 行继续作为服务器配置的唯一来源 (transport / command / args / env / url),但被置为 disabled: true,Loader 不再挂载它们, 所以启动时零连接、零重连计时器。

连接由面板接管。 打开开关时,插件用该行的配置在自己的 context 里挂载官方 dsh-mcp-client 插件,工具与资源照旧注册到 ctx.tools;关闭开关时 dispose 掉那个挂载, 传输关闭、工具注销。连接的生命周期就等于用户开着它的时间,重启后一定是断开状态。

一条兼容路径。 如果某个行在 profile 里仍是启用状态,面板会如实显示为「已连接(由该行 自己维护)」,此时关闭开关会走 Plugin Manager 把 disabled: true 持久化——这样开关的含义 始终一致:关掉就是重启后也不会自动连。

Host 路由

两条都在需要认证的 /api 通道上,客户端用同源 fetch('api/...') 调用。

  • GET api/mcp-status.list → { servers: [{ entryId, serverName, transport, target, enabled, connected, phase, tools, editable }] }
  • POST api/mcp-status.set { entryId, enabled } → { ok, application, status }; 连不上时 { ok: false, reason: 'connect-failed', diagnostic }

配置

cordis.patch.yml 里的行可以带可选配置,通过用户 patch 层覆盖:

- id: mcp-status
  name: '@my-dsh/dsh-mcp-status'
  config:
    # 单次连接的等待上限毫秒(默认 8000)。超时后面板显示「连接中」并继续等,
    # 不会把还在连的服务器判成失败。
    connectTimeoutMs: 8000

依赖

运行时不 import 任何第三方包:MCP 插件通过 ctx.loader.import('@deepseek-ai/dsh-mcp-client') 从 Loader 取,所以这个 bundle 不需要 声明 dependencies。Host 半只用 Node 内置模块。

Client 半是纯 JavaScript(React.createElement,无构建步骤),只 require 平台模块表里的 react 和 react-dom。

源码布局

dsh-mcp-status/
├── index.js            # Host 半:读 MCP 行、挂载/卸载连接、两条 /api 路由
├── client.js           # Client 半:工具栏按钮与面板
├── cordis.patch.yml    # bundle 补丁:插入 mcp-status 行
├── locale/
│   ├── zh.json         # 插件列表里的标题与描述
│   └── en.json
├── icon.svg            # 插件图标
└── package.json        # dsh.bundle + dsh.client 声明

发布到 npm

需要一个能写 @my-dsh scope 的 npm 账号。package.json 里已设好 publishConfig.access: public,维护者执行:

npm login                       # 用 @my-dsh scope 对应的账号
npm publish

仓库根的 .npmrc 把 registry 钉在 https://registry.npmjs.org/,发布机器无需手工切换。 npm pack --dry-run 可预览实际 tarball 内容。

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 80a9d7264849

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout