NexusAgentX/dsh-mcp-adapter0

dsh-mcp-adapter

DeepSeek Harness 的 MCP 适配器:通过单一代理工具连接 MCP 服务,避免上下文窗口浪费

AI 分析

核心用途是提供一个 `mcp` 代理工具,按需调用 MCP 服务,防止将所有 MCP 架构一次性载入上下文。适合需要连接多个 MCP 服务且关注 Token 消耗的用户。

套件
dsh-mcp-adapter
版本
0.1.0
授權
MIT
最近更新
2026年8月14日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:NexusAgentX/dsh-mcp-adapter

dsh-mcp-adapter

Use MCP servers with DeepSeek Harness without burning the context window.

One mcp proxy tool. Lazy server start. On-demand search / describe / call.

English | 中文

Why this exists

DeepSeek Harness already ships @deepseek-ai/dsh-mcp-client. That client connects at startup and registers every advertised MCP tool as a native mcp____ function. Schema cost is paid on every request.

This adapter follows the pi-mcp-adapter contract instead:

  • one mcp proxy tool instead of hundreds of schemas
  • lazy server start
  • on-demand search / describe / call
  • standard .mcp.json / ~/.config/mcp/mcp.json discovery
  • optional directTools promotion for hot-path tools
  • metadata cache so search works before a live connect

It is an independent plugin. It is not affiliated with DeepSeek AI.

Do not mount this adapter and @deepseek-ai/dsh-mcp-client against the same servers. They would double-connect and fight over names.

Install

dsh plugin --profile web add dsh-mcp-adapter

Restart the profile (dsh web / dsh tui) after install.

Quick start

Preferred project config: .mcp.json

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp@1.6.0"]
    }
  }
}

Then:

mcp({ search: "screenshot" })
mcp({ describe: "chrome-devtools_take_screenshot" })
mcp({ tool: "chrome-devtools_take_screenshot", args: { format: "png" } })

args can be a JSON object or a JSON string.

Config files

FilePurpose
~/.config/mcp/mcp.jsonUser-global shared MCP config
~/.agents/mcp.jsonUser-global tool-agnostic MCP config
~/.agents/mcp/mcp.jsonUser-global tool-agnostic MCP config
.mcp.jsonProject-local shared MCP config
$DSH_HOME/mcp.jsondsh global override (~/.dsh/mcp.json by default)
.dsh/mcp.jsondsh project override

Later files win. /mcp disable and /mcp enable write only the disabled field to .dsh/mcp.json. They never copy credentials.

Host-specific configs (Cursor, Claude Code, Codex, OpenCode, Windsurf, VS Code) are detected by dsh-mcp-adapter init and /mcp list. They are not loaded unless you set settings.hostConfigDiscovery to "on" or list them in imports.

{
  "imports": ["cursor"],
  "settings": {
    "hostConfigDiscovery": "off",
    "toolPrefix": "server",
    "idleTimeout": 10
  },
  "mcpServers": {}
}

Server options

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "some-mcp-server"],
      "lifecycle": "lazy",
      "idleTimeout": 10,
      "requestTimeoutMs": 30000,
      "directTools": ["search"],
      "includeTools": ["search", "get_*"],
      "excludeTools": ["admin_*"],
      "searchKeywords": {
        "search": ["find", "lookup"]
      }
    }
  }
}
FieldMeaning
lifecyclelazy (default), eager, keep-alive, lazy-keep-alive
idleTimeoutMinutes before an idle lazy server is closed (default 10, 0 disables)
directToolstrue or a name list — register those tools as native dsh tools
url / headers / bearerToken / bearerTokenEnvStreamable HTTP; SSE fallback on 404/405
disabledKeep the entry visible but do not connect

Human command

/mcp
/mcp list
/mcp connect 
/mcp enable 
/mcp disable 

CLI

dsh-mcp-adapter init
dsh-mcp-adapter status

Status

Piece0.1.0
mcp proxy toolyes
.mcp.json merge + host discoveryyes
lazy / eager / keep-aliveyes
metadata cacheyes
/mcp commandyes
directToolsyes
resources as read_* toolsyes
output guardyes
OAuth browser flownot yet — use headers / bearerToken
MCP prompts / elicitation / sampling / UI appsnot yet

License

MIT

Inspired by pi-mcp-adapter (MIT). See NOTICE.


中文

DeepSeek Harness 用的 MCP 适配器:一个代理工具,按需搜索 / 描述 / 调用,而不是把每个 MCP schema 都塞进上下文。机制对齐 pi-mcp-adapter

dsh plugin --profile web add dsh-mcp-adapter
{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp@1.6.0"]
    }
  }
}
mcp({ search: "screenshot" })
mcp({ tool: "chrome-devtools_take_screenshot", args: { format: "png" } })