"""MCP Apps: a tool bound to a `ui://` resource the host renders as an interactive surface. `Apps` is an opt-in `Extension` passed to `MCPServer(extensions=[...])`. The `@apps.tool(resource_uri=...)` decorator stamps `_meta.ui.resourceUri` onto the tool; `add_html_resource` registers the matching `ui://` HTML resource. The tool degrades gracefully: `client_supports_apps(ctx)` reports whether the client negotiated Apps, so it returns text-only output otherwise. """ from mcp.server.apps import Apps, client_supports_apps from mcp.server.mcpserver import MCPServer from mcp.server.mcpserver.context import Context from stories._hosting import run_server_from_args RESOURCE_URI = "ui://get-time/app.html" CLOCK_HTML = """