dsh-mcp-server
dsh-mcp-server
把 DeepSeek Harness 的 Agent(dsh,带全套工具:文件、终端、网页搜索、子代理、工作流的编码 Agent)通过 Model Context Protocol 暴露成本机可用的模型后端,并同时暴露"读懂我 / 改造我"的接口。
┌────────────────────────────┐ stdio / HTTP ┌──────────────────────────────┐
│ 其他 Agent / MCP 客户端 │ ────────────────────────▶ │ dsh-mcp-server │
│ (Claude Desktop, Cursor, │ │ 方向A:驱动我(消耗我的额度) │
│ Claude Code, 自定义程序) │ │ 方向B:读懂我/改造我(便宜) │
└────────────────────────────┘ └──────────────┬───────────────┘
│ spawn
┌──────────▼───────────────┐
│ dsh Agent(完整工具链) │
│ DeepSeek 模型(默认) │
└──────────────────────────┘两个方向
方向 A:驱动我 —— 消耗 DeepSeek Harness 额度,必须用户确认
dsh_ask / dsh_converse / dsh_tool 每次调用都会拉起一个完整的 dsh Agent 进程,由它(用 DeepSeek 模型)实际干活:读写文件、跑命令、搜网页、派子代理。这消耗的是 DeepSeek Harness 的 token 额度,所以:
调用先返回
confirmation_required(此时不消耗任何额度),并明确告知"将消耗 DeepSeek Harness 额度";调用方必须把这个请求展示给用户(MCP 客户端通常会自动展示工具调用);
用户批准后调用
dsh_confirm(requestId, approve=true)才真正执行;或dsh_deny(requestId)取消。
每个待确认请求也会在服务器 stderr 打一行醒目的警告。未确认的请求 10 分钟过期。
⚠️ 风险开关:
DSH_MCP_AUTO_APPROVE=1会跳过确认闸门(适合无人值守/完全可信环境)。单次调用也可传confirm: false跳过。
方向 B:读懂我 / 改造我 —— 消耗对方的 token,服务器侧很便宜
其他 Agent 想理解"我是什么、怎么设计的、怎么给我做插件/改配置"时,走这些接口(服务器只做本地读取/校验,不消耗 dsh 模型额度;对方模型把结果读进自己的上下文,消耗的是对方自己的 token):
接口 | 类型 | 内容 |
| 工具 | 完整设计快照:后端模型/版本、人设模板、plan-mode 规则、挂载的 81 个插件行、工作区与配置路径、凭据键名(值打码)、可发现技能 |
| 资源 | 人设与系统提示组件(模板、指令上限、plan-mode 全文) |
| 资源 | 挂载的插件行清单 + 工具族可用性 |
| 资源 |
|
| 资源 | 已配置凭据的键名(值永不暴露) |
| 资源 | 技能清单(内置预设 + 用户/项目技能) |
| 资源模板 | 某个技能的 SKILL.md 正文 |
| 工具 | 给"想改造我"的 Agent 看的插件/配置改造契约(profile/patch/bundle/skill 的格式与安全规则) |
| 工具 | 提议修改配置:默认 dry-run 用 dsh 自己的解析器校验(不写盘);真正写入会备份原文件 + 要求用户确认 |
典型用法:外部 Agent 先读 dsh://self/* 资源理解设计(花它的 token),再调用 dsh_patch_config 提出配置修改(比如换模型、挂新技能、停用某个插件),或依据 dsh_plugin_contract 给本机写一个 dsh 插件。
Related MCP server: dsh-orchestrator
快速开始
cd E:\DeepSeek Harness\dsh-mcp
npm install # 安装 @modelcontextprotocol/sdk
# 冒烟测试:不经过 MCP,直接验证 dsh Agent 后端可用
node scripts/smoke.mjs
# 以 stdio 传输启动服务器(MCP 客户端的标准方式)
node src/index.js服务器会自动发现本机安装的 dsh(扫描 npx 缓存 / npm 缓存 / 本目录),无需配置。
找不到时用环境变量指定:DSH_MCP_DSH_BIN=C:\...\@deepseek-ai\dsh\lib\bin.js。
接入 Claude Desktop
编辑 %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"dsh": {
"command": "node",
"args": ["E:\\DeepSeek Harness\\dsh-mcp\\src\\index.js"]
}
}
}接入 Claude Code / Cursor / VS Code
分别使用 examples/claude-code.json、examples/cursor-mcp.json、examples/vscode.json。
接入你自己的 Agent(HTTP 方式)
node src/index.js --transport http --port 3005
# 端点:http://127.0.0.1:3005/mcp (Streamable HTTP)工具清单
工具 | 方向 | 说明 |
| A(消耗额度) | 一次性任务交给全新 dsh Agent,返回最终回复 + 元数据。需确认。 |
| A(消耗额度) | 多轮对话(服务端按 |
| A(消耗额度) | 让 Agent 直接调某个具体工具并原样回报。需确认。 |
| — | 批准/取消一个待确认请求( |
| — | 列出当前等待确认的请求(诊断)。 |
| — | 生成新 |
| — | 清空会话记忆。 |
| — | 诊断:dsh 版本、模型、工具族、待确认数等。 |
| B | 设计快照(人设/插件行/路径/技能/凭据键名)。 |
| B | 校验/写入配置 patch(dry-run 默认,写盘需确认+备份)。 |
| B | 插件与配置改造契约文档。 |
环境变量
变量 | 默认值 | 说明 |
| 自动发现 |
|
|
| dsh 启动的 profile |
|
| 单次 Agent 调用硬超时 |
|
| 任务文本长度上限(Windows 命令行 ~32k) |
|
|
|
|
| 并行 dsh 进程数上限 |
| 未设置 |
|
|
| 待确认请求过期时间 |
|
| 传给 dsh Agent 的权限模式 |
权限与安全
dsh Agent 继承 dsh 权限体系:默认
workspace-write(只能写工作目录),可调read-only/danger-full-access。方向 A 的所有执行都经过确认闸门,额度披露明确。
方向 B 只读路径不打码任何密钥值;写路径(
dsh_patch_config)默认 dry-run、写盘前自动备份、需要确认,并警告 home 层会影响所有 profile(含运行中的 Web UI)。会话持久化在
~/.dsh/sessions,凭据共用~/.dsh/.credentials.yaml。服务器只监听本机(stdio 管道 / 127.0.0.1)。
换模型(方向 B 的典型用法)
默认模型来自 dsh 的 agent-default-model(本机 deepseek-official / deepseek-v4-flash)。改法:
用
dsh_patch_config(推荐):提交 patch 到home层,dry-run 校验通过、用户确认后写入(自动备份)。示例 patch:- id: agent-default-model config: provider: deepseek-official model: deepseek-chat改全局设置:编辑
~/.dsh/settings.yaml的agent-default-model段。换整套 profile:
DSH_MCP_PROFILE指定其它 profile(不同工具集/人设)。
已知限制
方向 A 每次调用是新进程(约 2~3 秒冷启动 + 模型响应),无流式,任务文本 ≤ ~30k 字符。
确认闸门依赖调用方把
confirmation_required展示给用户;若调用方是无人值守程序且未设DSH_MCP_AUTO_APPROVE,请求会一直挂着直到过期。资源/工具数量:6 个资源 + 11 个工具。
开发与测试
node scripts/smoke.mjs # 仅测 dsh 后端(无 MCP)
node scripts/demo.mjs # 演示:确认闸门 + 读懂我 + 改配置提议
node scripts/mcp-client-test.mjs # stdio 端到端:闸门/拒绝/多轮/自省/patch/资源
node scripts/http-client-test.mjs # HTTP 端到端(自动批准模式)目录结构
dsh-mcp/
├── src/
│ ├── index.js # CLI 入口(stdio / HTTP 传输)
│ ├── server.js # MCP 工具与资源注册
│ ├── dsh.js # dsh 子进程运行器(spawn/超时/输出捕获/并发闸门)
│ ├── approvals.js # 确认闸门(额度披露、待确认队列、过期)
│ ├── self.js # 自省:设计快照、技能发现、配置路径、插件契约
│ └── sessions.js # 会话记忆与多轮提示组装
├── scripts/ # 冒烟 + 演示 + 端到端测试
└── examples/ # 各客户端接入配置This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceExposes DeepSeek Harness agent capabilities as an MCP server, letting any MCP client drive Harness to execute real coding tasks with structured results, context isolation, and parallel execution.8MIT
- AlicenseAqualityBmaintenanceA local STDIO MCP server that bridges Codex to the official DeepSeek Harness (DSH) Web Host, enabling supervised DSH collaboration through session management, delegation, and monitoring tools.136MIT
- AlicenseNot gradedqualityBmaintenanceTurns DeepSeek Harness into an MCP server with tools for session management, agent execution, resources, and OAuth, plus browser automation and GitHub/GitLab integration.15MIT
- AlicenseNot gradedqualityCmaintenanceIn-process DeepSeek Harness plugin that exposes a local Streamable HTTP MCP server, allowing MCP clients like Codex to submit tasks executed by DSH child agents using DSH's existing tools.281MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NanGongWenTian01/dsh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server