useMcpAppContext is the escape hatch: it reads that context raw, by key, for a protocol-level field the hooks don’t surface. It runs only on MCP Apps hosts, not ChatGPT; the Apps SDK counterpart is useAppsSdkContext.
Example
useUser gives the locale but not the host time zone, so a schedule reads timeZone from the context to render times in the user’s zone.
Type Parameters
K
key: the literal key you pass fixes the return type to McpAppContext[K].
Parameters
key
options
appInfo ({ name, version }) optionally identifies the view to the host. Omit it for a generic default.
Returns
undefined, tool-state keys null. The table lists each key with the cross-host hook that also surfaces it; hosts may send others not listed.
| Key | Value | Also via |
|---|---|---|
theme | "light" or "dark" | useLayout |
locale | BCP-47 locale | useUser |
timeZone | IANA time zone | — |
displayMode | current layout (inline / fullscreen / pip) | useDisplayMode |
availableDisplayModes | layouts the host supports | — |
containerDimensions | the view’s available size (height and width) | useLayout |
userAgent | raw host user-agent string | — |
platform | web / desktop / mobile | useUser |
deviceCapabilities | touch and hover support | useUser |
safeAreaInsets | insets to keep clear of host chrome | useLayout |
styles | host theme tokens | — |
toolInfo | the tool definition that rendered the view | — |
toolInput | the tool call’s arguments | useToolInfo |
toolResult | the tool’s full MCP result (structuredContent model-visible) | useToolInfo |
toolCancelled | set when the host aborts the call | — |
useAppsSdkContext
The Apps SDK counterpart for ChatGPT
useToolInfo
Read the tool result across both runtimes
Apps SDK and MCP Apps
What the raw MCP Apps layer is, and how Skybridge unifies it