hyqhyq3/dsh-mcp-manager7

dsh-mcp-manager

DeepSeek Harness 的 MCP 服务管理器:支持 OAuth/stdio 服务器、工作区隔离以及按需工具代理。

AI 分析

核心用途是图形化管理 MCP 协议服务器。适合需要接入各种外部工具(如本地文件系统、远程 API)以扩展 AI 能力的进阶用户。

包名
dsh-mcp-manager
版本
0.6.0
许可证
MIT
最近更新
2026年8月16日

安装

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

Usage

  1. Open Settings → MCP in the DSH web UI.
  2. + Add MCP server (and later 编辑 / Edit to change it):
    • Scope (作用域): user — a global server available in every workspace; or workspace — a server bound to one workspace (its config lives in that workspace's .dsh/dshmm/mcp.json). Pick the workspace from the second dropdown.
    • HTTP: name (becomes the mcp____* prefix), URL, auth mode (OAuth or static token), and optional headers (headers direct values, headerEnv values read from env vars).
    • stdio: name, command (e.g. npx), args (one per row), env vars (key/value rows), and optional working directory.
  3. OAuth servers: click 去认证 (Authenticate) → the browser opens the server's login page → after consent you are redirected back and the tools are registered immediately.
  4. Static-token servers: enter the name of an environment variable that holds the token (e.g. MCP_BEARER_TOKEN) — the token itself is never written to disk; stdio servers spawn and connect immediately on save.
  5. Optional: turn on On-demand MCP tool calls at the top of the page. The setting is profile-wide, persists across restarts, and affects existing sessions on their next request.

Status badges: connected (N tools) / needs-auth / authorizing / error / disabled. Buttons: authenticate, edit, enable/disable (switch), delete. Disable unregisters that server's tools and drops its connection (config and OAuth tokens persist); Enable reconnects without re-authenticating. Disabled servers stay dormant across restarts. The toggle is global: it affects every session in this profile. State persists at ~/.dsh/mcp-manager.json (server configs + OAuth client registrations + tokens; static tokens are referenced by env-var name, not stored).

What the agent sees

With on-demand mode off (the default), every connected server's tools appear as first-class tools, e.g. for a server named odin:

mcp__odin__search_tools     mcp__odin__describe_tool
mcp__odin__execute_tool     mcp__odin__list_tool_scopes

Tool results are projected back as native DSH content blocks (including rich content when supported); MCP isError results surface through the registry's error path.

With on-demand mode on, a Native-mode agent sees only these three MCP broker tools:

  • mcp_search_tools({ query, server?, limit? }) returns up to 10 lightweight matches by default (hard-capped at 20). It scores each query term against server name +2, tool name +3, and description +1.
  • mcp_describe_tool({ name }) returns the exact registered description and input schema for one tool visible in that session.
  • mcp_execute_tool({ name, arguments }) executes any currently visible MCP tool through the normal DSH tool pipeline. Calling describe first is recommended but not required.

Raw mcp__* names are removed from the model request and direct calls to them are denied; only the nested dispatch owned by mcp_execute_tool is allowed. Search, describe, and execute all resolve the calling agent's live registry view, so workspace isolation and exclude masks remain effective.

Workspace isolation

Global servers (added in Settings → MCP) are visible in every workspace. Use the workspace dropdown at the top of the Settings → MCP page to switch between "global" and a specific workspace; when a workspace is selected you see both its own servers and the global servers (with a 隐藏 / Hide toggle to mask each global server). Workspace servers live in /.dsh/dshmm/mcp.json (Claude/Codex-style):

{
  "mcpServers": {
    "filesystem": { "type": "stdio", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] },
    "unity-mcp": { "type": "http", "url": "http://localhost:8090/", "authMode": "static", "tokenEnv": "UNITY_MCP_TOKEN" }
  },
  "exclude": ["github"]
}
  • Workspace servers can be added / edited / deleted in the UI for workspaces registered in DSH (the button while a workspace is selected writes to that workspace's mcp.json). Hand-editing the file also works — creating or changing it is hot-reloaded. Invalid JSON is shown as an error while the last valid live configuration stays active.
  • type defaults to http; a stdio server's cwd defaults to the workspace root. headers / headerEnv / env / args follow the same shapes as the Settings form.
  • A workspace server's tools register only into sessions whose working directory resolves to that workspace; another workspace's agents never see them. Global servers stay visible everywhere unless masked.
  • exclude lists global servers to hide in this workspace (their tools are masked through the tool registry's per-agent restriction). Toggle it via the 隐藏 / Hide checkbox on each global server in the workspace view.
  • serverName must be unique across global + all workspace sources; a later duplicate is flagged as a conflict and skipped (shown in the UI).
  • Config is re-read on each new session and hot-reloaded via a file watcher.
  • Workspace servers support stdio, HTTP static-token (tokenEnv), and HTTP OAuth — the same PKCE + dynamic client registration flow as global servers. Workspace OAuth tokens persist in ~/.dsh/mcp-manager.json (never in the declarative mcp.json); each workspace server row exposes a 去认证 / Authenticate button for OAuth servers.