Skip to main content
An MCP Apps host (Claude and others) exposes view context that Skybridge’s cross-host hooks read for you. 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.
import { useMcpAppContext } from "skybridge/web";

function Schedule({ events }: { events: Event[] }) {
  const timeZone = useMcpAppContext("timeZone");

  return (
    <ul>
      {events.map((event) => (
        <li key={event.id}>
          {event.start.toLocaleString(undefined, { timeZone })}
        </li>
      ))}
    </ul>
  );
}

Type Parameters

K

K extends keyof McpAppContext;
Inferred from key: the literal key you pass fixes the return type to McpAppContext[K].

Parameters

key

key: K;
Required. The context key to read and subscribe to. The hook re-renders only when this key changes; to watch several keys, call it once per key.

options

options?: Partial<{ appInfo: Implementation }>;
appInfo ({ name, version }) optionally identifies the view to the host. Omit it for a generic default.

Returns

value: McpAppContext[K];
The requested key’s current value, empty until the host provides it: host-context keys are 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.
KeyValueAlso via
theme"light" or "dark"useLayout
localeBCP-47 localeuseUser
timeZoneIANA time zone
displayModecurrent layout (inline / fullscreen / pip)useDisplayMode
availableDisplayModeslayouts the host supports
containerDimensionsthe view’s available size (height and width)useLayout
userAgentraw host user-agent string
platformweb / desktop / mobileuseUser
deviceCapabilitiestouch and hover supportuseUser
safeAreaInsetsinsets to keep clear of host chromeuseLayout
styleshost theme tokens
toolInfothe tool definition that rendered the view
toolInputthe tool call’s argumentsuseToolInfo
toolResultthe tool’s full MCP result (structuredContent model-visible)useToolInfo
toolCancelledset 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