Skip to content

MCP Apps: align with the 2026-01-26 stable spec#2573

Merged
SamMorrowDrums merged 4 commits into
mainfrom
mcp-apps-2026-01-26-spec
May 29, 2026
Merged

MCP Apps: align with the 2026-01-26 stable spec#2573
SamMorrowDrums merged 4 commits into
mainfrom
mcp-apps-2026-01-26-spec

Conversation

@mattdholloway
Copy link
Copy Markdown
Contributor

@mattdholloway mattdholloway commented May 29, 2026

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)

  • Strip _meta.ui when 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 in pkg/inventory/registry_test.go and integration test in pkg/http/handler_test.go.
  • prefersBorder on 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.
  • Empty csp: {} on issue_write_ui and pr_write_ui to document they need no external origins.
  • Spec-link comment now points at the stable /specification/2026-01-26/ path.

Views (React, ui/)

  • Declare appCapabilities.availableDisplayModes during initialization (defaults to ["inline"]); required by the new spec.
  • Consume McpUiHostContext: track host theme and styles.variables, project the standardized CSS custom properties onto the root element, and pass the theme to Primer's ThemeProvider.
  • New useMcpApp helpers:
    • 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).
  • Bundles rebuilt against the resolved @modelcontextprotocol/ext-apps 1.7.2 (matches the ^1.7.2 already pinned in package.json).

Testing

  • script/lint — clean.
  • script/test — all passing, including new TestShouldStripMCPAppsMetadata and TestUIMetaStrippedWhenClientLacksCapability.
  • npm run typecheck && npm run build — clean.

Companion PR on github-mcp-server-remote: https://github.com/github/github-mcp-server-remote/pull/849

mattdholloway and others added 4 commits May 29, 2026 16:18
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>
@mattdholloway mattdholloway force-pushed the mcp-apps-2026-01-26-spec branch from 8127e23 to e0cf732 Compare May 29, 2026 15:32
@mattdholloway mattdholloway self-assigned this May 29, 2026
@mattdholloway mattdholloway marked this pull request as ready for review May 29, 2026 15:37
@mattdholloway mattdholloway requested a review from a team as a code owner May 29, 2026 15:37
Copilot AI review requested due to automatic review settings May 29, 2026 15:37
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 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.ui during 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 SamMorrowDrums merged commit c0dca1f into main May 29, 2026
20 checks passed
@SamMorrowDrums SamMorrowDrums deleted the mcp-apps-2026-01-26-spec branch May 29, 2026 17:41
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.

3 participants