rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
在 DSH(DeepSeek Harness)中可视化地管理 MCP 服务器的宿主机插件(双半:host 连接层 + 设置页面板)。
mcp__<serverName>__<toolName>,可直接供 Agent 调用$DSH_HOME/mcp-manager.json,重启 DSH 不丢失、自动重连dsh.bundle 形式经 dsh plugin 安装进 profile 的 dsh.profile.bundles 层(其 cordis.patch.yml 自动 insert 插件行),进程级存活,卸载 = dsh plugin --profile web remove mcp-manager插件挂载在 设置页 → 侧边栏 →「MCP 服务器」(settings.section,order 30)。面板显示:
host-plugin/ 是一个完整的 npm 包(mcp-manager),host 半在 lib/index.js、client 半在 lib/client.js(手写 __ModuleLoader__ bundle,无构建步骤)。包声明了 dsh.bundle,可直接用 dsh plugin 安装(pnpm 转发 + 自动挂载到 dsh.profile.bundles 层)——无需复制目录、无需手改 cordis.patch.yml。
git clone <仓库地址> dsh-mcp-manager
cd dsh-mcp-manager
dsh plugin --profile web add file:./host-plugin
file:./host-plugin 的相对路径以当前目录为锚点解析(dsh plugin 会做 cwd 锚定);绝对路径亦可,如 dsh plugin --profile web add C:\path\to\host-plugin。dsh plugin 自动把 mcp-manager 加入 profile 的 dsh.profile.bundles 层,重启 DSH 即自动挂载,打开 设置页 → MCP 服务器。host-plugin/ 代码后重启 DSH 即生效,适合开发迭代。cd host-plugin
npm publish
dsh plugin --profile web add mcp-manager
dsh plugin --profile web update mcp-manager(或重新 add 新路径/新版本)dsh plugin --profile web remove mcp-manager(同时移出 bundles 层)dsh plugin --profile web add file:./host-plugin(或绝对路径),重启 DSH 确认面板正常~/.dsh/profiles/web/cordis.patch.yml 里手动追加的 mcp-manager insert 块(否则与 bundle patch 重复挂载)~/.dsh/profiles/web/node_modules/mcp-manager/ 旧副本(若存在)首次启动会读取 $DSH_HOME/mcp-manager.json(不存在则视为空配置),自动连接全部已配置服务器。
依赖服务:
subprocess、tools、timer、connection(dsh-base 与 web bundle 均已提供)。
服务器增删改即时写入 $DSH_HOME/mcp-manager.json:
[
{
"name": "codegraph",
"command": "C:\\...\\node.exe",
"args": ["--liftoff-only", "C:\\...\\codegraph.js", "serve", "--mcp"],
"cwd": "C:\\path\\to\\workspace",
"toolCallTimeoutMs": 60000
}
]
env 为可选的键值对象(如 GitHub token)。删除服务器 = 从面板点「删除」或手动编辑该文件。
添加并连接一个本地 MCP 服务器(如最小测试服务器 examples/test-mcp-server.js),直接在面板表单填写:
| 字段 | 值 |
|---|---|
| 名称 | test |
| 命令 | node |
| 参数 | C:\path\to\examples\test-mcp-server.js |
连接成功后,服务器暴露的工具会出现在 Agent 工具列表,形如:
mcp__test__echo、mcp__test__add、mcp__test__complex、mcp__test__fail。
ctx.tools.register 注册工具、ctx.connection.rpc.handle('/mcp-manager') 提供 RPC、node:fs 落盘);client 半注册 settings.section,经 ctx.connection.rpc.call('/mcp-manager', endpoint, payload) 通信(RPC 响应为 {ok:true,value}|{ok:false,error} envelope,由 dsh-client-connection 强制校验)。initialize → notifications/initialized → tools/list(支持分页)→ tools/call。mcp__<server>__<tool>,非法字符转 _;超长时追加 12 位 FNV-1a 哈希。oneOf、enum、const,剔除 format/pattern/min* 等),无法转换的工具跳过并计数。src/host.js + src/client.js 是早期的动态插件版(cordis_define 加载,进程内存态,重启丢失),仅作参考。新项目请使用 host-plugin/ 宿主机版。
examples/test-mcp-server.js 是一个最小可用的 Node stdio MCP 服务器(无依赖),用于快速验证:
node examples/test-mcp-server.js
暴露 4 个工具:echo、add、complex(枚举 + 嵌套对象 + anyOf)、fail(isError 用例)。
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp。