Skip to main content
Glama
hqzqaq

dsh-minimal-mcp

by hqzqaq

dsh-minimal-mcp

Wrap the model-facing tools of deepseek-harness's minimal mode (minimal agent preset) into an MCP server, so any external agent (Claude Desktop, Trae, Cursor, LangChain, etc.) can connect and call them through the standard MCP protocol.

Minimal mode (apps/cli/config/agent-presets/minimal/agent.cordis.yml) is the official minimal two-tool coding agent provided by deepseek-harness, exposing only two tools:

  • bash — persistent bash (PTY session, sharing cwd / environment variables / functions / background tasks across calls)

  • str_replace_editorview / create / str_replace / insert file editing

This implementation is a self-developed reimplementation aligned with the original semantics (@deepseek-ai/dsh-tool-bash-persistent and @deepseek-ai/dsh-tool-str-replace-editor), without depending on the full harness runtime. It is cross-platform, lightweight, and can run standalone.

Tool semantics (aligned with the original)

bash

  • Real persistent PTY shell; state persists between commands.

  • Non-zero exit codes append a comment: [exit code: N].

  • Output exceeding the limit is truncated and marked <response clipped>.

  • On timeout, returns partial output and resets the shell.

str_replace_editor

  • view: shows files with line numbers in cat -n style; lists non-hidden items in directories, two levels down.

  • create: creates only when the path does not exist, otherwise errors.

  • str_replace: old_str must match uniquely and verbatim; multiple or zero matches error.

  • insert: insert_line is 0-based; insertion does not add an extra trailing newline.

Related MCP server: devcontainer-mcp

Installation and build

pnpm install
pnpm run build

On first install, the postinstall script runs to fix the execution permission of the node-pty prebuilt binary on macOS (if missing, it causes posix_spawnp failed).

Running

node dist/index.js

Environment variables

Variable

Default

Description

DSH_CWD

process.cwd()

Working directory for bash and filesystem tools

DSH_BASH_TIMEOUT_MS

60000

Single-command timeout (milliseconds); on timeout the shell is automatically reset to prevent hanging

DSH_MAX_OUTPUT_CHARS

16000

Maximum characters kept for command / file output

DSH_SHELL

/bin/bash

Shell path used to spawn

Connection configuration

Using Claude / a generic MCP client as an example, add the following to your MCP configuration:

{
  "mcpServers": {
    "dsh-minimal": {
      "command": "node",
      "args": ["/absolute/path/to/dsh-mcp-tools/dist/index.js"],
      "env": {
        "DSH_CWD": "/your/workspace"
      }
    }
  }
}

A single service instance exposes two tools: bash and str_replace_editor, which together are the complete coding capability set of deepseek-harness's minimal mode.

Directory structure

src/
  index.ts   # MCP server 入口,注册两个工具(stdio 传输)
  config.ts  # 环境变量解析与描述文本
  bash.ts    # 持久 bash(node-pty)
  editor.ts  # str_replace_editor
scripts/
  fix-node-pty-perms.mjs  # 安装后修复 node-pty 二进制权限

Notes

  • The transport is stdio (MCP standard, for local agents). It can be extended to streamable-HTTP if needed.

  • The original bash description mentions environment information such as "can access apt/pip packages via mirrors". This implementation keeps that description text, but actual network capability depends on the runtime environment.

F
license - not found
Not graded
quality - not tested
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

  • A
    license
    Not graded
    quality
    B
    maintenance
    A lightweight, stdio-based MCP server enabling AI assistants to perform local file system operations like reading, writing, searching, and executing commands.
    5,309
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

  • 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-mcp-tools-2'

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