-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Migrate MCP Apps support from insiders mode to feature flag with insiders opt-in #2282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mattdholloway
wants to merge
8
commits into
main
Choose a base branch
from
matt/mcp-apps-feature-flag
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
32fb743
migrate mcp apps support from insiders mode to feature flag with insi…
mattdholloway d3ab0ea
Update pkg/inventory/registry_test.go
mattdholloway c74f6c5
Merge branch 'main' into matt/mcp-apps-feature-flag
mattdholloway 7830fe6
refactor: improve key existence check in stripMetaKeys function
mattdholloway 2a25285
merge in changes
mattdholloway fd3a3c4
undo docs changes
mattdholloway 3bdaf75
restore insiders-features.md
mattdholloway 90a7201
refactor: centralize feature flag resolution and improve feature chec…
mattdholloway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,54 @@ | ||
| package github | ||
|
|
||
| // MCPAppsFeatureFlag is the feature flag name for MCP Apps (interactive UI forms). | ||
| const MCPAppsFeatureFlag = "remote_mcp_ui_apps" | ||
|
|
||
| // AllowedFeatureFlags is the allowlist of feature flags that can be enabled | ||
| // by users via --features CLI flag or X-MCP-Features HTTP header. | ||
| // Only flags in this list are accepted; unknown flags are silently ignored. | ||
| // This is the single source of truth for which flags are user-controllable. | ||
| var AllowedFeatureFlags = []string{ | ||
| MCPAppsFeatureFlag, | ||
| } | ||
|
|
||
| // InsidersFeatureFlags is the list of feature flags that insiders mode enables. | ||
| // When insiders mode is active, all flags in this list are treated as enabled. | ||
| // This is the single source of truth for what "insiders" means in terms of | ||
| // feature flag expansion. | ||
| var InsidersFeatureFlags = []string{ | ||
| MCPAppsFeatureFlag, | ||
| } | ||
|
|
||
| // FeatureFlags defines runtime feature toggles that adjust tool behavior. | ||
| type FeatureFlags struct { | ||
| LockdownMode bool | ||
| InsidersMode bool | ||
| } | ||
|
|
||
| // ResolveFeatureFlags computes the effective set of enabled feature flags by: | ||
| // 1. Taking explicitly enabled features (from CLI flags or HTTP headers) | ||
| // 2. Adding insiders-expanded features when insiders mode is active | ||
| // 3. Validating all features against the AllowedFeatureFlags allowlist | ||
| // | ||
| // Returns a set (map) for O(1) lookup by the feature checker. | ||
| func ResolveFeatureFlags(enabledFeatures []string, insidersMode bool) map[string]bool { | ||
| allowed := make(map[string]bool, len(AllowedFeatureFlags)) | ||
| for _, f := range AllowedFeatureFlags { | ||
| allowed[f] = true | ||
| } | ||
|
|
||
| effective := make(map[string]bool) | ||
| for _, f := range enabledFeatures { | ||
| if allowed[f] { | ||
| effective[f] = true | ||
| } | ||
| } | ||
| if insidersMode { | ||
| for _, f := range InsidersFeatureFlags { | ||
| if allowed[f] { | ||
| effective[f] = true | ||
| } | ||
| } | ||
| } | ||
| return effective | ||
| } | ||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.