@modelcontextprotocol/ext-apps - v0.2.2
    Preparing search index...

    Interface McpUiHostContext

    Rich context about the host environment provided to Guest UIs.

    interface McpUiHostContext {
        availableDisplayModes?: string[];
        deviceCapabilities?: { hover?: boolean; touch?: boolean };
        displayMode?: McpUiDisplayMode;
        locale?: string;
        platform?: "web" | "desktop" | "mobile";
        safeAreaInsets?: {
            bottom: number;
            left: number;
            right: number;
            top: number;
        };
        styles?: McpUiHostStyles;
        theme?: McpUiTheme;
        timeZone?: string;
        toolInfo?: {
            id: RequestId;
            tool: {
                _meta?: { [key: string]: unknown };
                annotations?: {
                    destructiveHint?: boolean;
                    idempotentHint?: boolean;
                    openWorldHint?: boolean;
                    readOnlyHint?: boolean;
                    title?: string;
                };
                description?: string;
                execution?: { taskSupport?: "optional"
                | "required"
                | "forbidden" };
                icons?: { mimeType?: string; sizes?: string[]; src: string }[];
                inputSchema: {
                    properties?: { [key: string]: object };
                    required?: string[];
                    type: "object";
                    [key: string]: unknown;
                };
                name: string;
                outputSchema?: {
                    properties?: { [key: string]: object };
                    required?: string[];
                    type: "object";
                    [key: string]: unknown;
                };
                title?: string;
            };
        };
        userAgent?: string;
        viewport?: {
            height: number;
            maxHeight?: number;
            maxWidth?: number;
            width: number;
        };
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown

      Allow additional properties for forward compatibility.

    Index

    Properties

    availableDisplayModes?: string[]

    Display modes the host supports.

    deviceCapabilities?: { hover?: boolean; touch?: boolean }

    Type Declaration

    • Optionalhover?: boolean

      Whether the device supports hover interactions.

    • Optionaltouch?: boolean

      Whether the device supports touch input.

    Device input capabilities.

    displayMode?: McpUiDisplayMode

    How the UI is currently displayed.

    locale?: string

    User's language and region preference in BCP 47 format.

    platform?: "web" | "desktop" | "mobile"

    Platform type for responsive design decisions.

    safeAreaInsets?: { bottom: number; left: number; right: number; top: number }

    Type Declaration

    • bottom: number

      Bottom safe area inset in pixels.

    • left: number

      Left safe area inset in pixels.

    • right: number

      Right safe area inset in pixels.

    • top: number

      Top safe area inset in pixels.

    Mobile safe area boundaries in pixels.

    Style configuration for theming the app.

    theme?: McpUiTheme

    Current color theme preference.

    timeZone?: string

    User's timezone in IANA format.

    toolInfo?: {
        id: RequestId;
        tool: {
            _meta?: { [key: string]: unknown };
            annotations?: {
                destructiveHint?: boolean;
                idempotentHint?: boolean;
                openWorldHint?: boolean;
                readOnlyHint?: boolean;
                title?: string;
            };
            description?: string;
            execution?: { taskSupport?: "optional"
            | "required"
            | "forbidden" };
            icons?: { mimeType?: string; sizes?: string[]; src: string }[];
            inputSchema: {
                properties?: { [key: string]: object };
                required?: string[];
                type: "object";
                [key: string]: unknown;
            };
            name: string;
            outputSchema?: {
                properties?: { [key: string]: object };
                required?: string[];
                type: "object";
                [key: string]: unknown;
            };
            title?: string;
        };
    }

    Type Declaration

    • id: RequestId

      JSON-RPC id of the tools/call request.

    • tool: {
          _meta?: { [key: string]: unknown };
          annotations?: {
              destructiveHint?: boolean;
              idempotentHint?: boolean;
              openWorldHint?: boolean;
              readOnlyHint?: boolean;
              title?: string;
          };
          description?: string;
          execution?: { taskSupport?: "optional"
          | "required"
          | "forbidden" };
          icons?: { mimeType?: string; sizes?: string[]; src: string }[];
          inputSchema: {
              properties?: { [key: string]: object };
              required?: string[];
              type: "object";
              [key: string]: unknown;
          };
          name: string;
          outputSchema?: {
              properties?: { [key: string]: object };
              required?: string[];
              type: "object";
              [key: string]: unknown;
          };
          title?: string;
      }

      Tool definition including name, inputSchema, etc.

    Metadata of the tool call that instantiated this App.

    userAgent?: string

    Host application identifier.

    viewport?: {
        height: number;
        maxHeight?: number;
        maxWidth?: number;
        width: number;
    }

    Type Declaration

    • height: number

      Current viewport height in pixels.

    • OptionalmaxHeight?: number

      Maximum available height in pixels (if constrained).

    • OptionalmaxWidth?: number

      Maximum available width in pixels (if constrained).

    • width: number

      Current viewport width in pixels.

    Current and maximum dimensions available to the UI.