Skip to main content
Glama

dsh-tools-mcp

Extrae y envuelve las herramientas de los modos mínimo (minimal) y estándar (standard) de deepseek-harness (el agent harness de código abierto de DeepSeek AI) como un servidor MCP (Model Context Protocol), controlando mediante el parámetro --mode qué conjunto de herramientas se expone.

El schema de las herramientas, los textos descriptivos y el envoltorio de salida (como el formato <path>/<type>/<content> de read, la semántica view/create/str_replace/insert de str_replace_editor y el marcador [exit code: N]) se reproducen fielmente desde apps/cli/config/agent-presets/{minimal,standard}/agent.cordis.yml del repositorio original y sus implementaciones correspondientes en packages/*/tool-*.

Correspondencia de modos y herramientas

Modo

Parámetro

Herramientas

Modo mínimo

--mode minimal

Shell persistente (bash en POSIX, pwsh en win32, el estado se mantiene entre llamadas) + str_replace_editor

Modo estándar

--mode standard

bash/pwsh (ejecución única), 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

El modo estándar también admite --with-web-fetch para exponer adicionalmente web_fetch (el preset estándar original tiene fetch: false por defecto).

Related MCP server: deepseek-agent-mcp

Inicio rápido

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

Configuración del cliente 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"]
    }
  }
}

Ambas entradas pueden registrarse simultáneamente, eligiendo el conjunto de herramientas mínimo o estándar según se necesite.

Todos los parámetros

--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

Sobrescritura con --tools

--tools acepta nombres de herramientas o de suites, para exponer un subconjunto según se necesite:

# 只要文件相关
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

Nombres de suites: shell (shell persistente), one-shot, fs, search, jobs, todo, web, ask-user, goal, plan, skill.

Notas de diseño

  • Shell persistente: sin dependencia de node-pty, utiliza tuberías stdio para manejar un subproceso bash/powershell de larga duración; los comandos se envuelven con un UUID aleatorio como marcador para capturar de forma fiable el estado de finalización y el código de salida; el estado de cd/export se mantiene entre llamadas; se reinicia automáticamente en caso de timeout o salida del shell (coherente con la semántica del tool-bash-persistent original).

  • Seguridad de rutas: por defecto, las herramientas de archivos solo permiten acceder a rutas dentro del área de trabajo --cwd; si se sale de los límites, se muestra un error sugiriendo añadir --allow-outside-root.

  • web_search usa DuckDuckGo por defecto (sin clave); para redes domésticas se recomienda --proxy http://127.0.0.1:7897, o cambiar a --search-provider tavily --search-api-key <key>.

  • El estado es solo en proceso (nivel de sesión): el estado de todo/goal/plan/tareas en segundo plano sigue el ciclo de vida del proceso del servidor y se borra al reiniciar, equivalente al "estado a nivel de sesión" del original.

Diferencias con el dsh original (explicación explícita)

Elemento

dsh original

Este envoltorio MCP

Shell persistente

Terminal PTY node-pty

Proceso de larga duración con tubería stdio (sin prompt interactivo, estado equivalente)

ask_user_question

Puente de preguntas de la UI de dsh

En MCP stdio no se puede interactuar de forma síncrona; devuelve el texto de la pregunta e indica al modelo que la transmita al usuario

plan_mode/exit_plan_mode

Flujo de aprobación de la UI

Indicador en el servidor + devolución del texto del plan

subagent_*/workflow/ralph

Depende del runtime de dsh (subagentes LLM, motor de workflows)

No envuelto — requiere el runtime completo de dsh, ver más abajo

Motor de grep

Binario ripgrep integrado

Implementación con regex de node (equivalente para sintaxis común, algunas características de ripgrep no soportadas)

Herramientas no envueltas (herramientas acopladas al runtime del preset estándar original, requieren el runtime completo de dsh): subagent_control, list_agents, subagent, subagent_fork, workflow, ralph. Si se necesitan estas capacidades, use directamente deepseek-harness.

Pruebas

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

Referencia del código fuente

Extraído de deepseek-ai/deepseek-harness (licencia MIT, rama master):

  • Definición de modos: apps/cli/config/agent-presets/minimal/agent.cordis.yml, .../standard/agent.cordis.yml

  • Implementación de herramientas: 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.

Available Tools

2 tools
bashA

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 path is a file, view displays the result of applying cat -n. If path is a directory, view lists non-hidden files and directories up to 2 levels deep

  • The create command cannot be used if the specified path already exists as a file

  • If a command generates a long output, it will be truncated and marked with <response clipped>

Notes for using the str_replace command:

  • The old_str parameter should match EXACTLY one or more consecutive lines from the original file. Be mindful of whitespaces!

  • If the old_str parameter is not unique in the file, the replacement will not be performed. Make sure to include enough context in old_str to make it unique

  • The new_str parameter should contain the edited lines that should replace the old_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

    A3.8/5.0

    Scored across 2 tools

    Disambiguation1/5

    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.

    Naming Consistency2/5

    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.

    Tool Count2/5

    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.

    Completeness2/5

    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

    Related MCP Servers

    Appeared in Searches