MCP Apps: align with the 2026-01-26 stable spec#2573
Merged
Conversation
Placeholder commit to open a draft PR. See plan in session workspace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Per the MCP Apps 2026-01-26 spec, servers SHOULD check client capabilities before advertising UI-enabled tools. Extend the inventory strip gate to remove _meta.ui not only when the feature flag is off, but also when the request context explicitly reports the client lacks UI support (HasUISupport returns supported=false, ok=true). When the capability is unknown (ok=false, e.g. stdio paths), fall through to the existing feature-flag gate so existing behaviour is preserved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Explicitly set prefersBorder on every UI resource — false for the get_me profile card, true for the issue/PR write forms — since hosts' defaults vary. * Declare an empty csp on issue_write_ui and pr_write_ui to document that they need no external origins. * Point spec link comment at the stable 2026-01-26 location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Declare appCapabilities.availableDisplayModes (defaults to ["inline"]) during initialization, as required by the new spec. * Track McpUiHostContext (and its updates via onhostcontextchanged) and thread it into AppProvider, which now picks up host-supplied theme + CSS style variables and projects them onto the root element so Primer components inherit host theming. * Add setModelContext and openLink helpers to useMcpApp. issue-write and pr-write call setModelContext on a successful submission so the agent has the new entity in its next-turn context; get-me uses openLink for the profile's external blog link. The pinned @modelcontextprotocol/ext-apps ^1.7.2 was already resolved to 1.7.2 in the lockfile, so no dependency bump is required for the new HostContext / openLink / updateModelContext APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8127e23 to
e0cf732
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the MCP Apps implementation with the stable 2026-01-26 spec across server-side tool metadata handling, UI resource metadata, and React app host integration.
Changes:
- Adds client UI-capability-aware stripping of MCP Apps
_meta.uiduring tool registration. - Updates UI resource metadata with explicit
prefersBorder, CSP metadata, and stable spec references. - Updates React views to declare display modes, consume host context/theme variables, open links through the host, and update model context after write actions.
Show a summary per file
| File | Description |
|---|---|
pkg/inventory/registry.go |
Centralizes _meta.ui strip logic using feature flag and UI capability context. |
pkg/inventory/registry_test.go |
Adds truth-table coverage for the new strip predicate. |
pkg/http/handler_test.go |
Verifies UI metadata is stripped/preserved based on client UI capability context. |
pkg/github/ui_resources.go |
Adds stable-spec UI resource metadata for CSP and border preference. |
ui/src/hooks/useMcpApp.ts |
Adds display mode capabilities, host context tracking, model context updates, and host link opening. |
ui/src/components/AppProvider.tsx |
Applies host theme and CSS variables to Primer rendering. |
ui/src/apps/get-me/App.tsx |
Threads host context and routes blog links through ui/open-link. |
ui/src/apps/issue-write/App.tsx |
Threads host context and updates model context after issue create/update. |
ui/src/apps/pr-write/App.tsx |
Threads host context and updates model context after PR creation. |
Copilot's findings
- Files reviewed: 9/9 changed files
- Comments generated: 0
SamMorrowDrums
approved these changes
May 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Aligns this repository's MCP Apps implementation with the stable 2026-01-26 spec (https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx).
Server (Go)
_meta.uiwhen the client lacks the UI capability. Per the spec, servers SHOULD check client capabilities before advertising UI-enabled tools. The per-request inventory strip now also applies when the request context reports the client has no UI support; unknown capability (e.g. stdio paths) falls through to the existing feature-flag gate. New unit test inpkg/inventory/registry_test.goand integration test inpkg/http/handler_test.go.prefersBorderon every UI resource (false for the get-me profile card, true for the issue/PR write forms) — the spec recommends an explicit value because host defaults vary.csp: {}onissue_write_uiandpr_write_uito document they need no external origins./specification/2026-01-26/path.Views (React,
ui/)appCapabilities.availableDisplayModesduring initialization (defaults to["inline"]); required by the new spec.McpUiHostContext: track hostthemeandstyles.variables, project the standardized CSS custom properties onto the root element, and pass the theme to Primer'sThemeProvider.useMcpApphelpers:setModelContext(...)— used by issue-write and pr-write after a successful submission to update the agent's model context with the created/updated entity (ui/update-model-context).openLink(url)— used by the get-me view's external blog link (ui/open-link).@modelcontextprotocol/ext-apps1.7.2 (matches the^1.7.2already pinned inpackage.json).Testing
script/lint— clean.script/test— all passing, including newTestShouldStripMCPAppsMetadataandTestUIMetaStrippedWhenClientLacksCapability.npm run typecheck && npm run build— clean.Companion PR on
github-mcp-server-remote: https://github.com/github/github-mcp-server-remote/pull/849