DSH (DeepSeek Harness) typically configures MCP servers in cordis.patch.yml, which causes all sessions under the same configuration file to share the same MCP servers. When a specific project needs specific MCP services (such as Rider, Playwright, or Tracker), this global configuration approach can cause interference. The dsh-project-mcp plugin introduces a project-level configuration plane, allowing projects to declare MCP servers locally. These servers are effective only for sessions working within that project.
This plugin is maintained by user borgez and licensed under the MIT License. It reads configuration files in the project root and mounts MCP servers declared in localFiles into sessions, achieving configuration isolation and on-demand loading.
Installation and Activation¶
To install the plugin, you must first build or package it, then add it to the Web GUI configuration using the dsh plugin command.
pnpm pack
mv dsh-project-mcp-<version>.tgz ~/.dsh/packages/
dsh plugin --profile web add file:$HOME/.dsh/packages/dsh-project-mcp-<version>.tgz
After installation, you must restart the Web GUI for it to take effect.
Configuration Files and Priority¶
By default, the plugin reads the .dsh/mcp.json file in the project root. You can control the order and scope of files to read by configuring localFiles and globalFiles.
globalFiles: Lists global documents read before project files. Defaults to an empty list[].localFiles: Lists the project’s own documents. Defaults to['.dsh/mcp.json'].
The read order follows the principle that global files are read before local files. If multiple documents contain servers with the same name, the later-read document overrides the earlier configuration.
// <project>/.dsh/mcp.json
{
"mcpServers": {
"rider": {
"type": "http",
"url": "http://127.0.0.1:64343/stream",
"headers": { "IJ_MCP_SERVER_PROJECT_PATH": "/abs/path/to/project/src/App" }
},
"playwright": { "command": "npx", "args": ["-y", "@playwright/mcp@latest"] },
"tracker": {
"command": "uvx",
"args": ["yandex-tracker-mcp@latest"],
"env": { "TRACKER_TOKEN": "${YANDEX_TOKEN}" }
}
}
}
Variables and Environment Variables¶
The plugin supports variable substitution in configuration using ${VAR} and ${input:NAME} syntax. The lookup order for these variable values is as follows:
<project>/.dsh/.env(requiresenvFilesto be enabled)<project>/.env(requiresenvFilesto be enabled)process.env- The
KEYin the credentials file (defaults to$DSH_HOME/.credentials.yaml)
Variables can be used in command, args, env, cwd, url, and headers. If the value is not defined in an environment variable or .env file, that configuration item will produce an error. The plugin does not write resolved values back to the editor.
Session Behavior¶
- Lazy loading: Enabled by default. The project’s MCP servers are mounted only when a session starts working (the first time a step is executed). This avoids initialization overhead at session creation.
- Idle release: If a session has no activity for the specified duration (default 300000ms), the plugin releases the MCP mounts for that session.
- Error handling: A corrupted line in a configuration file does not prevent other servers from being mounted. Corrupted entries are displayed with an
errorstatus.
Notes¶
- Sensitive files: When
envFilesistrue, the plugin reads the.envand.dsh/.envfiles in the project root. These files contain sensitive information and should not be committed to version control. - Server name restriction: The name of an MCP server must match the regular expression
[A-Za-z0-9_-]{1,32}; otherwise, it is automatically handled and a warning is issued. - Configuration format: The formats
{ "mcpServers": { ... } },{ "servers": { ... } }, or a direct object mapping are supported. Unknown fields are ignored.
Summary¶
dsh-project-mcp provides project-level MCP server management for DSH. By using local configuration files, variable substitution, and a lazy-loading mechanism, it addresses the challenge of sharing and isolating MCP services in multi-project development. In scenarios where multiple projects must be managed in a single DSH instance and each project depends on different MCP tools, this plugin provides a direct solution.