Add MCP Apps (SEP-1865) support and playbook#2
Merged
Merged
Conversation
Server-side helpers for serving interactive HTML widgets that MCP hosts (Cursor, Claude, ...) render inline with tool results: - ui_extension_capability / add_ui_extension_capability! — advertise the io.modelcontextprotocol/ui extension in initialize - register_ui_resource! + MCPUIResource — ui:// resources with the text/html;profile=mcp-app mime type - ui_tool_meta — dual-written _meta (ui.resourceUri + ui/resourceUri) for cross-host compatibility, with model/app visibility control - ui_tool_content / embedded_ui_resource — embed the widget copy in tool results (required by hosts that do not fetch resources/read) - mcp_app_html + MCP_APP_BOOTSTRAP_JS — complete widget document builder with the ui/initialize handshake, initialized notification, automatic size-changed reporting (ResizeObserver), multi-channel render-data delivery with late-subscriber replay, and host tools/call proxying - protocol version negotiation: initialize now echoes a client-requested version when listed in the new supported_protocol_versions config MCP-App-playbook.md documents the full requirement set, verification runbook (curl + standalone widget harness + Cursor), troubleshooting table, and a porting checklist for new applications. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…stays valid Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…widgets Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
First-class server-side support for MCP Apps (SEP-1865, extension
io.modelcontextprotocol/ui) — interactive HTML widgets that hosts like Cursor and Claude render inline with tool results — plusMCP-App-playbook.md, an end-to-end guide distilled from getting a production integration rendering in Cursor.New API (
src/apps.jl)ui_extension_capability()/add_ui_extension_capability!— advertise the Apps extension ininitializeregister_ui_resource!+MCPUIResource—ui://resources with thetext/html;profile=mcp-appmime typeui_tool_meta— dual-written_meta(ui.resourceUriandui/resourceUri) for cross-host compat, with model/app visibilityui_tool_content/embedded_ui_resource— embed the widget in tool results (hosts like Cursor render the embedded copy and don't fetchresources/read)mcp_app_html+MCP_APP_BOOTSTRAP_JS— complete widget document builder:ui/initializehandshake (protocolVersion/appInfo/appCapabilities),ui/notifications/initialized, automaticsize-changedvia ResizeObserver, multi-channel render-data delivery with late-subscriber replay, andtools/callproxying viawindow.mcpAppProtocol version negotiation
initializepreviously ignored the client's requestedprotocolVersion. Newsupported_protocol_versionsconfig lists additional versions the server will echo back when requested (default behavior unchanged).Tests
New
MCP Appstestset (50 assertions): capability shapes, meta dual-write, negotiation, HTML shell guards, and a full wire-level widget-backed server exercised through the package's own HTTP client (initialize → tools/list → resources/read → tools/call with embedded resource + structuredContent).🤖 Generated with Claude Code