Overview
Returns a function to download files through the host. Since MCP Apps run in sandboxed iframes where direct downloads are blocked, this provides a host-mediated mechanism for file exports. Supports embedded text content, embedded binary (base64) content, and resource links that the host fetches on behalf of the app.Wraps downloadFile
MCP Apps SDK reference
Import
Signature
DownloadFileParams
Resource contents to download — embedded (inline data) or linked (host fetches).
Returns
Function to request a file download through the host.
DownloadFileResult
Whether the download failed (e.g. user cancelled or host denied).