MCP Sanity Images logo

MCP Sanity Images

Upload local images to Sanity, attach them to documents, inspect folders, and query content through MCP tools.

Install MCP Sanity Images

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-sanity-images": {
      "command": "npx",
      "args": [
        "-y",
        "sanity"
      ],
      "env": {
        "SANITY_PROJECT_ID": "YOUR_VALUE_HERE",
        "SANITY_DATASET": "YOUR_VALUE_HERE",
        "SANITY_TOKEN": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 5 tools correctly ().

Overview

mcp-sanity-images connects an MCP-compatible AI client to a local filesystem and Sanity CMS for image asset workflows. It can inspect image folders, upload individual or batches of supported files, attach an uploaded asset to a document field, and run read-only GROQ queries. Use it when an agent needs to move local images into Sanity and identify documents before updating them. The server runs over stdio through npx, Bun, or a downloaded standalone binary.

Use cases

  • Upload local product images to Sanity
  • Attach an image asset to a document field
  • Batch import a directory of images
  • Find Sanity document IDs with GROQ
  • Inspect image files before uploading

Key features

  • Single-image asset uploads
  • Batch directory uploads with failure reporting
  • Document field patching with draft handling
  • Recursive local image listing
  • Read-only GROQ queries with selectable perspectives
  • Per-call project and dataset overrides

Tools5

What MCP Sanity Images lets your agent do. Expand a tool for its parameters.

Verified live~1.1k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

14/14 checks healthy over the last 73d

What it can do

From the 5 tools this server returned when we ran it; 5 declare their own safety hints.

Can delete or modify data · 3Makes network requests · 5Read-only tools · 2
Network at startup4 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age242 days
Maintainers1

Observed 2026-10-31 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · sanity (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
Last commit1mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed5Callable tools this server registers over MCP.

How MCP Sanity Images works

What mcp-sanity-images does

mcp-sanity-images gives MCP clients tools for moving local image files into Sanity CMS. It supports PNG, JPG/JPEG, WebP, GIF, and SVG files. A single upload returns the Sanity asset identifier, URL, alt text, and an image reference that can be used with a Sanity image field.

The server also combines uploading and document mutation in one operation. Given a local file, document ID, and field path, upload_and_set uploads the asset and patches the selected field. It can work with published documents and drafts, including draft-only documents. For larger sets of files, batch_upload processes every image in a directory and reports successful and failed files separately.

How it works

The server communicates with an MCP client over stdio. It uses Sanity project credentials and dataset settings to call the Sanity API, while reading image files from paths available to the local process.

list_images provides a directory inventory without uploading anything. This can help an agent choose files before calling an upload tool. groq_query executes read-only GROQ queries, which is useful for finding document IDs before attaching assets. Queries use the raw perspective by default, showing published documents and drafts side by side with their relevant IDs. The published perspective excludes drafts, while drafts presents drafts as their published versions and exposes the stored draft ID through _originalId.

When upload_and_set receives a document ID, it checks published and draft variants before uploading. If neither exists, it avoids uploading and returns a document-not-found result. Mutations use synchronous visibility, allowing a subsequent GROQ query to see the change.

Setup and configuration

The required environment variable is SANITY_PROJECT_ID. Set SANITY_DATASET to choose a dataset; it defaults to production. Authentication can use SANITY_TOKEN, or the server can read credentials from the Sanity CLI configuration after npx sanity login.

Install through the npm package with npx -y mcp-sanity-images@latest, or use bunx mcp-sanity-images@latest. The repository also publishes standalone binaries for macOS Apple Silicon, macOS Intel, Linux x64, and Windows x64. Configure the command and environment in an MCP client such as Claude Code or Claude Desktop, then restart the client if required by its configuration flow.

Every tool accepts projectId and dataset parameters, which override the corresponding environment values for that call. Development requires Bun and includes commands for installation, tests, linting, and standalone builds.

Tools and capabilities

  • upload_image: Upload one local image and return its Sanity asset data and patch-ready reference.
  • upload_and_set: Upload an image and assign it to a document field, handling published and draft IDs.
  • batch_upload: Upload all supported images in a directory, optionally including nested directories, while collecting failures.
  • list_images: Enumerate supported image files in a directory without changing Sanity.
  • groq_query: Run a read-only GROQ query with an optional raw, published, or drafts perspective.

Limitations and notes

The server handles image files in the supported PNG, JPG/JPEG, WebP, GIF, and SVG formats. groq_query is read-only; document changes are performed through upload_and_set. Passing a published document ID when both a published version and a draft exist patches the published document and leaves the draft unchanged. The server pins Sanity API version v2025-02-19 and explicitly uses raw as the default query perspective.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Sanity Images

mcp-sanity-images is an MCP server that connects AI clients to a local filesystem and Sanity CMS. Its main tools list image files, upload single images or directories as Sanity assets, attach uploads to document fields, and run read-only GROQ queries to find documents before updating them.

Install it with `npx -y mcp-sanity-images@latest` or `bunx mcp-sanity-images@latest`, then configure that command in your MCP client with `SANITY_PROJECT_ID`. Standalone binaries are also available for macOS, Linux, and Windows.

Set `SANITY_PROJECT_ID` to the Sanity project ID. `SANITY_DATASET` is optional and defaults to `production`. `SANITY_TOKEN` is optional when Sanity CLI authentication is available, because the server can read the CLI configuration.

Call `upload_and_set` with the local `filePath`, `documentId`, and `fieldPath`. The tool checks published and draft document variants before uploading, then patches the document that matches the requested ID.

Yes.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Sanity Images AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-sanity-images?style=directory)](https://allmcps.com/mcp/mcp-sanity-images)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-sanity-images"><img src="https://allmcps.com/api/badge/mcp-sanity-images?style=directory" alt="MCP Sanity Images on AllMCPs" /></a>