mcp-use TypeScript API
    Preparing search index...

    Function useHostContext

    • Subscribe to host environment context (theme, locale, display mode, layout).

      Re-renders only when host context or bridge connection status changes — not on tool-input / result / cancel snapshot updates.

      Returns HostContextHandle

      function Layout() {
      const { theme, locale, maxHeight } = useHostContext();
      return (
      <div data-theme={theme} lang={locale} style={{ maxHeight }}>

      </div>
      );
      }