Skip to content

💡 Request - Request: Allow upload_asset to accept local file paths or base64 data URIs #327

@markferritto

Description

Is your feature request related to a problem? Please describe.
The Contentful MCP's upload_asset tool only accepts an HTTP(S) URL in the upload field. It does not accept local file paths or base64 data. This blocks direct uploads from Cursor when replacing images in docsite content (e.g. blockImage entries with Figma exports).

To upload images, users must either:

  1. Temporarily host files on a third-party service (e.g. tmpfiles.org — unreliable at scale), or
  2. Provide their CMA Personal Access Token and run a custom shell script outside the MCP

Both create friction and surface sensitive credentials unnecessarily.

Describe the solution you'd like
Option A — Accept local file paths in upload_asset

When upload starts with / or ./, the MCP could read the file and execute the two-step binary upload flow internally (POST to upload.contentful.com → create asset with uploadFrom), instead of requiring a URL.

{
  "file": {
    "fileName": "image.png",
    "contentType": "image/png",
    "upload": "/absolute/path/to/image.png"
  }
}

Option B — Accept data: base64 URIs

When upload starts with data:, the MCP decodes it and uses the binary upload flow.

Option C — Add a dedicated upload_asset_from_file tool

A separate tool that takes a filePath parameter directly, keeping the existing upload_asset unchanged.

Describe alternatives you've considered

  • Shell script workaround: POST binary to upload API → create asset → process → publish. Works but requires CMA token and runs outside MCP. We've scripted this at scripts/upload-contentful-asset.sh as a reference implementation.
  • Third-party hosting: Unreliable at scale.

Additional context
Reported after replacing 10 blockImage entries with updated Figma exports. A native file-path upload would make this a one-step MCP operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions