@modelcontextprotocol/ext-apps - v1.1.2
    Preparing search index...
    • React hook that applies host fonts from CSS.

      This hook listens to host context changes and automatically applies:

      • styles.css.fonts as a <style> tag for custom fonts

      The CSS can contain @font-face rules for self-hosted fonts, @import statements for Google Fonts or other font services, or both.

      The hook also applies fonts from the initial host context when the app first connects.

      Parameters

      • app: App | null

        The connected App instance, or null during initialization

      • OptionalinitialContext: McpUiHostContext | null

        Initial host context from the connection (optional). If provided, fonts will be applied immediately on mount.

      Returns void

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

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

      return <div style={{ fontFamily: "var(--font-sans)" }}>Hello!</div>;
      }