dsh-mcp-lazy

On-demand MCP tool loading. Only the mcp__* tools listed in the coreTools whitelist (max 5) stay in a session's tool set; every other MCP tool definition is actually removed from the request through the session-scoped tools.restrict() API and comes back only after the model calls lazy_load_tool. A tools/pre-execute gate turns calls to unloaded tools into a load-it-first error, and activation resets when the session ends.

Overview

On-demand MCP tool loading. Only the mcp__* tools listed in the coreTools whitelist (max 5) stay in a session's tool set; every other MCP tool definition is actually removed from the request through the session-scoped tools.restrict() API and comes back only after the model calls lazy_load_tool. A tools/pre-execute gate turns calls to unloaded tools into a load-it-first error, and activation resets when the session ends.

Installation

Install from 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.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.