Skip to content

Let the operator drop unused tools from the MCP surface - #123

Merged
raphasouthall merged 1 commit into
mainfrom
feat/122-disabled-tools
Aug 27, 2026
Merged

Let the operator drop unused tools from the MCP surface#123
raphasouthall merged 1 commit into
mainfrom
feat/122-disabled-tools

Conversation

@raphasouthall

Copy link
Copy Markdown
Owner

Closes #122.

What

disabled_tools in config.toml, plus a NEUROSTACK_DISABLED_TOOLS env override, naming tools to leave off the MCP surface. create_mcp_server skips 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.
  • The TOML parser accepts a list or a string, since a hand-edited config is as likely to hold "a, b" as ["a", "b"].
  • NEUROSTACK_DISABLED_TOOLS takes comma- or space-separated names and replaces the file value rather than merging, matching how every other env override in load_config behaves.
  • The adapter logs which tools it skipped, and warns on a name matching no tool so a typo shows up in the log instead of silently disabling nothing.

Gate

uv run ruff check src/ tests/ exit 0. uv run pytest -q exit 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.

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
@raphasouthall
raphasouthall merged commit 228c918 into main Aug 27, 2026
5 checks passed
@raphasouthall
raphasouthall deleted the feat/122-disabled-tools branch August 27, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let the operator drop unused tools from the MCP surface

1 participant