Optional Readonly_Additional _meta merged with the auto-generated ui.resourceUri.
The ui.resourceUri key is always set automatically from the resource URI.
Optional ReadonlyannotationsOptional tool annotations
ReadonlydescriptionHuman-readable description
Tool handler function.
Validated input (typed from Zod schema)
Execution context with progress reporter, abort signal
MCP CallToolResult (use response helpers: text(), json(), error())
ReadonlyinputZod schema for tool input validation
ReadonlynameUnique app/tool name
Optional ReadonlyrequiredScopes required to execute this app's tool (RBAC).
Passed through to the internal defineTool() call.
All listed scopes must be present (AND logic).
ReadonlyresourceResource definition for the app's UI
Definition for an MCP App — a tool linked to a UI resource.
MCP Apps combine a tool with a resource to create interactive experiences. The tool's
_meta.ui.resourceUrilinks to the resource, and MCP clients use this to render the UI.defineApp()internally creates both adefineTool()and adefineResource(), auto-registering them in the global registries.Example