Skip to content

Migrate MCP Apps support from insiders mode to feature flag with insiders opt-in#2282

Open
mattdholloway wants to merge 7 commits intomainfrom
matt/mcp-apps-feature-flag
Open

Migrate MCP Apps support from insiders mode to feature flag with insiders opt-in#2282
mattdholloway wants to merge 7 commits intomainfrom
matt/mcp-apps-feature-flag

Conversation

@mattdholloway
Copy link
Copy Markdown
Contributor

@mattdholloway mattdholloway commented Apr 2, 2026

Summary

This pull request transitions MCP Apps from an insiders-only experimental feature to a general feature flag (remote_mcp_ui_apps) that can be enabled independently.

Why

Closes https://github.com/github/copilot-mcp-core/issues/1471

What changed

Documentation updates:

  • MCP Apps documentation has been moved out of "insiders-only" features and is now described as a feature flag that can be enabled independently. [1] [2] [3]
  • Added explicit instructions and configuration examples for enabling MCP Apps via the new feature flag. [1] [2]

Feature flag implementation:

  • Introduced MCPAppsFeatureFlag and InsidersFeatureFlags in feature_flags.go to define and manage feature flags. Insiders mode now simply expands to a set of feature flags, including MCP Apps.
  • Updated server and builder logic to check for the MCP Apps feature flag instead of a hardcoded insiders mode. [1] [2] [3] [4] [5] [6] [7]

HTTP and context handling:

  • The HTTP handler and server now recognize the MCP Apps feature flag in headers, and insiders mode automatically enables all insiders feature flags. [1] [2] [3]
  • The builder uses WithMCPApps instead of WithInsidersMode to control UI metadata stripping. [1] [2]

Tool and UI logic:

  • Logic for showing MCP Apps UI forms in tools like issue_write and create_pull_request now checks the MCP Apps feature flag, not insiders mode. [1] [2]

Test updates:

  • Tests have been updated to verify the MCP Apps feature flag gate, replacing references to insiders mode. [1] [2] [3] [4] [5]

Most important changes:

Documentation and User Guidance

  • MCP Apps is now documented as a feature flag (remote_mcp_ui_apps), not an insiders-only feature, with updated configuration instructions and examples. [1] [2] [3] [4]

Feature Flag Refactor

  • Added MCPAppsFeatureFlag and InsidersFeatureFlags constants; insiders mode now expands feature flags instead of controlling features directly.
  • Server logic and builder now use the MCP Apps feature flag for enabling UI features, not insiders mode. [1] [2] [3] [4] [5] [6] [7]

HTTP and Context Handling

  • HTTP handlers and feature checkers now recognize the MCP Apps feature flag in headers and automatically enable all insiders feature flags when insiders mode is active. [1] [2] [3]

Tool Logic

  • UI form logic for tools like issue_write and create_pull_request is now controlled by the MCP Apps feature flag. [1] [2]

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed
  • Updated (README / docs / examples)

@mattdholloway mattdholloway requested a review from a team as a code owner April 2, 2026 12:27
Copilot AI review requested due to automatic review settings April 2, 2026 12:27
@mattdholloway mattdholloway changed the title Migrate mcp apps support from insiders mode to feature flag with insiders opt-in Migrate MCP Apps support from insiders mode to feature flag with insiders opt-in Apr 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates MCP Apps (interactive UI forms) enablement from “insiders mode” to an explicit feature flag (remote_mcp_ui_apps), while keeping backward compatibility by treating insiders mode as implying the flag.

Changes:

  • Introduces github.MCPAppsFeatureFlag (remote_mcp_ui_apps) and wires it through stdio/HTTP feature checking with an insiders-mode transitional fallback.
  • Adds inventory builder support (WithMCPApps) to strip/keep MCP Apps UI metadata (Meta["ui"]) based on the feature flag.
  • Updates tool behavior gates and documentation to reference the feature flag instead of insiders mode.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/inventory/registry_test.go Renames/extends tests for MCP Apps gating and meta stripping; adds stripMetaKeys coverage.
