dsh-mcp-lazy

MCP 工具按需加载。会话工具集里只保留 coreTools 白名单(最多 5 个)中的 mcp__* 工具,其余 MCP 工具定义经由会话级 tools.restrict() 真正从请求中移除,模型调用 lazy_load_tool 后才装回;tools/pre-execute 闸门把未加载工具的调用拒绝成「请先装载」的提示,会话结束自动重置。

插件介绍

MCP 工具按需加载。会话工具集里只保留 coreTools 白名单(最多 5 个)中的 mcp__* 工具,其余 MCP 工具定义经由会话级 tools.restrict() 真正从请求中移除,模型调用 lazy_load_tool 后才装回;tools/pre-execute 闸门把未加载工具的调用拒绝成「请先装载」的提示,会话结束自动重置。

安装方式

从 GitHub 安装

dsh plugin --profile web add github:liuhange789/dsh-mcp-lazy

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

版本兼容情况

兼容性待确认。可前往项目文档查看支持版本。