Skip to main content
Glama

dsh-tools-mcp

Extract and wrap the tools from minimal mode and standard mode in deepseek-harness (DeepSeek AI's open-source agent harness) as an MCP (Model Context Protocol) server, with the --mode parameter controlling which tool set is exposed.

The tool schemas, description texts, and output envelopes (such as the <path>/<type>/<content> format of read, the view/create/str_replace/insert semantics of str_replace_editor, and the [exit code: N] marker) are all faithfully reproduced from the original repository's apps/cli/config/agent-presets/{minimal,standard}/agent.cordis.yml and its corresponding packages/*/tool-* implementations.

Mode and Tool Mapping

Mode

Parameter

Tools

Minimal mode

--mode minimal

Persistent shell (bash on POSIX, pwsh on win32, state maintained across calls) + str_replace_editor

Standard mode

--mode standard

bash/pwsh (single execution), read, write, edit, read_image, glob, grep, job_output/job_list/job_kill, todo_write, ask_user_question, web_search, get_goal/create_goal/update_goal, plan_mode/exit_plan_mode, skill

Standard mode also supports --with-web-fetch to additionally expose web_fetch (the original standard preset defaults to fetch: false).

Related MCP server: deepseek-agent-mcp

Quick Start

cd dsh-tools-mcp
npm install
npm run build          # 输出到 dist/

# 极简模式
node dist/index.js --mode minimal --cwd D:/develop/project/dsh-tools-mcp

# 标准模式
node dist/index.js --mode standard --cwd D:/develop/project/dsh-tools-mcp

MCP Client Configuration

// mcp.json / WorkBuddy 自定义连接器
{
  "mcpServers": {
    "dsh-minimal": {
      "command": "node",
      "args": ["D:/develop/project/dsh-tools-mcp/dist/index.js", "--mode", "minimal", "--cwd", "D:/develop/project/dsh-tools-mcp"]
    },
    "dsh-standard": {
      "command": "node",
      "args": ["D:/develop/project/dsh-tools-mcp/dist/index.js", "--mode", "standard", "--cwd", "D:/develop/project/dsh-tools-mcp"]
    }
  }
}

Both entry points can be registered simultaneously, and you can choose the minimal or standard tool set as needed.

All Parameters

--mode <minimal|standard>    Agent 预设模式(默认 minimal)
--cwd <path>                 工作区根目录,文件工具基于它解析相对路径(默认 process.cwd())
--shell <auto|bash|pwsh>     shell 后端;auto = win32 用 pwsh,其余用 bash
--shell-timeout-ms <n>       持久 shell 单条命令超时(默认 300000)
--max-output-chars <n>       输出截断上限(默认 16000)
--skills-dir <path>          启用 skill 工具,扫描该目录下的 SKILL.md 子目录
--search-provider <duckduckgo|tavily|bing>   web 搜索后端(默认 duckduckgo)
--search-api-key <key>       tavily/bing 的 API key
--proxy <url>                web 工具的 HTTP(S) 代理,如 http://127.0.0.1:7897
--with-web-fetch             额外暴露 web_fetch
--allow-outside-root         允许文件工具访问 --cwd 之外的路径(默认禁止)
--tools <a,b,c>              显式指定工具/套件清单覆盖模式(见下)
--help / --version

--tools Override

--tools accepts tool names or suite names to expose a subset as needed:

# 只要文件相关
node dist/index.js --mode standard --tools read,write,edit,glob,grep

# 只要极简模式的编辑器 + 后台任务
node dist/index.js --mode minimal --tools str_replace_editor,job_output,job_list,job_kill

Suite names: shell (persistent shell), one-shot, fs, search, jobs, todo, web, ask-user, goal, plan, skill.

Design Notes

  • Persistent shell: No node-pty dependency; uses stdio pipes to drive a long-running bash/powershell child process; commands are wrapped with random UUID markers to reliably capture completion status and exit codes; state such as cd/export is maintained across calls; automatically resets on timeout or shell exit (consistent with the original tool-bash-persistent semantics).

  • Path safety: By default, file tools only allow access to paths within the --cwd workspace; out-of-bounds access raises an error prompting the use of --allow-outside-root.

  • web_search defaults to DuckDuckGo (no API key required); for users in mainland China, it is recommended to use --proxy http://127.0.0.1:7897, or switch to --search-provider tavily --search-api-key <key>.

  • All state is in-process (session-level): todo/goal/plan/background job state lives with the server process lifecycle and is cleared on restart—equivalent to the original "session-level state."

Differences from the Original dsh

Item

Original dsh

This MCP wrapper

Persistent shell

node-pty PTY terminal

stdio pipe long-running process (no interactive prompt, state maintained equivalently)

ask_user_question

dsh UI question bridge

Synchronous interaction is not possible under MCP stdio; returns the question text and instructs the model to relay it to the user

plan_mode/exit_plan_mode

UI approval flow

Server-side flag + plan text callback

subagent_*/workflow/ralph

Depends on the dsh runtime (LLM sub-agents, workflow engine)

Not wrapped—requires the full dsh runtime, see below

grep engine

Built-in ripgrep binary

node regex implementation (common syntax is equivalent; some ripgrep features are not supported)

Unwrapped tools (runtime-coupled tools in the original standard preset, requiring the full dsh runtime): subagent_control, list_agents, subagent, subagent_fork, workflow, ralph. For these capabilities, please use the deepseek-harness itself.

Testing

npm run build
npm test          # 冒烟测试:两种模式工具暴露 + 核心工具行为 + --tools 覆写
node scripts/state-test.mjs   # 持久 shell 状态保持 / 退出码 / 优雅重置(PROXY=... 可测 web_search)
node scripts/bash-test.mjs    # bash 后端验证

Source Code Reference

Extracted from deepseek-ai/deepseek-harness (MIT License, master branch):

  • Mode definitions: apps/cli/config/agent-presets/minimal/agent.cordis.yml, .../standard/agent.cordis.yml

  • Tool implementations: packages/shell/tool-bash-persistent, packages/fs/tool-str-replace-editor, packages/fs/tool-fs, packages/fs/tool-fs-search, packages/jobs/tool-jobs, packages/todo/tool-todo, packages/web/tool-web, packages/interaction/tool-ask-user, packages/goal/tool-goal, packages/plan/plan-mode, packages/skill/tool-skill, etc.

Install Server
F
license - not found
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

View all MCP Connectors

Latest Blog Posts

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/hqzqaq/dsh-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server