pkg/inventory/builder.go Adds WithMCPApps, separates insiders stripping from MCP Apps UI metadata stripping, and introduces stripMetaKeys.
pkg/http/server.go Whitelists remote_mcp_ui_apps for X-MCP-Features and adds transitional insiders behavior in feature checker.
pkg/http/handler.go Applies WithInsidersMode and WithMCPApps to the inventory builder based on request context/header features.
pkg/github/pullrequests.go Gates PR UI form behavior on remote_mcp_ui_apps feature flag instead of insiders mode.
pkg/github/pullrequests_test.go Updates UI-gate test setup to use feature checker-based deps rather than InsidersMode.
pkg/github/issues.go Gates issue UI form behavior on remote_mcp_ui_apps feature flag instead of insiders mode.
pkg/github/issues_test.go Updates UI-gate test setup to use feature checker-based deps rather than InsidersMode.
pkg/github/feature_flags.go Adds the exported MCPAppsFeatureFlag constant.
internal/ghmcp/server.go Ensures stdio “insiders mode” also enables remote_mcp_ui_apps; registers UI resources based on the flag.
docs/server-configuration.md Documents feature flags and MCP Apps configuration via X-MCP-Features / --features.
docs/insiders-features.md Removes MCP Apps from insiders-only list; points to feature-flag configuration.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@bdweb771-art bdweb771-art left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates MCP Apps enablement from being tied to insiders mode to a dedicated feature flag (remote_mcp_ui_apps), while preserving backward compatibility by having insiders mode imply the feature flag.

Changes:

  • Introduces github.MCPAppsFeatureFlag and updates tool handlers (issue_write, create_pull_request) to gate MCP Apps UI behavior via feature flag checks.
  • Adds transport-specific feature enablement: HTTP via X-MCP-Features (whitelisted) and stdio via --features, with insiders-mode implication during the transition.
  • Updates inventory building to strip ui metadata unless MCP Apps is enabled, and refreshes related tests and docs.
Show a summary per file
File Description
pkg/github/feature_flags.go Defines the remote_mcp_ui_apps feature flag constant and documents its purpose.
pkg/github/issues.go Switches UI-gate logic from insiders mode to the MCP Apps feature flag.
pkg/github/issues_test.go Updates UI-gate tests to use feature checker-based enablement instead of insiders mode.
pkg/github/pullrequests.go Switches UI-gate logic from insiders mode to the MCP Apps feature flag.
pkg/github/pullrequests_test.go Updates UI-gate tests to use feature checker-based enablement instead of insiders mode.
pkg/http/server.go Whitelists remote_mcp_ui_apps for X-MCP-Features and adds insiders→flag transitional behavior in the HTTP feature checker.
pkg/http/handler.go Enables MCP Apps inventory behavior based on X-MCP-Features or insiders mode (transitional).
pkg/inventory/builder.go Adds WithMCPApps and strips ui metadata by default unless MCP Apps is enabled; generalizes meta stripping via stripMetaKeys.
pkg/inventory/registry_test.go Renames/adds tests around MCP Apps meta stripping and stripMetaKeys.
internal/ghmcp/server.go Ensures stdio mode treats insiders as implying the feature flag and registers UI resources only when the flag is enabled.
docs/server-configuration.md Documents feature flags and adds MCP Apps configuration examples using X-MCP-Features / --features.
docs/insiders-features.md Removes MCP Apps from insiders-only docs and notes there are currently no insiders-only features.

Copilot's findings

Comments suppressed due to low confidence (1)

pkg/inventory/registry_test.go:2142

  • This test uses require.Nil(result.Tool.Meta["ui"]) (and similar) to assert key stripping, but a map lookup returns nil both when the key is missing and when the key exists with a nil value. To ensure stripMetaKeys actually removes the keys, assert map membership (_, ok := meta["ui"]) rather than only the value.
	require.Nil(t, result.Tool.Meta["ui"], "ui should be stripped")
	require.Nil(t, result.Tool.Meta["experimental_feature"], "experimental_feature should be stripped")
	require.Nil(t, result.Tool.Meta["beta"], "beta should be stripped")
	require.Equal(t, "kept", result.Tool.Meta["description"], "description should be preserved")
  • Files reviewed: 12/12 changed files
  • Comments generated: 2

