ui:// HTML resource. The tool returns data. The resource renders the UI. The link between them is _meta.ui.resourceUri.
Use this page as the server-side contract to check before testing in a host.
If you want a shorter pre-ship checklist that covers fallback behavior, security metadata, host testing, and review readiness, use MCP App Requirements Checklist.
Choose the Right Tool Shape
Most MCP App servers have three tool shapes. Use this table before adding metadata:
Use UI-launching tools for the actions a user can ask the model to perform, such as “show orders.” Use app-only helper tools for actions the rendered View triggers directly, such as refresh, pagination, autosave, or form submit. Use backend-only tools when the result belongs in the conversation and no UI should render.
Required Pieces for a UI Tool
MCP Apps are optional. Servers should check the host’s MCP Apps capability before registering UI
metadata, then fall back to text-only MCP tools when the host does not support
text/html;profile=mcp-app.Minimal Contract
Tool Annotations
Use standard MCPannotations to describe what the tool does. Use _meta.ui to describe MCP App behavior such as View linkage and visibility.
Tool visibility and annotations are independent. An app-only helper can still be destructive, and a UI-launching model tool can be read-only.
Tool Metadata
Put UI linkage on the tool, not in the tool result:Resource Contents
The resource is the HTML template. The tool result is the data. Keep them separate so hosts can read, inspect, and cache UI HTML before the tool runs.Tool Results
Use both MCP result channels:App-Only Helper Tools
Setvisibility: ["app"] when the View needs a server round trip that the model should not see, such as refresh, pagination, autosave, or form submit.
An app-only helper tool may include resourceUri when it belongs to a specific View, but it does not have to. Omitting resourceUri means the helper is callable from the app connection but does not tell the host to render a new iframe when the tool is called.
"app".
Server Checklist
Before testing in a real host, verify the server response shape:Common Failures
Related
Build an MCP App Server
Complete server example with capability detection and fallback tools.
Add a UI to an MCP Tool
Convert a standard MCP tool into a UI-rendering MCP App.
Tool _meta
Full reference for resource linkage and tool visibility.
Requirements Checklist
Verify portability, fallback behavior, security metadata, annotations, and tests before shipping.
Tool Results and Model Context
Decide what belongs in content, structuredContent, _meta, and updateModelContext.
content vs structuredContent vs _meta
Choose the right tool result data channel.
Tool Annotations
Add host-facing safety hints to MCP App tools.
Resource _meta
Full reference for CSP, permissions, stable domains, and borders.