OptionalautoEnable automatic size change notifications (MCP adapter only).
When enabled, the UI automatically reports its size changes to the host using a ResizeObserver on document.body and document.documentElement. The host can then resize the UI container accordingly.
React component to render as the UI.
Must be a function component or class component. The component will be wrapped in AppsProvider from @mcp-apps-kit/ui-react, giving it access to hooks like useToolResult, useAppsClient, etc.
The component's name is used to generate the output HTML filename.
For example, a component named GreetingWidget will output to
greeting-widget.html.
OptionalcspContent Security Policy configuration. Controls what external resources the UI can access.
OptionaldefaultOptional default props to pass to the component.
These props are baked into the HTML at build time. For runtime data, use hooks like useToolResult instead.
OptionaldescriptionOptional description of the UI resource. Used in protocol metadata.
OptionaldomainDedicated domain for widget isolation. Advanced feature for security-sensitive applications.
ChatGPT only - ignored on MCP Apps.
OptionalnameOptional display name for the UI resource. Used in protocol metadata.
OptionaloutOutput directory for the built HTML file. Defaults to "./src/ui/dist" if not specified.
OptionalprefersRequest a visible border around the widget. Hint to the host platform - may not be honored.
OptionalwidgetHuman-readable summary for the AI model (ChatGPT only).
This description helps the model understand what the widget does and when to display it. Keep it concise and informative.
Input for defining a React component UI.
This is what you pass to
defineReactUI(). The function returns a standardUIDefwith an auto-generatedhtmlpath that the Vite plugin will build.Example