description: "MCP client bridge for deployments and maintainers choosing, configuring, or debugging connections to external MCP servers whose tools register on ctx.tools."
English | 中文
dsh-mcp-client lets the model use tools and resources from external Model Context Protocol (MCP) servers. Configure one server per entry; its tools use names such as mcp__github__create_issue. No server is enabled by default. Shipped profiles already provide shared resource discovery and reading. An empty caller scope adds no MCP tools or prompt text. Server instructions join the logged system prompt as literal text; MCP prompt templates are unsupported. Slow or crashed servers can delay startup or fail calls until recovery.
Add dsh-mcp-client when the model should call tools from an external MCP server as if they were native. Give each server a unique name and transport. The official SDK selects the 2026-07-28 protocol when available and falls back to supported legacy revisions. Choose stdio for a local program and Streamable HTTP for a service; stdio negotiation starts a temporary probe process before the serving process.
Add one entry per server; nothing else is required. After the harness starts, the server's tools appear in the model's tool list.
- 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-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}`'
| Field | Default | Meaning |
|---|---|---|
transport |
required | stdio or streamable-http |
serverName |
required | Namespace for the server's tool names; [A-Za-z0-9_-]{1,32}, unique inside one registration scope |
command / args / env / cwd |
— | stdio: executable, arguments, extra env merged over scrubbed ambient env, working directory |
url / headers |
— | streamable-http: endpoint URL and extra request headers |
toolCallTimeoutMs |
60,000 |
Timeout per tools/call or resource request |
maxInstructionBytes |
32,768 |
Maximum UTF-8 bytes of server instructions including attribution; an oversized value rejects the connection |
failOnStartupError |
false |
Reject plugin activation when the initial connection or tool synchronization fails |
reconnect.enabled |
true |
Reconnect automatically after a lost connection |
reconnect.initialDelayMs |
500 |
First reconnect delay; doubles per consecutive failed attempt |
reconnect.maxDelayMs |
30,000 |
Backoff ceiling; also the uptime after which the attempt budget resets |
reconnect.maxAttempts |
10 |
Consecutive failed attempts per outage before giving up |
The generated configuration catalog is the exhaustive source for every accepted field.
After startup, the server's tools appear as mcp__<serverName>__<tool> — try a prompt that uses one. If the initial connection fails, the harness still starts but no tools from that server appear, and an error is logged. Setting failOnStartupError: true rejects plugin activation; app-boot's startup policy still permits an optional MCP entry to fail without aborting the harness.
The model sees each tool under a stable server-qualified name: mcp__<serverName>__<rawName>, for example mcp__github__create_issue — the same naming shape Claude Code and Codex use. Names stay stable while the server keeps the same tool name, so session history and permission rules survive restarts and reloads. Two servers can both offer a tool named search and coexist as mcp__github__search and mcp__web__search.
search) coexist under their own namespaces.When the model calls an MCP tool, the call runs against the remote server with a per-call timeout (default 60 seconds) and can be cancelled like any other tool call. The result comes back as ordinary text in block order; resource links appear as text with their name and URI. If the server reports an error, the call fails visibly — the model does not see a fake success.
Images are supported when the current model accepts image input and the harness attachment feature is enabled; they then appear in the conversation like other images. Otherwise — and for audio or embedded resources — the model sees a clear diagnostic message instead of nothing.
The server's tools appear before the harness starts its first turn. When the server changes its tool list, the model's tool set updates automatically; if the update fails, the previous tool set keeps working.
When a server connection drops — for example a local server process crashes — the plugin reconnects automatically with delays that double from 500 ms up to 30 s and then refreshes the tool set; reconnect progress is visible in the logs. During an outage the last known tools stay listed but calls to them fail until the server recovers. After ten consecutive failed attempts the server's tools are removed and reconnection stops until you reload the configuration or restart the harness; a server that stays connected for a while resets that counter. Set reconnect.enabled: false to disable automatic reconnection — tools then stay listed but fail until you reload. Editing the configuration entry reloads the server connection in place, and unchanged names stay unchanged.
Read these pages when the package-level contract is not enough. They move from the shared tool registry to the bridge's design evidence and worked example configurations.
ToolRuntime and ctx.tools.register() contract that receives the bridged tools.After discovery succeeds, SDK-admitted MCP tools appear as native tools named mcp__<serverName>__<rawName> (or their deterministic normalized form), with the server description and input schema. A re-sync replaces the generation; disposal or an exhausted reconnect budget removes it. A server without the tools capability connects with an empty tool set.
The tool descriptions and input schemas enter every request while the tools are registered; re-syncs replace rather than accumulate schemas, and the server-qualified name adds tokens to every tool definition and call. A configured client also enables the shared resource tools and server-name prompt.
The tool-definition prefix stays stable while the discovered set and schemas are unchanged. A re-sync that adds, removes, renames, or changes a tool replaces definitions and may invalidate reuse from the first changed schema token onward; a reconnect that recovers an unchanged list reproduces identical definitions and stays prefix-stable.
The public tool name and JSON arguments remain in assistant history. The canonical value retains the complete MCP JSON blocks and optional structured content for programmatic and PTC mode callers; supported image blocks project beside text in their original order after exact route-capability proof. Refused images, audio, embedded resources, resource links, and unknown blocks remain visible as bounded text diagnostics, and MCP isError rejects the call before image persistence.
Arguments, mapped text, and durable image references are retained until compaction. Inline MCP base64 stays only in the execution-local canonical value and is never copied into a session event; the provider reads verified bytes from the attachment store. Audio and embedded-resource payloads stay out of model context.
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
One server-labeled section contains the nonblank instructions returned by each successful connection. Absent or blank instructions add no prompt text. Braces remain literal. A replacement connection publishes its instructions only after discovery succeeds; disposal or exhausted recovery removes the section.
Server instructions contribute text to model requests while their scoped section is active. Resource documents enter history only through explicit resource reads.
Unchanged instructions retain identical prompt text. Updated or removed instructions change the next assembled system message and its reusable prefix.
These limits describe what you cannot do with this plugin and when it needs operational attention. They are current package constraints, not a comparison with other MCP clients or a task backlog.
toolResult substitutes or bypass advertised schema validation.