Skip to content

Import images by URL or binary upload (no base64)#9

Merged
flocom merged 1 commit into
mainfrom
feat/image-import-url-upload
Jun 7, 2026
Merged

Import images by URL or binary upload (no base64)#9
flocom merged 1 commit into
mainfrom
feat/image-import-url-upload

Conversation

@flocom

@flocom flocom commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Why

Embedding a large input image as base64 in the MCP request is too heavy. This adds two lightweight ways to send images in, mirroring the deliver:'url' output feature.

What

Image fields (screenshot.image, background.image, elements[].image) now also accept:

  • appscreen-file://<id> — a reference returned by the new POST /upload endpoint, which accepts raw image bytes (no base64) and stores them in the TTL filestore. Resolved straight from memory (no HTTP round-trip), auto-deletes after ?ttl (default 3600s).
  • http(s) URL — the server fetches the image.

(data URL, raw base64, and server file path still work.)

curl -X POST "https://host/upload?ttl=600" -H "Content-Type: image/png" --data-binary @shot.png
# → { "ref": "appscreen-file://ab12…", "url": "https://host/files/ab12….png", "bytes": 408200 }
# then pass "image": "appscreen-file://ab12…"

Verified

  • Uploaded a 408 KB Reeflo JPG as raw binary → got a ref → rendered correctly (placed in the mockup).
  • http(s) URL input: server fetched an external PNG and rendered it.

This is the recommended Mac → remote server path for large screenshots, and works through the Cloudflare Tunnel.

🤖 Generated with Claude Code

Symmetric to deliver:'url' for output. Image inputs (screenshot/background/
element) now also accept:
- http(s) URL — the server fetches the image
- appscreen-file://<id> — a reference from the new POST /upload endpoint, which
  takes raw image bytes (no base64) and stores them in the TTL filestore; the
  ref is resolved straight from memory (no round-trip), auto-deletes after ?ttl.

This lets a Mac push a large screenshot to a remote server without embedding a
giant base64 blob in the MCP request. README documents the upload flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@flocom
flocom merged commit deb5685 into main Jun 7, 2026
@flocom
flocom deleted the feat/image-import-url-upload branch June 7, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant