Contents

DeepSeek Harness Practical Guide

DeepSeek Harness (dsh) is DeepSeek’s MIT-licensed agent runtime. Instead of shipping a closed coding client, it treats the execution loop, tool registry, context compactor, model adapters, and UI surfaces as composable plugins on top of the Cordis kernel—meaning most customization is a YAML patch rather than a fork.

Skipping framework theory, the real work in dsh (v0.2) comes down to exact CLI commands, layered configuration, MCP wiring pitfalls, and reusing existing .claude/ setups cleanly.

Four Ways to Run dsh

dsh separates frontends and execution setups by profile, so Web UI, terminal sessions, and headless automation stay cleanly isolated:

# 1. Spin up the local Web UI with no global install (defaults to http://127.0.0.1:3080)
npx @deepseek-ai/dsh web

# 2. Launch Web profile on a custom port
dsh --profile web --port 8080

# 3. Interactive terminal mode resuming an existing session
dsh --profile tui --resume <session_id>

# 4. Headless mode for scripts and CI (prints output and exits with code 0)
dsh --profile headless "Run integration tests and summarize root causes for any failures"

If you prefer a standalone app over managing terminal processes, official packaged desktop builds for macOS (Apple Silicon) and 64-bit Windows are available on GitHub Releases, wrapping the Web UI and local runtime in Electron.

Two early gotchas to avoid:

  • In the Web UI and desktop app, select a scoped project directory as your workspace before sending a task (tasks cannot dispatch without one, and mounting $HOME exposes too much surface).
  • Because dsh ships rapidly, npm’s latest and pre-release tags can lag behind docs—run dsh --version against Releases whenever a flag behaves unexpectedly.

Presets, Layered Patches, and Custom Model Providers

Built-in presets (commonly surfaced as Minimal, Standard, Code/PTC, and Creator) bundle different default toolsets—such as filesystem access, persistent terminal execution, and string-replace editors—so you can switch modes without rewriting system prompts.

Configuration merges across three layers:

  1. Built-in profile defaults;
  2. User-level patch at $DSH_HOME/cordis.patch.yml (default ~/.dsh/cordis.patch.yml);
  3. Session or project overlays passed via --patch.

To route a custom gateway or OpenAI-compatible endpoint through the same UI without hardcoding keys:

llm-pi-ai:
  providers:
    custom-gateway:
      apiKeyEnv: CUSTOM_API_KEY
      api: https://api.example.com/v1

Plugins and MCP Wiring (Watch the stdio Env Filter)

The official MCP client is off by default; add it to your target profile via the built-in plugin manager:

dsh plugin --profile web add @deepseek-ai/dsh-mcp-client
dsh plugin --profile web remove <plugin-package-name>

Each plugin instance maps to one MCP server, registering discovered tools under mcp__<serverName>__<rawToolName>. Both local stdio subprocesses and remote streamable-http endpoints are supported in cordis.patch.yml:

- id: mcp-github
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: github
    transport: stdio
    command: npx
    args: ['-y', '@modelcontextprotocol/server-github']
    env:
      GITHUB_TOKEN: !!js process.env.GITHUB_TOKEN

- id: mcp-internal
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: internal
    transport: streamable-http
    url: http://localhost:3000/mcp
    headers:
      Authorization: !!js '`Bearer ${process.env.MCP_TOKEN}`'

The #1 debugging trap with stdio MCP servers: For safety, dsh automatically strips host environment variables whose names contain KEY, TOKEN, SECRET, or PASSWORD before spawning stdio subprocesses. Even if GITHUB_TOKEN is exported in your shell, the MCP server will see nothing unless you explicitly pass it through with !!js process.env.GITHUB_TOKEN as shown above.

Reusing Existing .claude/ Repository Assets

If your repository already maintains a .claude/ directory (skills, custom commands, rules, hooks, .mcp.json) following Claude Code Best Practices, you do not need to duplicate those instructions. Community bridge dsh-claude-compat loads them directly into dsh, and extensions such as Codex Connect let you compare external coding models side by side in the same selector.

Where It Fits—and Where It Doesn’t Yet

  • Strong fit: An open-source multi-model local workbench, a low-friction harness for benchmarking open models against your existing .claude/ and MCP setup, or an MIT-licensed chassis for building custom desktop/internal agents.
  • Skip for now: Per SAFETY.md, dsh has not undergone a full security audit, and installing third-party plugins executes code directly on your machine. Keep it away from shells holding production database secrets or unattended cloud ops; for daily production PR shipping, Claude Code and Codex remain more battle-tested.

References