
Mcp Sanity Images
io.github.pijuszPublished by GitHub account pijuszv0.3.7Updated Nov 3, 2026
MCP server for uploading local images to Sanity CMS
Overview
Local MCP server that lets an assistant upload local image files into Sanity CMS as assets and attach them to documents.
- What you can do
- Upload a single local image to Sanity and get back an asset reference
- Upload an image and patch it onto a document field in one call
- Batch-upload every image in a folder, with failures listed separately
- List image files in a directory without uploading
- Run read-only GROQ queries to find document IDs before attaching images
- When to use it
- Useful when you keep images on disk and want an assistant to push them into a Sanity dataset and wire them into content fields, for example filling in product or article images without opening Sanity Studio.
- Requirements
- Runs locally over stdio via npx, bunx or a prebuilt binary (macOS, Linux, Windows). Needs SANITY_PROJECT_ID; SANITY_DATASET defaults to production. A Sanity API token is read from SANITY_TOKEN or from the Sanity CLI login config. Network access to Sanity is required.
Installation
In SourceWeft
- Open Mcp Sanity Images in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
MCP server for uploading local images to Sanity CMS.
Lets AI assistants upload files from your filesystem directly into Sanity as image assets.
Quick Start
1. Get your Sanity token
Either set the SANITY_TOKEN env var, or just log in with the Sanity CLI:
The server reads the token from the Sanity CLI config automatically (~/.config/sanity/config.json on all platforms).
2. Add to Claude Code
That's it. Restart Claude Code and the tools are available. Every session runs the latest version automatically.
Also works with
bunx mcp-sanity-images@latestif you have Bun.
Alternative: standalone binary
Download a pre-built binary from Releases:
macOS / Linux:
Windows (PowerShell):
Claude Desktop
Add to your claude_desktop_config.json:
Using npx (auto-updates)
Using binary (macOS / Linux)
Using binary (Windows)
Tools
Supported formats: PNG, JPG/JPEG, WebP, GIF, SVG.
Configuration
All tools also accept projectId and dataset as parameters, overriding the env vars per-call.
Tool Details
upload_image
Upload a single file and get back the asset reference.
Returns { assetId, url, alt, reference } — the reference is ready to patch onto any Sanity image field.
upload_and_set
Upload + patch in one call.
Before uploading, the tool checks which of <id> and drafts.<id> exist, so a wrong ID uploads nothing:
The response's documentId is the document actually patched. Mutations are sent with returnIds=true&visibility=sync, so a follow-up groq_query sees the change.
batch_upload
Upload all images from a directory.
Returns { uploaded, assets }. If some files fail, the rest still upload and the failures are listed in failed (with failedCount).
list_images
List image files without uploading — useful for the AI to see what's available.
groq_query
Run any GROQ query (read-only). Long queries are sent via POST automatically. Useful to find document IDs before using upload_and_set.
The server pins Sanity API version v2025-02-19. That version made published the API's default perspective. This tool sends raw unless you ask otherwise, so results match what earlier releases (API v2021-10-21, default raw) returned.
Updates
Using npx @latest (recommended): You always get the latest version — no manual updates needed.
Using a binary: The server checks for new releases on startup and logs to stderr if outdated:
Check your installed version:
To update, download the new binary and replace the old one.
Development
Requires Bun.
License
MIT
Source: README.md at commit 835c357
Tools
0Version history
1- v0.3.7LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts