Server
| API | Description |
|---|---|
mcpAuthMetadataRouter | Serve OAuth metadata for client discovery. |
McpServer | The server you register tools and views on. |
optionalBearerAuth | Attach a verified identity when a token is present. |
registerTool | Register a tool, its schemas, and the view it renders. |
requireBearerAuth | Gate a server behind a verified bearer token. |
Hooks
| Hook | Description | Supported Hosts |
|---|---|---|
useCallTool | Call server tools from the view and track call state. | |
useDisplayMode | Read and request inline, pip, or fullscreen. | |
useDownload | Save files to the userβs device. | |
useFiles | Upload and pick host-managed files. | |
useLayout | Read theme, max height, and safe-area insets. | |
useOpenExternal | Open a URL outside the view iframe. | |
useRegisterViewTool | Expose a tool that runs inside the view. | |
useRequestClose | Ask the host to dismiss the view. | |
useRequestModal | Open the view as a host modal. | |
useRequestSize | Ask the host to resize the view iframe. | |
useSendFollowUpMessage | Send a follow-up turn to the model. | |
useSetOpenInAppUrl | Override the fullscreen open-in-app URL. | |
useToolInfo | Read the tool input, output, and metadata that rendered the view. | |
useUser | Read locale and device capabilities. | |
useViewState | Persist UI state on the host across renders. |
Utilities
| Utility | Description |
|---|---|
createStore | A Zustand store synced with host view state. |
data-llm | Describe on-screen state to the model in words. |
generateHelpers | Generate typed hooks inferred from your server. |
Types
| Type | Description |
|---|---|
FileRef | Reference a host-managed file in a tool schema. |
| Type Utilities | Pull tool input, output, and name types from your server. |
Low-level
| Hook | Description |
|---|---|
useAppsSdkContext | Read a raw ChatGPT (Apps SDK) context value by key. |
useMcpAppContext | Read a raw MCP Apps context value by key. |
Quickstart
Scaffold and run your first app
Build Tools
Register the tools these APIs call
Apps SDK and MCP Apps
How the two runtimes differ and whatβs unified