49b9bb6724
Deploy Docs / deploy-docs (push) Failing after 1s
Conformance Tests / client-conformance (push) Failing after 3s
Conformance Tests / server-conformance (push) Failing after 1s
GitHub Actions Security Analysis / zizmor (push) Failing after 1s
CI / checks (push) Failing after 59m20s
CI / all-green (push) Waiting to run
apps
MCP Apps: a tool carries a _meta.ui.resourceUri reference to a ui://
resource that the host renders as an interactive surface. The server opts in via
the Apps extension (io.modelcontextprotocol/ui); the client negotiates it by
advertising the text/html;profile=mcp-app MIME type.
Run it
# stdio (default — the client spawns the server as a subprocess)
uv run python -m stories.apps.client
# HTTP — the client self-hosts the server on a free port, runs, then tears it down
uv run python -m stories.apps.client --http
What to look at
server.pyMCPServer("apps-example", extensions=[apps])— the extension advertisesio.modelcontextprotocol/uiunderServerCapabilities.extensionsand contributes the UI-bound tool and itsui://resource.MCPServeritself never learns about "ui"; it applies a closed set of contributions.server.py@apps.tool(resource_uri=...)— stamps_meta.ui.resourceUrion the tool;add_html_resourceregisters the matchingui://resource attext/html;profile=mcp-app.server.pyclient_supports_apps(ctx)— SEP-2133 graceful degradation: a client that did not negotiate Apps gets a text-only result.client.pyClient(target, extensions=[advertise(...)])— the client advertises Apps support so the server returns the UI-enabled result, then reads the tool's_meta.ui.resourceUriand fetches that resource.
Spec
MCP Apps — extensions · SEP-2133 — extensions capability
See also
custom_methods/ (registering a non-spec method without an extension).