authoring-upload-media
Uploads a file to the Sitecore media library via the Authoring and Management API, fetches a pre-signed URL, posts the bytes, and returns the created media item.
Instructions
Uploads a file into the Sitecore media library over the Authoring and Management API and returns the created media item. Does both halves of the documented flow: asks uploadMedia for a pre-signed URL, then POSTs the bytes to it. 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). Needs no SPE Remoting, unlike media-upload.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Alt text for the media item. | |
| content | No | The file bytes as base64. 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. | |
| fileName | No | The file name to upload as, including its extension. Defaults to the name from filePath or sourceUrl. Sitecore reads the extension to decide the media type, so set this when the source has none. | |
| 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. | |
| itemPath | Yes | Where the item goes, relative to the media library and WITHOUT the '/sitecore/media library/' prefix — e.g. 'Project/MySite/hero'. The last segment is the item's name and must NOT carry a file extension: 'hero', not 'hero.png'. The extension comes from fileName (or the source), and Sitecore reads it to pick the media type — so a '.png' source becomes an Image item with an Alt field, while a '.txt' one becomes a File item that has no Alt. | |
| language | No | The language of the media item. | |
| sourceUrl | No | http(s) URL to fetch the bytes from. Supply this, filePath or content. | |
| versioned | No | When true, create the media item as versioned rather than shared. | |
| overwriteExisting | No | When true, replace the file on an existing item at itemPath instead of failing. | |
| includeExtensionInItemName | No | When true, keep the file extension in the item's name. |