Skip to content

Tracking: MCP Apps host conformance gaps (display-mode, update-model-context, host-context, theme propagation, ...) #6824

Open

Description

@yannj-fr

Tracking issue for the remaining gaps between the CopilotKit MCP Apps host and the MCP Apps spec (@modelcontextprotocol/ext-apps, protocol 2026-01-26).

#6707 migrated the React host onto the ext-apps AppBridge, which wires the core protocol. The bridge already supports the full host surface; the items below are host behaviors CopilotKit has not wired yet. Status is for react-core (Vue/Angular are separately hand-rolled — see #6823 for the shared-package plan that would let all three inherit these at once).

Implemented (react-core, via #6707)

  • ui/initialize + capability / protocol-version negotiation (2026-01-26)
  • Sandbox handshake (sandbox-proxy-ready → sandbox-resource-ready)
  • ui/message (with CopilotKit role/followUp extensions via _meta.copilotkit, thread-capture 🐛 Bug: MCP app ui/message follow-up work can lose its enqueue-time thread context #5819)
  • ui/open-link (with scheme denylist)
  • tools/call proxy (runAgent queue)
  • ui/notifications/size-changed
  • ui/notifications/initialized
  • ui/notifications/logging-message
  • Host → app tool-input / tool-result

Gaps to close

High priority

  • ui/request-display-mode (inline / fullscreen, close button, host-context-changed, containerDimensions) — originally feat(react-core): implement MCP Apps ui/request-display-mode host handler #6689, to be re-based onto the ext-apps base
  • ui/request-update-model-context — feed widget-provided context back to the agent
  • Propagate theme changes to the widget — sync the host's light/dark theme into the host context and emit ui/notifications/host-context-changed whenever it changes (today theme is hardcoded to "light" and never updated, so a widget can never follow the app switching to dark mode)
  • Richer host context — beyond theme, today only { theme, platform } is seeded. Missing: styles, displayMode / availableDisplayModes (comes with display-mode), containerDimensions, locale, timeZone, deviceCapabilities, safeAreaInsets — and emitting host-context-changed when any of these change, not just at initialize

Medium

  • ui/download-file
  • ui/request-teardown / teardownResource lifecycle
  • Host → app tool-input-partial and tool-cancelled
  • CSP conformance — confirm the full McpUiResourceCsp shape (connect/resource/frame domains) is read from resource _meta and applied to the sandbox, not just resourceDomains

Lower / to confirm

  • MCP passthrough requests the bridge exposes but CopilotKit does not proxy yet (read-resource, list-resources, list-prompts, create-sampling-message) — confirm which are in scope for a host
  • list-changed notifications (tools/resources/prompts) if/when applicable

Notes

Refs: #6707, #6689, #6823

Activity

  1. copilotkit-outpost-bot commented on Sep 1, 2026

    @copilotkit-outpost-bot

    ⚠️ This is an AI-generated response. We've escalated this to our engineering team — someone will follow up in this thread shortly.

    Thanks for the detailed tracking issue! This is a well-structured gap analysis against the @modelcontextprotocol/ext-apps spec (2026-01-26).

    To set expectations clearly: I'm an AI support assistant — I don't have visibility into the internal implementation state beyond what's in the public docs, and I can't confirm, reproduce, or assess the status of any of these gaps myself. The engineering team will need to triage and verify each item.

    A few things I can offer that might be useful context:

    What the public docs currently describe

    The docs at https://docs.copilotkit.ai/integrations/deepagents/generative-ui/mcp-apps and related pages describe the MCPAppsMiddleware integration surface, but don't document the host-side protocol contracts you're tracking here (display modes, host context, teardown lifecycle, etc.). So there's no public reference I can point you to for those gaps — this issue is the reference.

    Observations on the structure of this issue

    • The split between high / medium / lower priority is clear and actionable for the team
    • The note about #6823 (shared mcp-apps-support package for React/Vue/Angular) is an important dependency — one possibility is that some of the medium/lower items are intentionally deferred until that shared package lands, to avoid implementing them three times
    • The CSP conformance item is worth flagging early in review, since sandbox security properties tend to be harder to retrofit than functional gaps

    What happens next

    Since this is a GitHub tracking issue, the CopilotKit maintainers will see it directly. If you want faster triage or want to discuss implementation approach, the CopilotKit Discord is where the core team is most active for that kind of back-and-forth.

    Is there a specific gap on this list you'd like help thinking through from a consumer/integration perspective, or is this purely a maintainer-facing tracking issue?


    🤖 Generated by CopilotKit AI Support · Documentation


    Was this helpful? React with 👍 or 👎

  2. clean99 commented on Oct 24, 2026

    @clean99

    I'd like to take the dynamic host-context updates item from this checklist. #7467 already covers the initial dark theme, so this would only handle changes after initialization. I have a working branch ready if you're OK with it.

    In packages/mcp-apps-renderer/src/session.ts the session would watch the existing .dark ancestors (an explicit host theme still wins), and a new updateHostContext(...) method would take later locale, style and other host context changes. Both go through AppBridge.setHostContext to send ui/notifications/host-context-changed, buffered until the app is initialized and stopped on teardown. Tests extend the shared protocol tests with real AppBridge/postMessage traffic.

    Display mode, model-context updates and inferring new context fields stay out of scope. Should I line this up with yannj-fr's open #7760 and #7811 first, since they touch the same session code?

  3. yannj-fr commented on Oct 24, 2026

    @yannj-fr
    ContributorAuthor

    Really happy to get help, we can sync in private if you want

  4. clean99 commented on Oct 25, 2026

    @clean99

    Thanks! GitHub works for me, so I'll keep the discussion here. I'll stick to the host-context updates only, clear of #7760 and #7811, and open it as a draft PR once my other CopilotKit PR (#7979) is through, so you can see how it touches session.ts before a maintainer weighs in.

  5. yannj-fr commented on Nov 23, 2026

    @yannj-fr
    ContributorAuthor

    Status update: the two high-priority protocol items are merged, in the shared @copilotkit/mcp-apps-renderer package, so React, Vue and Angular all get them.

    ui/request-display-mode (#7760, merged 2026-11-23)

    • Inline and fullscreen; pip is refused and the response carries the mode still applied. A mode the app did not declare in appCapabilities.availableDisplayModes is refused too.
    • Fullscreen is a native <dialog> opened with showModal(), so it covers the viewport from the top layer even inside the chat's container-type panel. Close button and Escape exit; the iframe is never reparented, so the widget keeps its state.
    • Fullscreen is granted only on a gesture in the widget itself: its iframe must hold the focus, no gesture may have reached the host page in the last 5 seconds, and the page must be activated where the API exists. After an exit, every widget on the page is refused until the activation has expired.
    • Every change reaches the widget as ui/notifications/host-context-changed; the host context now carries displayMode, availableDisplayModes and containerDimensions.
    • Integrators can keep widgets inline with hostContext.availableDisplayModes: ["inline"] (mcpApps in React and Vue, provideMCPApps() in Angular).

    ui/update-model-context (#7811, merged 2026-11-16)

    • Off by default: enabled with modelContext: true. While off, the capability is not announced and the request gets -32601. The docs carry a security note, since an enabled widget writes into what the model reads.
    • One entry per widget resource per conversation (agent, thread, server, resource); the latest update wins. Text blocks and structuredContent only, up to 32,768 characters of serialized JSON.
    • The state is scoped to the conversation the widget was opened in, reaches the next runs in RunAgentInput.context, and is removed when the conversation is deleted.

    In React and Vue, mcpApps is now a single option shape carrying hostContext, allowSameOriginFallback and modelContext.

    I also compared main against the 2026-01-26 spec. Remaining gaps, beyond the ones already listed above:

    • CSP (MUST): the sandbox CSP is permissive (connect-src * and similar) and only resourceDomains is read; the spec requires the restrictive default and mapping connectDomains, frameDomains and baseUriDomains.
    • App-only tools (MUST): a widget's tools/call is forwarded even for tools whose visibility lacks "app", in @ag-ui/mcp-apps-middleware and in the Python, Ruby and .NET runtimes.
    • ui/resource-teardown (MUST): the session closes the bridge without notifying the widget first.
    • Separate sandbox origin (MUST): in progress in feat(mcp-apps): add sandboxOrigin for a separate sandbox origin #8055.
    • Smaller ones: view-initiated resources/read is not handled, serverTools is not announced in React and Vue, and the host context still lacks styles, locale, timeZone, toolInfo and the device fields.

    I can update the checklist in the issue body to reflect all of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions