-
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
base: main
Are you sure you want to change the base?
Changes from all commits
32fb743
d3ab0ea
c74f6c5
7830fe6
2a25285
fd3a3c4
3bdaf75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import ( | |
| "errors" | ||
| "log/slog" | ||
| "net/http" | ||
| "slices" | ||
|
|
||
| ghcontext "github.com/github/github-mcp-server/pkg/context" | ||
| "github.com/github/github-mcp-server/pkg/github" | ||
|
|
@@ -261,6 +262,14 @@ func InventoryFiltersForRequest(r *http.Request, builder *inventory.Builder) *in | |
| builder = builder.WithReadOnly(true) | ||
| } | ||
|
|
||
| // Enable MCP Apps if the feature flag is present in the request headers | ||
| // or if insiders mode is active (insiders expands InsidersFeatureFlags). | ||
| headerFeatures := ghcontext.GetHeaderFeatures(ctx) | ||
| mcpApps := slices.Contains(headerFeatures, github.MCPAppsFeatureFlag) || ghcontext.IsInsidersMode(ctx) | ||
mattdholloway marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is in the wrong place. This should be a feature checker check. The feature checker should be wired to factor in headerFeatures or flag passed features, and should compare them only against a list of public feature flags, and set them that way. Of course in the remote server where actual feature flags can also exist, this needs to be handled first (but same logic). Roughly:
With the latter step only existing on the remote server of course. |
||
| if mcpApps { | ||
| builder = builder.WithMCPApps(true) | ||
| } | ||
mattdholloway marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| toolsets := ghcontext.GetToolsets(ctx) | ||
| tools := ghcontext.GetTools(ctx) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.