DeepSeek Harness 插件

dsh-mcp-sync

DSH plugin: connect to MCP servers, discover tools, and register them for direct model invocation(英文原文)

跳到安装方式

来源信息

GitHub 仓库
nan1010082085/dsh-mcp-sync
最近更新
2026年8月20日
分类
工具与能力
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/nan1010082085/dsh-mcp-sync
插件名:dsh-mcp-sync
作者:nan1010082085

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-mcp-sync

![GitHub](https://github.com/nan1010082085/dsh-plugins) ![npm](https://www.npmjs.com/package/dsh-mcp-sync)

DSH(DeepSeek Harness)插件:连接 MCP 服务器、发现工具并注册到 DSH 工具系统,让模型可以直接调用 MCP 工具。

功能

能力说明
MCP 连接通过 stdio/SSE/StreamableHTTP 连接到 MCP 服务器
工具发现自动调用 tools/list 发现每个 MCP 服务器的工具
工具注册将 MCP 工具注册到 DSH 工具系统(命名: mcp__<server>__<tool>)
元工具mcp_call 动态调用 + mcp_list_tools 工具发现
多源扫描Claude Code、Codex CLI、Cursor Agent、DSH 配置
智能去重按 command + args 或 url 去重
自定义 MCP支持添加自定义 MCP 服务
连接管理侧边栏管理面板:连接状态、工具列表、一键刷新

工作原理

1. 扫描: 从 Claude Code / Codex / Cursor / DSH 配置文件读取 MCP 服务器定义 2. 连接: 使用 MCP SDK(stdio/SSE/HTTP transport)连接到每个服务器 3. 发现: 调用 tools/list 获取每个服务器暴露的工具列表 4. 注册: 将每个 MCP 工具注册为 DSH 工具,模型可直接调用

安装

# 从 GitHub 安装(独立仓库,已发布 npm)
dsh plugin --profile web add github:nan1010082085/dsh-mcp-sync

# 或从 npm 安装
dsh plugin --profile web add dsh-mcp-sync

# 重启 dsh web 生效

依赖

  • dsh-better-sidebar — 侧边栏标签页系统
  • @modelcontextprotocol/sdk — MCP 协议客户端

配置

默认零配置可用。需要调整时,在 profile 的 cordis.patch.yml 按 id 覆盖:

- id: mcp-sync
  config:
    enabled: true
    autoSync: true          # 启动时自动扫描
    autoConnect: true       # 自动连接到发现的 MCP 服务器
    syncInterval: 60000     # 定时同步间隔(ms),0 关闭
    dedupeByCommand: true   # 按 command+args 去重
    registerTools: true     # 自动注册 MCP 工具到 DSH
    sources:
      claude: true
      codex: true
      cursor: true
      dsh: true             # ~/.dsh/mcp.json

DSH MCP 配置文件

~/.dsh/mcp.json 使用标准 MCP 格式:

{
  "mcpServers": {
    "my-tool": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@my-org/mcp-server"],
      "env": { "API_KEY": "..." }
    },
    "remote-service": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

工具命名

每个 MCP 工具注册为 DSH 工具,命名规则:

  • 命名工具: mcp__<serverId>__<toolName> — 模型直接调用
  • 元工具: mcp_call — 动态调用任意 MCP 工具
  • 发现工具: mcp_list_tools — 列出所有可用 MCP 工具

API(均 loopback-only)

路由方法说明
/api/dsh-mcp-sync/statusGET来源可用性 + 连接状态
/api/dsh-mcp-sync/serversGET去重后的 MCP 服务列表
/api/dsh-mcp-sync/configGET各源原始配置文件内容
/api/dsh-mcp-sync/connectionsGETMCP 客户端连接状态
/api/dsh-mcp-sync/connectPOST连接到指定 MCP 服务器
/api/dsh-mcp-sync/disconnectPOST断开指定 MCP 服务器
/api/dsh-mcp-sync/toolsGET列出所有已发现的 MCP 工具
/api/dsh-mcp-sync/callPOST直接调用 MCP 工具
/api/dsh-mcp-sync/customGET/POST/DELETE自定义 MCP 服务管理

侧边栏

设置页面中的「MCP Manager」标签页提供三个子视图:

  • Servers: 扫描到的 MCP 服务器配置
  • Connections: 连接状态和工具数量
  • Tools: 所有已发现的 MCP 工具列表

开发

node --check lib/index.js lib/sources.js lib/routes.js lib/mcp-client.js lib/mcp-tools.js lib/client.js

License

MIT