Dsh Cordis
FreeNot checkedExposes DeepSeek Harness dynamic Cordis plugin management to Claude Code via MCP, enabling plugin install, run, stop, inspect, and session handling through natu
About
Exposes DeepSeek Harness dynamic Cordis plugin management to Claude Code via MCP, enabling plugin install, run, stop, inspect, and session handling through natural language.
README
把 DeepSeek Harness 的动态 Cordis 工具集以 MCP(Streamable HTTP)暴露给 Claude Code:Claude Code 可以实时加载、定义、运行、更新、停止、删除 DSH 的动态插件——和你在 DSH 会话里用 cordis_define / cordis_run / cordis_stop / cordis_undefine / cordis_inspect_* 完全同一套能力,同一个运行时代理。
┌─────────────┐ MCP (Streamable HTTP, loopback) ┌───────────────────────────┐
│ Claude Code │ ────── http://127.0.0.1:8090/mcp ──▶ │ DSH host (本插件) │
│ (claude) │ ────── JSON-RPC 2.0 ───────────────▶ │ dynamicCordisRunner │
└─────────────┘ │ cordisInspect │
│ agents (会话解析) │
└───────────────────────────┘
插件挂在现有 web 端口上,不新开端口、不发布服务;MCP 端点强制 Bearer 认证,token 在 DSH 设置 → dsh-cordis-mcp 页面配置(首次自动生成,可自定义/重新生成)。
能力(10 个工具)
| MCP 工具 | 对应 DSH 工具 | 作用 |
|---|---|---|
dsh_status |
— | 桥状态:会话解析、活会话列表、插件数 |
dsh_sessions |
— | 列出可管理的活 DSH 会话(插件按会话归属) |
dsh_plugins_list |
cordis_inspect_self(无参) |
列出目标会话的全部动态插件与状态 |
dsh_plugin_inspect |
cordis_inspect_self(带参) |
插件/包详情;带 packageId 时返回源码 |
dsh_inspect_providers |
cordis_inspect_list |
Inspect provider 目录(host + client) |
dsh_inspect_query |
cordis_inspect_query |
跑一次只读 inspect 查询(服务/事件/内建/槽位/主题/工具目录) |
dsh_plugin_define |
cordis_define |
定义不可变 Package(新建插件或追加版本) |
dsh_plugin_run |
cordis_run |
激活 Package(run / update),可返回 awaiting-approval |
dsh_plugin_stop |
cordis_stop |
停止运行、取消未决审批,保留定义与版本 |
dsh_plugin_undefine |
cordis_undefine |
永久删除插件(含全部 Package、授权、版本指针) |
含 Client half 的包首次运行仍走 DSH 的审批流:
dsh_plugin_run返回awaiting-approval,在 DSH Web GUI 的 Run 卡片上点允许后异步完成——和 DSH 会话内一致。
一键安装
curl -fsSL https://raw.githubusercontent.com/GeekRicardo/dsh-cordis-mcp/main/install.sh | bash
脚本做的事(可先 --dry-run 预览):
- 在
~/.dsh/profiles/web/package.json写入依赖"dsh-cordis-mcp": "github:GeekRicardo/dsh-cordis-mcp"; - 把
dsh-cordis-mcp追加进dsh.profile.bundles; cd ~/.dsh/profiles/web && pnpm install;- 校验 bundles 已注册,提示重启。
重启 DSH 并硬刷新页面后,MCP 端点随 web 服务就绪:
pm2 restart dsh-web # 若用 pm2 托管;否则用你的启动方式重启
接入 Claude Code
# 端口换成你 DSH web 的实际端口(启动日志会打印完整地址)
claude mcp add dsh --transport http http://127.0.0.1:8090/mcp
claude mcp list # 确认 connected
认证(强制,不能直连)
MCP 端点强制 Bearer 认证,未带 token 一律 401(未配置 token 则 503)。token 在 DSH 设置 → dsh-cordis-mcp 页面里配置:首次使用自动生成并持久化,页面可查看/复制/自定义/重新生成。把 token 填进 .mcp.json 的请求头:
{
"mcpServers": {
"dsh": {
"type": "http",
"url": "http://127.0.0.1:8090/mcp",
"headers": { "Authorization": "Bearer <设置页里的 token>" }
}
}
}
token 解析优先级:设置页配置 > DSH_MCP_TOKEN 环境变量 > 自动生成。改 token 立即生效(无需重启);重新生成后旧 token 立即失效,需同步更新 Claude Code 配置。
会话语义(重要)
动态插件按会话归属,且是进程内存态(DSH 重启即清空)。桥的会话解析顺序:
- 调用参数里的
sessionId(可用dsh_sessions查); - 环境变量
DSH_MCP_DEFAULT_SESSION指定; - 当前唯一活会话;
- 多个活会话但未指定 → 报错列出可选,要求传
sessionId。
其他环境变量
| 变量 | 默认 | 说明 |
|---|---|---|
DSH_MCP_PATH |
/mcp |
MCP 端点路径(挂在 webServer 上) |
DSH_MCP_TOKEN |
无 | 认证 token 的回退来源(设置页未配置时使用) |
DSH_MCP_DEFAULT_SESSION |
无 | 未显式传 sessionId 时的目标会话 |
安全边界
- 强制 Bearer 认证:无 token 一律 401 / 503,端点永远不能直连;
- 只接受 loopback Host(
127.*/localhost/::1),拒绝一切外部访问; - 拒绝
sec-fetch-site: cross-site的浏览器请求,且永不返回 CORS 头——网页读不到响应; - 设置页路由
/dsh-cordis-mcp/settings仅放行同源 loopback(不带 MCP token,但改的只是 token 配置本身); - 该端点能 define/run/删除插件,等同 shell 权限,别把端口暴露到非本机。
工作原理
| 文件 | 职责 |
|---|---|
lib/mcp-protocol.js |
纯 MCP JSON-RPC 层(initialize / ping / tools/list / tools/call),零 DSH 依赖 |
lib/tools.js |
10 个工具的输入校验 + 会话解析,封装 dynamicCordisRunner / cordisInspect |
lib/token.js |
纯 token 解析/生成(设置 > env > 自动生成) |
lib/http.js |
MCP route 的 HTTP 层:强制认证、body 读取、loopback/跨站防护 |
lib/index.js |
Cordis 插件:注入 5 个宿主服务、settings 命名空间、/mcp + /dsh-cordis-mcp/settings 两条 route |
lib/client.js |
设置页 UI:token 查看/复制/自定义/重新生成 + 端点地址 |
卸载
# 1. 从 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 移除 "dsh-cordis-mcp"
# 2. 移除 dependencies 里的 "dsh-cordis-mcp"
# 3. cd ~/.dsh/profiles/web && pnpm install
# 4. 重启 DSH;claude mcp remove dsh
前置条件
- DeepSeek Harness 已初始化 web profile(
~/.dsh/profiles/web存在),且当前会话跑在带 Cordis 工具集的 preset 上(宿主侧dynamicCordisRunner服务存在,默认即有); - 本机装有 Claude Code CLI 并已登录;
- Node.js ≥ 20、pnpm 可用。
Troubleshooting
| 现象 | 原因与处理 |
|---|---|
claude mcp list 显示 disconnected |
DSH 未重启 / 端口不对。重启后在 DSH 启动日志里找 [dsh-cordis-mcp] MCP endpoint ready 一行,用打印出来的地址 |
dsh_plugin_run 返回 awaiting-approval |
含 Client half 的包需要你在 DSH Web GUI 的 Run 卡片上允许;授权后重跑 dsh_plugin_run |
报 multiple live DSH sessions |
有多个活会话,先 dsh_sessions 查 id,再在调用里传 sessionId |
报 no live DSH session |
DSH Web GUI 没打开任何会话;打开后再试 |
401 / missing or invalid bearer token |
.mcp.json 里的 token 过期或不对——去设置页复制当前 token 更新 |
503 / auth-not-configured |
host 未初始化 token(异常态)——在设置页保存任意 token 或重启 DSH |
| 插件重启后消失 | 动态插件是进程内存态,属预期;本桥只管理运行中的 DSH 进程 |
License
MIT
Installing Dsh Cordis
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/GeekRicardo/dsh-cordis-mcpFAQ
Is Dsh Cordis MCP free?
Yes, Dsh Cordis MCP is free — one-click install via Unyly at no cost.
Does Dsh Cordis need an API key?
No, Dsh Cordis runs without API keys or environment variables.
Is Dsh Cordis hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Dsh Cordis in Claude Desktop, Claude Code or Cursor?
Open Dsh Cordis on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
by duxiaohuiSupabase
Database, auth and storage
by SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Dsh Cordis with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
