DSH Toolbox

MCP servers in DeepSeek Harness

An MCP server becomes a set of native tools named mcp__<serverName>__<toolName>. The model calls them like any other tool; nothing about the call path is special.

Two packages ship in every profile: dsh-mcp-client bridges a server, dsh-mcp-resources reads its resources. No server is enabled by default — an empty configuration adds no tools and no prompt text.

Configuration goes in the profile patch file, one entry per server. If a server fails to connect, the harness still starts; that server's tools simply do not appear, and the failure is logged.

The minimal entry

One entry, one server. serverName is the namespace that prefixes every tool it publishes, so it has to be unique inside one registration scope.

- 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

Two transports

stdio runs a local program and talks over its pipes. streamable-http talks to a service. For stdio, command, args, env and cwd apply; for HTTP, url and headers do.

A stdio server is probed with a temporary process during negotiation before the serving process starts, so a broken command shows up at startup rather than at the first call.

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

How tools are named

A tool called create_issue on the server named github becomes mcp__github__create_issue. The remote serverInfo.name is never used — it is untrusted and can change between versions.

Two servers may both publish search; they coexist as mcp__github__search and mcp__web__search. Two entries using the same serverName do not: the later one fails to load.

The plain shape is not universal. A name that cannot survive the function-name contract — 64 characters at most, [A-Za-z0-9_-] — is normalized lossily and a 12-character SHA-256 digest is appended, so two different tools never collapse into one name. Long tool names therefore do not read as mcp__server__tool.

The environment rule that catches people

A stdio child does not inherit your shell unchanged. Every ambient variable whose name contains KEY, PASSWORD, SECRET or TOKEN as a substring is dropped — that includes MAX_TOKENS and TOKENIZER_PATH, not just whole words — along with every DSH_* name, before the configured env is merged on top.

So GITHUB_TOKEN in your shell does nothing here. It has to be written into env explicitly, as in the first example. This is deliberate: it keeps a stray secret from reaching a third-party process you just downloaded.

When a server is slow, or dies

Calls time out at 60 seconds by default (toolCallTimeoutMs). Reconnection is on by default: the first retry waits 500 ms, the delay doubles up to 30 seconds, and after ten consecutive failures the tools are withdrawn until you reload the configuration.

That ten is not a lifetime score. A connection that stays up longer than the 30-second ceiling resets the attempt budget, so a server that flaps once a day never exhausts it.

failOnStartupError: true is the opposite posture — a server that cannot connect rejects plugin activation instead of starting with a missing tool set. Leave it off unless the profile is useless without that server.

Serving a large tool set without paying for it every turn

Every registered tool's definition enters every request. For a server with dozens of tools, set toolLoading: on-demand: the system prompt then lists each tool's name and first line only, and the model loads what it needs through mcp__<serverName>__load_tools.

A loaded tool joins only the agent that loaded it — subagents and resumed sessions start without it.

    toolLoading: on-demand
    catalogDescriptionMaxLength: 160

Verifying it actually connected

The composed profile lists the plugin entry; the log carries the connection result. Then ask the model to use one tool that only that server provides.

dsh --profile web --dump-config | grep -A 4 mcp

Two limits worth knowing before you plan around them

MCP prompt templates are not supported. Server instructions are passed through as literal text; the template mechanism is not. Those instructions are also capped at 32,768 UTF-8 bytes — a longer value rejects the connection instead of being truncated.

OAuth entries need a browser that reaches the DSH host server directly on its own bind address and port. A browser that only reaches DSH through a proxy or a reverse proxy cannot finish the authorization callback.

Common questions

Does adding a server cost tokens on every request?

Yes, while its tools are registered: every tool description and input schema enters each request, and the server-qualified name adds tokens to every definition and call. toolLoading: on-demand replaces that cost with one catalog line per tool until an agent loads it.

What happens when a server crashes mid-session?

The last known tools stay listed but calls to them fail until the server comes back. After ten consecutive failed reconnect attempts the tools are removed and reconnection stops until you reload the configuration or restart the harness.

Can I point two entries at the same server?

Not with the same serverName — the second entry fails to load with a clear error. Give it a different name and the two tool sets coexist under separate prefixes.