Local file upload
prepare_file_upload prepares a direct file transfer. File bytes stay in the
client’s HTTP PUT; the MCP tool does not read local paths or accept file bytes.
No AWS credentials are needed.
1
Compute size, MIME type, and checksum
Measure the exact byte count and hexadecimal SHA-256 of the complete local
file. Files must be from 1 through 209715200 bytes (200 MiB).
2
Prepare the transfer
Call
prepare_file_upload with fileSize, mimeType, and sha256.
Save the returned uploadId, uploadUrl, headers, and expiresAt.3
PUT the file
Within five minutes, use a local HTTP client to PUT the original bytes to
uploadUrl, sending every returned header exactly. The URL signs the
declared size, type, checksum, and overwrite protection.4
Verify completion
Call
complete_file_upload with the saved uploadId using the same account
and MCP endpoint. Use its canonical url in subsequent tool inputs.prepare_file_upload
All three inputs are required:
Returns
uploadId (UUID), uploadUrl, headers (string-to-string map),
expiresAt (ISO 8601). Each successful preparation creates a new ticket; save
it instead of preparing another upload for the same successful operation.
This illustrative request uses synthetic size/checksum values. Replace them
with values calculated from the exact file before calling:
complete_file_upload
Required:uploadId, a canonical UUID issued during preparation. Completion
checks ownership, the ticket deadline, and the stored object’s actual byte count,
MIME type, and SHA-256 checksum.
Returns url, previewUrl, mimeType, fileSize. The canonical url is the
generation source; previewUrl is a temporary viewing URL.
uploadId. Completion is safe to
retry with that same ID for one hour after preparation, including after a PUT
timeout, a repeated PUT returning HTTP 412, or expiry of the five-minute PUT
URL. Completion still requires an existing matching object; expiry of the PUT
URL does not imply that an unfinished upload can be transferred again.
Remote import
import_file
Required:url, a direct publicly accessible HTTP(S) download URL, nonblank and
at most 8192 characters. Use a DNS hostname and the standard HTTP(S) port.
Query parameters are supported. The source must return HTTP 200 directly
without compressed HTTP content encoding; redirects, authentication, private
network destinations, and IP-literal hosts are not supported.
The file must be from 1 byte through 200 MiB. Returns url, previewUrl, mimeType, fileSize,
in the same public shape as upload completion. Each successful import creates
a new file. Save and reuse the returned canonical url.
Preparation and import share a quota of 60 upload attempts per account per hour.
The upload/import result does not establish that the file is valid for a
particular generation route; that route still validates type and metadata.
Pass uploaded sources as objects containing only the canonical URL: