What problem does it solve?
Enables MCP servers to provide interactive, inline UI widgets in conversation hosts so users can fill structured forms, pick items, confirm destructive actions, view visual previews, and monitor long-running jobs without leaving the chat. It bridges server-side tools and client-side UI resources while ensuring graceful degradation when hosts lack an apps surface.
Core Features & Use Cases
- Widget-enabled tools: Register tools that return plain JSON/text and declare a UI resource URI so hosts can render a focused widget (picker, confirm dialog, chart) alongside the tool result.
- Resource registration & delivery: Serve HTML widget templates as registered resources with the required RESOURCE_MIME_TYPE so hosts render them in a sandboxed iframe.
- App messaging & lifecycle: Use the App class API for ontoolresult, ontoolinput, sendMessage, updateModelContext, callServerTool, and openLink to handle bidirectional widget ↔ host ↔ server communication.
- CSP and bundling guidance: Inline the ext-apps/app-with-deps bundle into widget HTML and inline images as data: URLs to avoid sandbox/CSP failures and ensure reliable rendering.
- Deployment shapes & testing: Support remote HTTP servers or MCPB-packaged local servers; include testing patterns for headless JSON-RPC and Desktop hosts, and guidance for caching and dev iteration.
Quick Start
Create an MCP app that registers a pick_contact tool with _meta.ui.resourceUri pointing to ui://widgets/picker.html and serve a picker HTML resource that inlines the ext-apps bundle so the host can render an interactive contact picker.