Skip to content

Add a server option to disable MCP Apps entirely - #3912

Open
nanami7777777 wants to merge 3 commits into
github:mainfrom
nanami7777777:feat/disable-mcp-apps
Open

nanami7777777 wants to merge 3 commits into
github:mainfrom
nanami7777777:feat/disable-mcp-apps

Conversation

@nanami7777777

Copy link
Copy Markdown

Summary

  • Adds --mcp-apps=false and GITHUB_MCP_APPS=false so one server process can turn MCP Apps off for every client. Fixes Add a server-side option to completely disable MCP Apps #3488.
  • When disabled, the server strips _meta.ui, omits app-only tools and UI resources, skips form deferral, and returns inline tool results. The default stays enabled.
  • This complements --features=mcp_apps_disable_form_deferral, which still keeps MCP App result views.

Test plan

  • go test ./pkg/github/ -run 'TestNewMCPServer_DisableMCPAppsOmitsUISurface|Test_clientSupportsUI|Test_shouldDeferToForm_featureFlags'
  • go test ./pkg/inventory/ -run TestWithMCPApps_UnsupportedClientOmitsAppOnlyTools
  • go test ./cmd/github-mcp-server/ -run TestMCPAppsDefaultsOnAndEnvCanDisable
  • go test ./pkg/http/ -run TestUIMeta
  • Start the server with GITHUB_MCP_APPS=false against a client that advertises MCP Apps and confirm issue_write executes inline with no UI resource.

Made with Cursor

Operators sharing one image across clients need a single switch that removes UI metadata, UI resources, and form deferral while leaving the default enabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nanami7777777
nanami7777777 requested a review from a team as a code owner November 21, 2026 06:38
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 06:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Skill publishing occurs before app-tool availability is finalized, allowing published skills to require tools that are later omitted during registration.

2 open issues
What changed in this PR

Adds a server-wide MCP Apps opt-out for the GitHub MCP Server, addressing #3488 while keeping Apps enabled by default.

Changes:

  • Adds --mcp-apps=false and GITHUB_MCP_APPS=false for stdio and self-hosted HTTP servers.
  • Suppresses UI metadata, app-only tools, UI resources, and form deferral when disabled.
  • Adds configuration documentation and regression tests.
File Description
README.md Documents disabling MCP Apps with CLI and Docker examples.
pkg/​inventory/​registry.go Applies the server opt-out to tool filtering and metadata.
pkg/​inventory/​registry_test.go Tests metadata stripping and app-only tool omission.
pkg/​http/​server.go Adds HTTP configuration and startup logging.
pkg/​http/​handler.go Propagates the opt-out into request context and server configuration.
pkg/​github/​ui_capability.go Overrides UI support and bypasses form deferral.
pkg/​github/​ui_capability_test.go Tests server-disable precedence and deferral bypass.
pkg/​github/​server.go Applies registration filtering, middleware, and UI resource suppression.
pkg/​github/​server_test.go Tests the disabled server’s tool and resource surface.
pkg/​context/​request.go Adds context helpers for the server-wide opt-out.
internal/​ghmcp/​server.go Forwards stdio configuration and logs Apps status.
docs/​server-configuration.md Explains configuration scope and behavior.
cmd/​github-mcp-server/​main.go Wires the CLI flag and environment setting into both transports.
cmd/​github-mcp-server/​main_test.go Tests defaults and flag/environment disabling.

Review effort: Balanced (adaptive)

Comment thread pkg/github/server.go Outdated
Comment on lines +158 to +160
if cfg.DisableMCPApps {
ctx = ghcontext.WithMCPAppsDisabled(ctx)
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved in 3cf578a. NewMCPServer now stamps WithMCPAppsDisabled before skillsPublisher, so ConfiguredTools omits app-only tools and a skill that requires one is not published. TestSkillsSkipAppOnlyRequirementsWhenMCPAppsDisabled covers both the enabled and disabled cases.

Comment thread README.md Outdated
MCP Apps is on by default. To run the server with no MCP App UI metadata, resources, or form handoff, pass `--mcp-apps=false` or set `GITHUB_MCP_APPS=false`. Tools then execute immediately and return their results inline. This is separate from `--features=mcp_apps_disable_form_deferral`, which keeps result views and only skips the input form.

```bash
./github-mcp-server --mcp-apps=false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated in 3cf578a. The example is now github-mcp-server stdio --mcp-apps=false. The Docker example is unchanged because the image already defaults to the stdio command.

skillsPublisher filters on the tools the server will register. Setting the disable flag first keeps a skill from requiring an app-only tool that registration then omits. The README example now includes the stdio subcommand.

Co-authored-by: ango <nanami7777777@users.noreply.github.com>
Bring the branch even with github/github-mcp-server@7edc2dd1 so github#3912
is no longer behind the Swift advisory change and list_code_quality_findings.
Co-authored-by: ango <nanami7777777@users.noreply.github.com>
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.

Add a server-side option to completely disable MCP Apps

3 participants