How to Add an MCP Server to DeepSeek Harness
To add MCP to DeepSeek Harness, install the MCP server yourself, then add one @deepseek-ai/dsh-mcp-client row that names the server and its transport, load that row as a Cordis overlay, and check that tools named mcp__<serverName>__<tool> appear.
Can DeepSeek models use MCP?
Yes, through the harness. A DeepSeek model does not connect to an MCP server on its own. DSH holds the connection, discovers the server's tools, and lists them for the model as ordinary tools. Each tool keeps the server's description and input schema. When the model calls one, DSH sends the call to the server and returns the result as tool output.
The README of the @deepseek-ai/dsh-mcp-client package in the DeepSeek Harness repository describes this bridge. Its main points for a first setup:
- No MCP server is enabled by default. You add one row per server.
- Tools are named
mcp__<serverName>__<tool>, for examplemcp__github__create_issue. TheserverNamecomes from your config, not from the remote server. - A tool call has a per-call timeout of 60 seconds by default and can be cancelled like other tool calls.
- If the server reports an error, the call fails visibly. The model does not see a fake success.
- Tool descriptions and schemas are sent with every model request while the tools are registered, so a server with many tools adds tokens to each turn.
The naming rules, including what happens when two servers both offer a tool called search, are covered in MCP tool naming.
What do you need before you add MCP to DeepSeek Harness?
DSH does not download, install, or update an MCP server. The memory MCP guide states this directly: DSH starts a configured stdio command or connects to a configured Streamable HTTP URL, and the rest is the server's job. Before you edit any config, have these ready:
- The server itself. For a local server, install the program so its command runs from a terminal. For a remote server, confirm the service is already running and note its MCP endpoint URL.
- A short server name. It must match
[A-Za-z0-9_-]{1,32}and be unique within one registration scope. It becomes the middle part of every tool name. - Any secrets the server needs, such as an API token, kept in environment variables rather than typed into a YAML file.
- A place to load the overlay. That can be a file passed at startup, a profile patch, or the home patch, as described below.
If you would rather install an existing DSH plugin that wraps an MCP server, search the registry at /explore?q=mcp. Being listed there means the repository's manifest passed a structural check. It does not mean anyone reviewed the code, so inspect the source before you install it.
How do you add an MCP server step by step?
The guide's generic row for a local (stdio) server looks like this. Replace the names and command with your own:
- insert:
- id: memory-my-server
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: my-memory
transport: stdio
command: my-memory-mcp
args: []
env: {}
cwd: !!js process.cwd()
For a remote server, the README uses transport: streamable-http with url and headers instead of command, args, env and cwd. Its example reads a bearer token from the environment with a !!js expression instead of a literal string.
- Save the row to a file, for example
my-server.cordis.yml. Give it a uniqueidandserverName. If another row already uses the sameserverName, the later one fails to load with an error. - Try it for one run. Start the Web UI with
dsh web --patch "$PWD/my-server.cordis.yml". The path can point anywhere on disk. Leaving out--patchleaves the server disconnected. - Make it permanent if it works. Merge the
insertentry into$DSH_HOME/profiles/<name>/cordis.patch.ymlfor one profile, or$DSH_HOME/cordis.patch.ymlfor every profile on the machine. Merge rather than copy over the file, because it may already hold other patches you want to keep. - Wait for discovery. Discovery runs in the background. Before your first test prompt, check that the server's
mcp__...tools are listed. - Test one tool. Ask for a task that clearly needs the new tool and confirm the model called it and the result came back without an error.
If the first connection fails, DSH still starts, no tools from that server appear, and an error is logged. Setting failOnStartupError: true makes the plugin's activation fail instead, which is useful when you need to know that the connection did not work.
Should you use stdio or Streamable HTTP for a DeepSeek MCP server?
Pick the transport based on where the server runs. The stdio vs Streamable HTTP post compares them in more detail.
| stdio | Streamable HTTP | |
|---|---|---|
| Good for | A program on the same machine | A service that runs separately |
| Who starts it | DSH launches and stops the child process with the plugin lifecycle | You do; it must already be running |
| Main fields | command, args, env, cwd | url, headers |
| Secrets | Pass through the row's env | Pass through headers |
The stdio bridge removes credential-like environment variables from the child's environment. The README says ambient names matching KEY, PASSWORD, SECRET or TOKEN, plus every DSH_* variable, are dropped before launch. Other variables are still inherited. A server that worked in your terminal can fail under DSH because its token is gone. Add that variable to the row's config.env, reading it from the environment rather than writing the value into the YAML. The steps are in passing environment variables to a stdio MCP server.
For an internal HTTP server behind OAuth, see connecting an internal MCP server with OAuth. If HTTP tool calls start returning 404 after the server drops its session, see MCP HTTP session expired 404.
How do you check that the DeepSeek Harness MCP tools work?
- Tool names. Look for
mcp__<serverName>__tools in the tool list. If none appear, check the log for the startup error, then run the server's command by hand to see whether it starts at all. - A real call. Ask for something only the server can do. A reply in the model's words is not enough; check that the tool call happened and returned content.
- Crashes and reconnects. When a connection drops, the client reconnects with a delay that doubles from 500 ms up to 30 s. During an outage, the tools stay listed but calls fail. After ten failed attempts in a row, the tools are removed until you reload the config or restart DSH.
For a ready-made example, DSH ships default-off reference overlays for three memory servers: Memorix, the MCP reference memory server, and Engram. Each still needs its server installed first. The memory MCP setup post walks through one, including a test that a fresh session can recall a saved value.
What are the limits and safety boundaries?
An MCP server runs code you chose to trust. A stdio server is a local process started with your user's permissions. An HTTP server receives whatever the model sends it. Review the server's source and the access it needs before connecting it, and use the smallest scopes its tokens allow.
Several limits apply to the current client. Server instructions, when a server returns any, are added to the system prompt as literal text, so a server you do not trust can affect the model's behavior through them. MCP prompt templates and resource subscriptions are unsupported. Images can pass through when the model and the attachment feature support them. Audio and embedded resources show up as a short diagnostic message instead.
Keep tokens out of shared config files, screenshots and support logs. Read secrets from environment variables or, with expandTemplates: true, from ${credential:REF} templates, which the README says are redacted from diagnostics. A row that connects successfully proves the transport works. It does not prove the server is safe or that its tools do what their descriptions claim.
Glossary
dsh-mcp-client: the DSH plugin that connects to one MCP server per config row.- Overlay: a Cordis patch file that inserts or changes config rows.
- stdio: a transport where DSH launches the server as a child process.
- Streamable HTTP: a transport where DSH connects to a server that is already running at a URL.
Frequently asked questions
Can DeepSeek models use MCP?
Yes, through DeepSeek Harness. DSH connects to the MCP server, lists its tools for the model as ordinary tools, and forwards the model's tool calls to the server.
Does DeepSeek Harness install the MCP server for me?
No. DSH starts a configured stdio command or connects to a running Streamable HTTP URL. Installing, updating and running the server is your job.
Why does my stdio MCP server lose its API token under DSH?
The stdio bridge removes credential-like environment variables and all DSH_* variables before launching the child. Pass the variable the server needs through the row's config.env.
What are MCP tools called in DeepSeek Harness?
They are named mcp__<serverName>__<tool>, where serverName is the name you set in the config row, for example mcp__github__create_issue.
Sources
Every claim in this article was checked against the sources below. Community discussions are user reports, not official behavior.
This is an independent community article, not official DeepSeek documentation. Listing a plugin in the registry is not a security review.