Let the operator drop unused tools from the MCP surface - #123
Merged
Conversation
Every registered tool's schema is injected into every client session, so a tool nobody calls costs tokens on each turn and lengthens the menu the model picks from. Counting real calls across 48 local sessions, 12 of the 29 tools have never been called once. Neither Claude Code nor omp exposes a per-tool MCP filter, so the choice has to live server-side. Adds disabled_tools to config, with a NEUROSTACK_DISABLED_TOOLS env override, honoured by create_mcp_server. Empty by default, so nothing changes for anyone who sets nothing. The adapter logs what it skipped and warns on a name matching no tool, so a typo is visible instead of silently disabling nothing. Closes #122
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122.
What
disabled_toolsinconfig.toml, plus aNEUROSTACK_DISABLED_TOOLSenv override, naming tools to leave off the MCP surface.create_mcp_serverskips them when registering.Why
Every registered tool's schema is injected into every client session, so a tool nobody calls costs tokens on each turn and lengthens the menu the model picks from. Counting real calls across 48 local sessions, 12 of the 29 tools have never been called once — roughly 1.2k tokens of dead schema per session. Neither Claude Code nor omp exposes a per-tool MCP filter, so the choice has to live server-side.
How
Config.disabled_tools: list[str], empty by default, so behaviour is unchanged for anyone who sets nothing."a, b"as["a", "b"].NEUROSTACK_DISABLED_TOOLStakes comma- or space-separated names and replaces the file value rather than merging, matching how every other env override inload_configbehaves.Gate
uv run ruff check src/ tests/exit 0.uv run pytest -qexit 0, 834 passed (+6).New tests cover the default staying empty, the TOML list, the TOML string being split, env beating TOML, the adapter omitting a disabled tool while keeping the rest, and the adapter registering everything when the list is empty.