rust(feat): gate MCP tools with account feature flags at startup - #764
Draft
evan-sift wants to merge 3 commits into
Draft
rust(feat): gate MCP tools with account feature flags at startup#764evan-sift wants to merge 3 commits into
evan-sift wants to merge 3 commits into
Conversation
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.
Description
The MCP server now resolves the account's enabled feature flags at startup, using the configured API key, and excludes tools whose flag is not enabled. Most tools carry no flag and are always registered.
sift_mcp::FeatureFlags: fetched once at startup viaGET /api/v1/feature-flags/variants(5s timeout, bearer auth). A flag is enabled when its variant value is non-empty and notoff.feature_flags.rsmaps tool names to required flags; gated tools are removed from the router before serving, so they are absent fromtools/listand rejected on call.--disable-nonessential-traffic(help text updated).Verification
cargo test -p sift_mcp: 311 passed. New coverage: wire-level fetch test (request line, bearer header, trailing-slash URI, 500 handling, response parse), registry drift guard, client-event invariant with all flags enabled, wire-leveltools/listandtools/callfor both flag states, fail-closed default behavior, enabled-semantics unit tests.cargo check -p sift_cli,cargo fmt --all --check,cargo clippy --all-features(no new warnings) all pass.