@modelcontextprotocol/ext-apps - v1.1.2
    Preparing search index...

    Interface McpUiDownloadFileRequest

    Request to download a file through the host.

    Sent from the View to the Host when the app wants to trigger a file download. Since MCP Apps run in sandboxed iframes where direct downloads are blocked, this provides a host-mediated mechanism for file exports. The host SHOULD show a confirmation dialog before initiating the download.

    App.downloadFile for the method that sends this request

    interface McpUiDownloadFileRequest {
        method: "ui/download-file";
        params: {
            contents: (
                | {
                    _meta?: { [key: string]: unknown };
                    annotations?: {
                        audience?: ("user" | "assistant")[];
                        lastModified?: string;
                        priority?: number;
                    };
                    resource: | {
                        _meta?: { [key: string]: unknown };
                        mimeType?: string;
                        text: string;
                        uri: string;
                    }
                    | {
                        _meta?: { [key: string]: unknown };
                        blob: string;
                        mimeType?: string;
                        uri: string;
                    };
                    type: "resource";
                }
                | {
                    _meta?: { [key: string]: unknown };
                    annotations?: {
                        audience?: ("user" | "assistant")[];
                        lastModified?: string;
                        priority?: number;
                    };
                    description?: string;
                    icons?: {
                        mimeType?: string;
                        sizes?: string[];
                        src: string;
                        theme?: "light"
                        | "dark";
                    }[];
                    mimeType?: string;
                    name: string;
                    title?: string;
                    type: "resource_link";
                    uri: string;
                }
            )[];
        };
    }
    Index

    Properties

    Properties

    method: "ui/download-file"
    params: {
        contents: (
            | {
                _meta?: { [key: string]: unknown };
                annotations?: {
                    audience?: ("user" | "assistant")[];
                    lastModified?: string;
                    priority?: number;
                };
                resource: | {
                    _meta?: { [key: string]: unknown };
                    mimeType?: string;
                    text: string;
                    uri: string;
                }
                | {
                    _meta?: { [key: string]: unknown };
                    blob: string;
                    mimeType?: string;
                    uri: string;
                };
                type: "resource";
            }
            | {
                _meta?: { [key: string]: unknown };
                annotations?: {
                    audience?: ("user" | "assistant")[];
                    lastModified?: string;
                    priority?: number;
                };
                description?: string;
                icons?: {
                    mimeType?: string;
                    sizes?: string[];
                    src: string;
                    theme?: "light"
                    | "dark";
                }[];
                mimeType?: string;
                name: string;
                title?: string;
                type: "resource_link";
                uri: string;
            }
        )[];
    }

    Type Declaration

    • contents: (
          | {
              _meta?: { [key: string]: unknown };
              annotations?: {
                  audience?: ("user" | "assistant")[];
                  lastModified?: string;
                  priority?: number;
              };
              resource: | {
                  _meta?: { [key: string]: unknown };
                  mimeType?: string;
                  text: string;
                  uri: string;
              }
              | {
                  _meta?: { [key: string]: unknown };
                  blob: string;
                  mimeType?: string;
                  uri: string;
              };
              type: "resource";
          }
          | {
              _meta?: { [key: string]: unknown };
              annotations?: {
                  audience?: ("user" | "assistant")[];
                  lastModified?: string;
                  priority?: number;
              };
              description?: string;
              icons?: {
                  mimeType?: string;
                  sizes?: string[];
                  src: string;
                  theme?: "light"
                  | "dark";
              }[];
              mimeType?: string;
              name: string;
              title?: string;
              type: "resource_link";
              uri: string;
          }
      )[]

      Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.