dsh-tools-mcp
dsh-tools-mcp
Извлекает и оборачивает инструменты минимального режима (minimal) и стандартного режима (standard) из deepseek-harness (открытый agent harness от DeepSeek AI) в сервер MCP (Model Context Protocol), управляя тем, какой набор инструментов будет доступен, через параметр --mode.
Схемы инструментов, описания и выходные обёртки (например, формат
<path>/<type>/<content>дляread, семантика view/create/str_replace/insert дляstr_replace_editor, маркер[exit code: N]) точно воспроизведены из файлаapps/cli/config/agent-presets/{minimal,standard}/agent.cordis.ymlисходного репозитория и соответствующих реализацийpackages/*/tool-*.
Режимы и соответствие инструментов
Режим | Параметр | Инструменты |
Минимальный режим |
| Постоянный shell ( |
Стандартный режим |
|
|
Стандартный режим также поддерживает --with-web-fetch для дополнительного раскрытия web_fetch (в оригинальном стандартном пресете по умолчанию fetch: false).
Related MCP server: deepseek-agent-mcp
Быстрый старт
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-клиента
// 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"]
}
}
}Обе точки входа можно зарегистрировать одновременно, выбирая минимальный/стандартный набор инструментов по необходимости.
Все параметры
--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
--tools принимает имена инструментов или наборов, раскрывая подмножество по необходимости:
# 只要文件相关
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Имена наборов: shell (постоянный shell), one-shot, fs, search, jobs, todo, web, ask-user, goal, plan, skill.
Примечания по дизайну
Постоянный shell: без зависимости от node-pty, использует stdio-каналы для управления долгоживущим дочерним процессом
bash/powershell; команды оборачиваются маркерами со случайным UUID для надёжного захвата статуса завершения и кода выхода; состояниеcd/exportсохраняется между вызовами; автоматический сброс при таймауте или выходе из shell (семантика соответствует оригинальномуtool-bash-persistent).Безопасность путей: по умолчанию файловые инструменты разрешают доступ только к путям внутри рабочей области
--cwd; при выходе за пределы выдаётся ошибка с подсказкой добавить--allow-outside-root.web_search по умолчанию использует DuckDuckGo (без ключа); для сетей в Китае рекомендуется
--proxy http://127.0.0.1:7897или замена на--search-provider tavily --search-api-key <key>.Всё состояние внутри процесса (на уровне сессии): состояние todo/goal/plan/фоновых задач привязано к жизненному циклу процесса сервера и очищается при перезапуске — эквивалентно «состоянию уровня сессии» оригинала.
Отличия от оригинального dsh (явное пояснение)
Пункт | Оригинальный dsh | Данная MCP-обёртка |
Постоянный shell | Терминал PTY node-pty | Долгоживущий процесс через stdio-каналы (без интерактивного приглашения, состояние эквивалентно) |
| Мост вопросов в UI dsh | При MCP stdio невозможна синхронная интеракция; возвращает текст вопроса и указывает модели пересказать его пользователю |
| Поток утверждения в UI | Флаг на сервере + возврат текста плана |
subagent_*/workflow/ralph | Зависит от рантайма dsh (LLM-субагенты, движок рабочих процессов) | Не обёрнуты — требуется полный рантайм dsh, см. ниже |
Движок grep | Встроенный бинарник ripgrep | Реализация на node-регулярных выражениях (эквивалентна для распространённого синтаксиса, часть возможностей ripgrep не поддерживается) |
Не обёрнутые инструменты (инструменты, связанные с рантаймом в оригинальном standard preset, требуют полный dsh runtime): subagent_control, list_agents, subagent, subagent_fork, workflow, ralph. Если нужны эти возможности, используйте сам deepseek-harness.
Тестирование
npm run build
npm test # 冒烟测试:两种模式工具暴露 + 核心工具行为 + --tools 覆写
node scripts/state-test.mjs # 持久 shell 状态保持 / 退出码 / 优雅重置(PROXY=... 可测 web_search)
node scripts/bash-test.mjs # bash 后端验证Ссылки на исходный код
Извлечено из deepseek-ai/deepseek-harness (лицензия MIT, ветка master):
Определения режимов:
apps/cli/config/agent-presets/minimal/agent.cordis.yml,.../standard/agent.cordis.ymlРеализации инструментов:
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и др.
Available Tools
2 toolsbashA
Run commands in a persistent shell. State, including the current directory and exported environment variables, persists across calls for this agent.
You don't have access to the internet via this tool.
State is persistent across command calls and discussions with the user.
To inspect a particular line range of a file, e.g. lines 10-25, try 'sed -n 10,25p /path/to/the/file'.
Please avoid commands that may produce a very large amount of output.
Please run long lived commands in the background, e.g. 'sleep 10 &' or start a server in the background.
Inputs: command (required).
str_replace_editorA
Custom editing tool for viewing, creating and editing files
State is persistent across command calls and discussions with the user
If
pathis a file,viewdisplays the result of applyingcat -n. Ifpathis a directory,viewlists non-hidden files and directories up to 2 levels deepThe
createcommand cannot be used if the specifiedpathalready exists as a fileIf a
commandgenerates a long output, it will be truncated and marked with<response clipped>
Notes for using the str_replace command:
The
old_strparameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!If the
old_strparameter is not unique in the file, the replacement will not be performed. Make sure to include enough context inold_strto make it uniqueThe
new_strparameter should contain the edited lines that should replace theold_str
Inputs: path (required), command (required), new_str, old_str, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
Both tools are generic and overlap heavily in purpose: bash executes commands, while str_replace_editor edits files—but an agent could easily misuse bash for file edits (it can) or misuse str_replace_editor for shell commands (it cannot). The boundary is unclear, and each tool's descriptions do not clearly delineate when to use one over the other.
The names 'bash' and 'str_replace_editor' follow no consistent convention; one is a single-word executable name, the other is a multi-underscore compound. There is no verb_noun pattern, and the names are descriptive but not aligned. However, they are not chaotic, so a score of 2 is appropriate.
With only two tools, the server feels under-scoped for a general-purpose 'dsh-tools' server. Two tools can be sufficient if they cover the domain, but here the domain is broad (shell + file editing), and the count is too low to be considered well-scoped for the apparent purpose.
The tool surface lacks any file reading dedicated tool, any process management tool, or any other common operations. While bash can compensate, there are no explicit tools for listing files, searching, or managing processes. The set is far from covering typical developer tasks, though it covers the basics of shell and file editing.
Related MCP Connectors
Hosted MCP server and Agent Skills for specs, engineering threads, and project memory.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that wraps DeepSeek's AI capabilities into standard MCP tools, supporting three authentication modes including free web-based usage without API keys.63MIT
- AlicenseAqualityDmaintenanceMCP server that packages DeepSeek agents as callable tools, offering a bare model for quick Q&A and a full agent capable of executing real coding and file-modifying tasks in a workspace.2MIT
- AlicenseNot gradedqualityCmaintenanceTurns DeepSeek Harness into an MCP server with tools for session management, agent execution, resources, and OAuth, plus browser automation and GitHub/GitLab integration.30 npm20MIT
- AlicenseNot gradedqualityCmaintenanceMCP server bridging ChatGPT to DeepSeek Harness, exposing 13 tools for task submission, status tracking, result retrieval, project/session management, and human-in-the-loop approvals.4MIT