feat(mcp): add tool visibility presets (#786)#787
Merged
joshrotenberg merged 1 commit intomainfrom Mar 4, 2026
Merged
Conversation
…786) MCP clients degrade past ~50-100 tools. Add a [tools] section to mcp-policy.toml with preset/include/exclude fields so users can load curated subsets per platform. The "essentials" preset provides ~61 tools across all toolsets (20 cloud, 18 enterprise, 15 database, 8 app) instead of the full ~273. Raw API passthrough tools serve as escape hatches. Resolution order: preset base set -> +include -> -exclude -> policy tier/deny/allow. Backward compatible: no [tools] section = all tools. Adds list_available_tools system tool for LLM discoverability of hidden tools. System tools (show_policy, list_available_tools) bypass visibility.
This was referenced Mar 4, 2026
Merged
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.
Summary
[tools]section tomcp-policy.tomlwithpreset,include, andexcludefields for per-tool visibility controllist_available_toolssystem tool so LLMs can discover hidden tools and request specific ones via theincludelistCapabilityFilterclosure; system tools (show_policy,list_available_tools) bypass visibility[tools]section =preset = "all"(current behavior, all tools loaded)Configuration example
Resolution: preset base -> +include -> -exclude -> policy tier/deny/allow
Files changed
presets.rs(new)ToolsConfig, essentials constants,resolve_visible_tools(),ToolVisibility,list_available_tools_tool(), cross-validation testspolicy.rstools: ToolsConfigfield onPolicyConfig, TOML parsing testslib.rspub mod presets;main.rsbuild_router, combined filter, instructions prefix, testsTest plan
cargo check -p redisctl-mcp --all-featurescargo check -p redisctl-mcp --no-default-featurescargo check -p redisctl-mcp --features cloudcargo check -p redisctl-mcp --features enterprisecargo check -p redisctl-mcp --features databasecargo clippy -p redisctl-mcp --all-features -- -D warningscargo fmt --all -- --checkcargo test -p redisctl-mcp --all-featuresTOOL_NAMESCloses #786