Copy link
Copy Markdown
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally happy with this, but it might be nice to avoid the complexity of insiders only and just use feature flags for everything. Insiders would just auto enable a list of feature flags, and all changes would propagate as a consequence.

}

// WithMCPApps enables or disables MCP Apps UI features.
// When disabled (default), the "ui" Meta key is stripped from tools
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be done via feature flag.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request migrates MCP Apps (interactive UI forms) enablement from being tied to Insiders mode to a dedicated feature flag (remote_mcp_ui_apps), while keeping Insiders mode as a backwards-compatible opt-in that implies the flag.

Changes:

  • Introduces remote_mcp_ui_apps as the canonical MCP Apps feature flag and defines which flags Insiders mode implies.
  • Updates inventory building to include/strip MCP Apps UI metadata based on the feature flag (WithMCPApps) rather than Insiders mode.
  • Updates HTTP and stdio server paths, tool handlers, tests, and docs to use the feature flag for MCP Apps UI gating.
Show a summary per file
File Description
pkg/inventory/server_tool.go Removes the InsidersOnly tool field as MCP Apps gating is no longer tied to Insiders-only tooling.
pkg/inventory/registry_test.go Renames/updates tests to validate MCP Apps UI metadata stripping/preservation via WithMCPApps and key-stripping helpers.
pkg/inventory/builder.go Adds WithMCPApps and updates build-time stripping logic to remove MCP Apps UI metadata when the flag is not enabled.
pkg/http/server.go Whitelists remote_mcp_ui_apps for X-MCP-Features and expands feature checking to treat Insiders-implied flags as enabled.
pkg/http/handler.go Enables MCP Apps inventory UI behavior for requests when the feature is present (or Insiders mode is active).
pkg/github/pullrequests.go Switches MCP Apps UI gating for create_pull_request from Insiders mode to the feature flag.
pkg/github/pullrequests_test.go Updates tests to enable MCP Apps via a feature checker rather than Insiders mode flags.
pkg/github/issues.go Switches MCP Apps UI gating for issue_write from Insiders mode to the feature flag.
pkg/github/issues_test.go Updates tests to enable MCP Apps via a feature checker rather than Insiders mode flags.
pkg/github/feature_flags.go Adds MCPAppsFeatureFlag constant and InsidersFeatureFlags list as the expansion set for Insiders mode.
internal/ghmcp/server.go Expands enabled features when Insiders mode is on, derives MCP Apps enablement from feature flags, and gates UI resource registration accordingly.
docs/server-configuration.md Documents X-MCP-Features / --features and adds MCP Apps section describing feature-flag-based enablement.
docs/insiders-features.md Removes MCP Apps from insiders-only docs and notes there are currently no insiders-only features.

Copilot's findings

  • Files reviewed: 13/13 changed files
  • Comments generated: 1

Comment on lines +265 to +271
// 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)
if mcpApps {
builder = builder.WithMCPApps(true)
}
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InventoryFiltersForRequest enables MCP Apps UI metadata purely based on the raw header value or Insiders mode, without consulting the same sources of truth used elsewhere (the X-MCP-Features whitelist in pkg/http/server.go and github.InsidersFeatureFlags). This can drift over time (e.g., if MCPAppsFeatureFlag is removed from the whitelist or from InsidersFeatureFlags, the inventory could still include UI metadata even though the feature checker would treat it as disabled). Consider deriving mcpApps from the whitelist + header check and from github.InsidersFeatureFlags membership when Insiders mode is active, so inventory/UI metadata gating stays consistent with feature-flag evaluation.

Copilot uses AI. Check for mistakes.
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.

5 participants