Sends deferred MCP tool definitions as an index of names, parameter signatures and one-line summaries grouped by server, with tool_details returning a full schema on request and call_tool running the real tool. Reading a schema or running a tool does not change the model-visible tool list, so the prompt cache is not invalidated.
安装
# npm 包(预构建)
dsh plugin --profile web add dsh-tool-index
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:GunjanPatel359/dsh-tool-index
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
75 MCP tools connected, one small task: 183,274 tokens without this plugin, 79,838 with it — 56% less.
dsh-tool-index sends your MCP tool definitions as a compact index and loads full schemas only when the model asks for them. The tool list itself never changes mid-session, so your prompt cache keeps working.
A plugin for DSH. Built on DeepSeek Harness; not an official DeepSeek project.
The problem
Every tool definition is sent again on every model request. Connect a few MCP servers and an agent carries hundreds of definitions it never uses: thousands of tokens on every step, and a model that picks tools worse because it has too many to choose from.
What it does
dsh-tool-index sends those tools as a short index instead: each tool's name, parameters and one-line summary, grouped by server. When the model needs one, it reads the full details with tool_details and runs it with call_tool.
without: read, bash, mcp__github__create_issue {full schema}, mcp__github__list_issues {full schema}, ... ×180
with: read, bash, tool_details {index: 180 names + one-liners}, call_tool
- Fewer tokens on every request. The MCP tools cost about 88% less per request.
- The prompt cache keeps working. The tool list stays the same for the whole session, so loading a tool never forces the provider to re-read the conversation at full price.
- The model doesn't miss tools. Every tool is always named in the index, and a wrong name (a typo, a missing
mcp__server__prefix) gets the closest real names back. - Nothing is bypassed. Permission policies, approvals and hooks still see the real tool and its arguments.
Does it save tokens?
Yes. One small task, three runs per cell, with real MCP servers:
| Model | Without the plugin | With it | Change |
|---|---|---|---|
| DeepSeek deepseek-flash, 25 MCP tools | 80,777 | 58,864 | -27% |
| DeepSeek deepseek-flash, 75 MCP tools | 183,274 | 79,838 | -56% |
| Claude claude-haiku-5-5, 25 MCP tools | 110,598 | 94,422 | -15% |
| OpenAI gpt-5.4-mini, 25 MCP tools | 50,846 | 23,398 | -54% |
And over a 5-message conversation in one session (DeepSeek, two of the messages need no tools):
| Servers | Without the plugin | With it | Change |
|---|---|---|---|
| 25 MCP tools | 159,736 | 106,398 | -33% |
| 75 MCP tools | 317,040 | 147,120 | -54% |
Tokens summed over every model step. Every run finished its task with and without the plugin. The more tools you connect, the more it saves.
Reproduce them yourself with e2e/run.sh.
Install
On npm as dsh-tool-index — DSH fetches it for you, so there is no npm install step.
As a bundle in a profile:
dsh plugin --profile tui add dsh-tool-index
dsh --profile tui
Or from a checkout, for one run:
git clone https://github.com/GunjanPatel359/dsh-tool-index
cd dsh-tool-index
dsh tui --patch ./examples/local.patch.yml
Configuration
- id: dsh-tool-index
name: dsh-tool-index
config:
match: ['mcp__'] # MCP name prefixes to defer
exclude: [] # ...except these prefixes, e.g. ['mcp__mycore__'] for tools used every turn
alwaysLoad: [] # exact names always sent in full
minTools: 10 # defer only when at least this many match
indexStyle: signature # names | summary | signature (name, parameter names, summary)
maxDetails: 10 # most tools one tool_details call returns
summaryChars: 120 # length of each summary in the index
indexChars: 12000 # past this, remaining tools are listed by name only
detailsToolName: tool_details
callToolName: call_tool
A patch replaces a row's whole config, so restate every key you set.
With fewer than minTools matching tools nothing changes: a handful of definitions costs less than an extra step.
Keep tools the agent uses on most turns out of the index with exclude or alwaysLoad.
This plugin is for MCP tools. match takes name prefixes, but deferring your harness's own core tools (read, bash and the like) will make the agent worse, not cheaper: it needs them on almost every turn, and there is no guard against it.
Trade-offs
- Sometimes one extra step (
tool_details) before a deferred tool is first used in a conversation. - Arguments are checked by the tool, not by the provider. A wrong argument comes back as the tool's own error.
- UIs show
call_toolas the outer step, with the real tool inside it.
Compatibility
- Native tool calls: the mode the plugin is built for.
- PTC mode (
run_code): the plugin steps aside for those agents and adds nothing to their requests. In PTC mode the model calls tools from code, and DSH already lists every tool for that code. - Sub-agents and structured-output children: each agent gets its own index of its own tools. A child's
structured_outputtool stays a normal tool.
Written for DSH 0.2.x. DSH is pre-1.0, so its plugin interfaces can change between releases.
How it works
- docs/how-it-works.md — the index,
tool_details,call_tool, and why the tool list stays fixed. - docs/name-matching.md — how a wrong tool name is matched to the closest real one.
License
MIT
链接
同类插件
DayuanJiang/next-ai-draw-io#dsh-plugin★ 36802
dsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
Tencent/WeKnora#dsh-weknora★ 36302
把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己带引用的 RAG 或 ReAct agent 回答(含可续聊的 session id)。
superdesigndev/treg★ 7042
给 Agent 的工具目录:按「要做的事」检索约 2,600 个外部接口(SEO 与 SERP、外链、社交、人物与公司信息补全、广告库、抓取),查看参数与单次调用价格后直接调用,凭据由服务端注入。附带技能,MCP 行在未设置 TREG_TOKEN 前保持禁用。
T-Auto/dsh-ops★ 5074
为 Windows 的 DSH 提供 bash、PowerShell 7 及 Rust 高性能工具,减少 token 消耗。
sixtysevenlf/dsh-blender-plugin★ 1575
让 DSH agent 通过直连 TCP 通道驱动本地 Blender,提供 15 个工具:视口帧、自定义视角渲染、Python 执行、无头与作业卸载、事务回滚,以及 34 个 family / 228 个 op 的规划层。
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1155
把腾讯云 CloudBase 后端接入 DeepSeek Harness——在对话里搭好并部署全栈应用,查询结果渲染为表格卡片(分页、排序、导出 CSV),部署后可预览真实域名,并提供 CloudBase MCP 工具集(`mcp__cloudbase__*`),登录走 device-code 流程。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。