Repository navigation
Add a server option to disable MCP Apps entirely - #3912
nanami7777777 wants to merge 3 commits into
Conversation
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>
There was a problem hiding this comment.
🟡 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=falseandGITHUB_MCP_APPS=falsefor 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)
| if cfg.DisableMCPApps { | ||
| ctx = ghcontext.WithMCPAppsDisabled(ctx) | ||
| } |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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>


Summary
--mcp-apps=falseandGITHUB_MCP_APPS=falseso one server process can turn MCP Apps off for every client. Fixes Add a server-side option to completely disable MCP Apps #3488._meta.ui, omits app-only tools and UI resources, skips form deferral, and returns inline tool results. The default stays enabled.--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_UnsupportedClientOmitsAppOnlyToolsgo test ./cmd/github-mcp-server/ -run TestMCPAppsDefaultsOnAndEnvCanDisablego test ./pkg/http/ -run TestUIMetaGITHUB_MCP_APPS=falseagainst a client that advertises MCP Apps and confirmissue_writeexecutes inline with no UI resource.Made with Cursor