DeepSeek Harness 插件

dsh-mcp-proxy

Context-cheap MCP access for DeepSeek Harness: two proxy tools instead of every server's full schema set, with lazy connections, an on-disk tool catalog, and idle disconnect(英文原文)

跳到安装方式

来源信息

GitHub 仓库
ben7am1n/dsh-mcp-proxy
最近更新
2026年8月13日
分类
工具与能力
GitHub stars
1
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/ben7am1n/dsh-mcp-proxy
插件名:dsh-mcp-proxy
作者:ben7am1n

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-mcp-proxy

Context-cheap MCP access for DeepSeek Harness.

The shipped dsh-mcp-client registers every tool of every configured server on ctx.tools, so a handful of MCP servers puts hundreds of JSON schemas into the system prompt of every request — whether or not the model ever calls one.

This plugin registers exactly two tools regardless of how many servers you configure, and reaches those servers lazily. The standing prompt cost is constant in the number of MCP tools available.

Install

dsh plugin --profile web add dsh-mcp-proxy

Then declare your servers by overriding the row (the shipped row has none — see [Trust](#trust)).

What the model sees

ToolPurpose
mcp_discoverSearch the tool catalog by keyword; returns each hit's server, name, description, and argument names
mcp_callInvoke one tool by server and name, passing arguments through unchanged

The catalog is cached on disk, so mcp_discover answers from a cold start without connecting to anything, and keeps answering when a server is temporarily down.

How it behaves

  • Nothing connects at boot. A server is contacted on first discovery or first call.
  • A warm connection is reused across calls and closed after idleDisconnectMs of silence. Concurrent calls share one handshake.
  • One unreachable server degrades discovery instead of failing it: the model gets the servers that answered, plus a named reason for each that did not.
  • A tool-reported failure is a successful result carrying isError: true, so a Code Mode caller branches on the flag rather than parsing prose. Only transport and protocol failures are tool errors.
  • Catalog entries for servers you removed are pruned at load, so a renamed server stops advertising tools nothing can call.
  • A corrupt cache file starts empty rather than stopping the harness from booting — it is a derived cache, not a source of truth.
  • Disposal closes every connection and clears every timer.

Configuration

- id: mcp-proxy
  name: dsh-mcp-proxy
  config:
    cachePath: !!js dshHomePath('mcp-proxy/catalog.json')
    catalogTtlMs: 86400000
    idleDisconnectMs: 300000
    connectTimeoutMs: 30000
    callTimeoutMs: 60000
    discoverLimitDefault: 15
    discoverLimitMax: 50
    servers:
      - name: github
        transport: stdio
        command: npx
        args: ['-y', '@modelcontextprotocol/server-github']
        env:
          GITHUB_TOKEN: !!js process.env.GITHUB_TOKEN

      - name: internal
        transport: streamable-http
        url: http://localhost:3000/mcp
        headers:
          Authorization: !!js `Bearer ${process.env.MCP_TOKEN}`
FieldDefaultMeaning
servers[]The servers this deployment can reach. Names are [A-Za-z0-9_-]{1,32} and must be unique
cachePath— (required)JSON file caching each server's tool list
catalogTtlMs86400000 (1 day)Age at which a cached catalog is refetched on the next discovery
idleDisconnectMs300000 (5 min)Idle period after which a warm connection closes
connectTimeoutMs30000Bound on one MCP handshake
callTimeoutMs60000Bound on one callTool request
discoverLimitDefault15Hits returned when the model omits limit
discoverLimitMax50Hard cap, whatever the model asks for

Trust

servers ships empty on purpose. Every MCP server command is trusted executable code running outside the agent sandbox, so no package may enable one on a user's behalf. The shipped harness makes the same choice for dsh-mcp-client.

This plugin adds no approval gate of its own. Gate mcp_call the way you gate any other tool — a tools/pre-execute listener, ctx.tools.guard(), or the permission presets — so the policy stays in one place instead of forking per transport.

Running alongside dsh-mcp-client

Supported, and often the right setup: promote the two or three servers whose tools you want natively visible (so the model calls them without a discovery round trip) to dsh-mcp-client rows, and leave the long tail behind this proxy. Tool names do not collide — dsh-mcp-client registers mcp__<server>__<tool>, this plugin registers only mcp_discover and mcp_call.

Trade-off

A proxy costs the model one extra round trip when it does not already know the tool name, and hides the tool's full JSON schema behind argument names. That is the deliberate exchange: constant prompt cost, at the price of discovery latency on first use. If you have one MCP server with four tools, dsh-mcp-client is the better fit.

Alternative worth knowing

The harness's own idiom for progressive disclosure is ctx.tools.restrict(), which masks a registered tool set per agent. That path keeps full schemas for the visible subset but still requires connecting at boot to enumerate. This plugin chooses the proxy shape instead so that nothing connects until the model asks — the property that matters when a deployment configures a dozen servers it rarely uses.

Development

pnpm install --ignore-workspace
pnpm run typecheck
pnpm test
pnpm run build

The suite runs against a real MCP stdio server (tests/fixture-server.mjs) over the real SDK transport, so it covers handshakes, listing, calling, tool-level failures, unreachable servers, and catalog persistence without depending on any third-party server.

License

MIT

Prior art

The context-saving proxy idea comes from pi-mcp-adapter (MIT) in the Pi ecosystem. This is an independent implementation against Harness extension points and shares no code with it; it covers the lazy-connection and proxy-tool core, not pi-mcp-adapter's OAuth flows, tool promotion, or /mcp configuration panel.