dsh-mcp-server
dsh-mcp-server
通过 Model Context Protocol,将 DeepSeek Harness 的 Agent(dsh,一个编码 Agent,自带完整工具集:文件、终端、网页搜索、子代理、工作流)暴露为一个本机可用的模型后端,同时暴露一个“读懂我 / 改造我”的接口。
┌────────────────────────────┐ 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 模型额度;对方模型把结果读进自己的上下文,消耗对方自己的额度):
接口 | 类型 | 说明 |
| 工具 | 完整设计快照:后端模型 / 版本、记忆、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。服务器只监听本机(127.0.0.1)。
切换模型(方向 B 的典型用法)
默认模型来自 dsh 的 agent-default-model(本机 deepseek-official / system)。改法:
用
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