App identification (name and version)
OptionalautoAutomatically report size changes to the host using ResizeObserver.
When enabled, the App monitors document.body and document.documentElement
for size changes and automatically sends ui/notifications/size-changed
notifications to the host.
Declares what features this app supports.
OptionalonCalled after App is created but before connection.
Use this to register request/notification handlers that need to be in place before the initialization handshake completes.
OptionalstrictThrow on detected misuse instead of logging a console warning.
Currently this affects calling host-bound methods (e.g.
callServerTool, sendMessage)
before connect has completed the ui/initialize
handshake. With strict: false (default) a console.warn is emitted;
with strict: true an Error is thrown.
OptionalwebBridge tools between the Apps SDK and WebMCP, in both directions:
registerTool are
mirrored into document.modelContext when the document provides one,
so WebMCP-enabled hosts discover them without speaking the Apps
tools/list channel (the tools/list / tools/call wire path is
unaffected either way);document.modelContext are served over
the Apps tools/list / tools/call channel, so WebMCP-authored Views
work on MCP Apps hosts that do not provide WebMCP themselves. Tools
registered with registerTool win on name
collisions, and tools the App itself mirrored into
WebMCP are never echoed back.Pass false to disable the bridge.
Options for configuring the
useApphook.The
autoResize,strictandwebMcpBridgeoptions are forwarded to the underlyingAppinstance. For otherAppOptions, create theAppmanually instead of using this hook.See
useAppfor the hook that uses these optionsuseAutoResizefor manual auto-resize control with customAppoptions