media-upload
Upload a file into the Sitecore media library from a URL, local path, or base64 content; returns the created media item's ID, path, size, and MIME type.
Instructions
Uploads a file into the Sitecore media library via the SPE mediaUpload service and returns the created media item (ID, path, size, mime type). Overwrites an existing item at the destination unless skipExisting is set. Source is exactly one of sourceUrl (fetched by this server — use this to import from a live site), filePath (local to the machine running this MCP server), or content (base64). Requires in the CM's SPE services config.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Alt text to set on the media item after upload. | |
| content | No | The file bytes as base64. Suits small files only — prefer sourceUrl or filePath for anything sizable. Supply this, sourceUrl or filePath. | |
| database | No | The database holding the media library. Defaults to master. | master |
| filePath | No | Path to a file on the machine running this MCP server. Refused over the HTTP transport unless MEDIA_LOCAL_FILE_ROOT names a directory to confine it to. Supply this, sourceUrl or content. | |
| sourceUrl | No | http(s) URL to fetch the bytes from (e.g. an image on the site being migrated). Supply this, filePath or content. | |
| skipUnpack | No | When true, store an uploaded .zip as a single media item instead of unpacking it. | |
| destination | Yes | Media library path for the item, including the file name with extension (e.g. 'Project/Stride/Corporate/Migrated/team-photo.jpg' — the '/sitecore/media library/' prefix is optional), or the GUID of an existing media item to overwrite. The item is named after the file name up to its FIRST dot, with characters Sitecore will not accept in a name removed, so 'v1.2 asset.jpg' becomes an item called 'v1' — avoid dots in the name itself. The response reports the name the item actually got. | |
| skipExisting | No | When true, leave an existing item at the destination untouched instead of overwriting it. |