@modelcontextprotocol/ext-apps - v1.1.2
    Preparing search index...
    • Applies all host styling (CSS variables, theme, and fonts) to match the host application.

      This is a convenience hook that combines useHostStyleVariables and useHostFonts. Use the individual hooks if you need more control.

      Parameters

      • app: App | null

        The connected App instance, or null during initialization

      • OptionalinitialContext: McpUiHostContext | null

        Initial host context from the connection (optional). Pass app?.getHostContext() to apply styles immediately on mount.

      Returns void

      function MyApp() {
      const { app } = useApp({
      appInfo: { name: "MyApp", version: "1.0.0" },
      capabilities: {},
      });

      // Apply all host styles - pass initial context to apply styles from connect() immediately
      useHostStyles(app, app?.getHostContext());

      return (
      <div style={{ background: "var(--color-background-primary)" }}>
      Hello!
      </div>
      );
      }