pub const MCP_APPS: &str = "# MCP Apps\n\nMCP Apps is a PMCP extension that enables rich HTML widget UIs for tools.\nWhen a tool has UI metadata, compatible MCP hosts render interactive widgets\nalongside the tool\'s structured output.\n\n## Adding UI to a Tool\n\nUse `.with_ui()` on any typed tool:\n\n```rust\nuse pmcp::types::UIMimeType;\n\nserver_builder.tool_typed(\n MyTool.with_ui(UIMimeType::Html, \"widget://my-widget\")\n);\n```\n\nThe `UIMimeType` specifies the widget content type:\n- `UIMimeType::Html` -- standalone HTML widget\n- `UIMimeType::HtmlMcpApp` -- MCP App with bridge integration\n\n## Widget Resources\n\nWidgets are served as resources with `widget://` URIs. The host loads the\nwidget in an iframe and bridges it with the tool\'s structured output.\n\n```rust\n// Register a widget resource\nserver_builder.resource_handler(\"widget://\", WidgetResourceHandler);\n```\n\n## _meta Emission\n\nWhen a tool has UI, the SDK automatically emits `_meta` in the tool result:\n\n```json\n{\n \"structuredContent\": { \"value\": 42 },\n \"_meta\": {\n \"ui\": {\n \"resourceUri\": \"widget://my-widget\"\n }\n }\n}\n```\n\nThe host uses this to locate and render the widget.\n\n## Widget Runtime Bridge\n\nWidgets communicate with the host via the `ext-apps` bridge:\n\n```html\n<script type=\"module\">\nimport { App } from \'https://cdn.pmcp.run/ext-apps/latest/index.mjs\';\n\nconst app = new App();\napp.onToolResult((result) => {\n // Update widget with tool output\n document.getElementById(\'output\').textContent = JSON.stringify(result);\n});\n</script>\n```\n\n## Host Layer Support\n\nMCP Apps works across multiple hosts:\n- **Claude Desktop** -- standard `ui.resourceUri` metadata\n- **ChatGPT** -- automatic `openai/outputTemplate` enrichment\n- **MCP Inspector** -- preview mode via `mcp-preview`\n\n## Testing MCP Apps\n\nUse `cargo pmcp test apps` to validate:\n- Widget resource URIs resolve correctly\n- Tool _meta contains required UI keys\n- Widget HTML is well-formed\n- Cross-reference between tools and widget resources\n";Expand description
MCP Apps extension (widgets, _meta, host layers).