Skip to content

Summary

Sanity's official hosted MCP server: run GROQ queries, patch and publish documents, manage releases and deploy schemas — with the agent aware of your content model.

Features

  • Schema-aware GROQ queries against any dataset
  • Patch, draft and publish documents with field validation
  • Fetch and deploy content schemas
  • Manage content releases and datasets
  • AI image generation and transformation
  • Embeddings-based semantic search over content
  • Sanity documentation lookup in context
  • Hosted HTTP endpoint with OAuth or token auth

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it.
  3. Restart the agent — the "Sanity MCP" tools will be available.
{
  "mcpServers": {
    "sanity-mcp": {
      "command": "claude",
      "args": [
        "mcp",
        "add",
        "Sanity",
        "-t",
        "http",
        "https://mcp.sanity.io",
        "--scope",
        "user"
      ]
    }
  }
}

Description

A headless CMS is a hard target for an agent because the useful operations all depend on a schema the agent cannot see. Sanity's official MCP server solves that first: it exposes the project's schema, so a model writing a GROQ query or a document patch is working against the real content model rather than pattern-matching from examples.

What it can do:

  • Query and read — execute GROQ against any dataset in the project.
  • Write — patch documents, create drafts and publish, with schema-aware field validation.
  • Schema — fetch the deployed schema and deploy an updated one.
  • Releases and datasets — manage content releases and switch between datasets, which is how staged publishing works in Sanity.
  • Projects — list and inspect the projects the authenticated account can reach.
  • AI features — generate and transform images, and run embeddings-based semantic search over content.
  • Documentation lookup — pull Sanity documentation into context so the agent stops guessing at GROQ syntax.

That combination makes some genuinely tedious work tractable: bulk content migrations expressed as a described transformation, an editorial audit across a whole dataset, or scaffolding a content model from a brief and deploying it.

Connection: hosted at https://mcp.sanity.io over HTTP — no local process. In Claude Code: claude mcp add Sanity -t http https://mcp.sanity.io --scope user. Cursor and VS Code take the same {"type": "http", "url": "https://mcp.sanity.io"} entry in mcp.json. The quickest route of all is npx sanity@latest mcp configure, which writes the config for whichever client it detects.

Authentication: OAuth by default. For headless use, create a token at sanity.io/manage or through the CLI's token commands and pass it in an Authorization header.

A caution worth stating: this server can write to and publish content. Point it at a development dataset before you point it at production, and use a token scoped to what you actually want the agent to be able to change.

Related MCP Servers

New

Arm's official MCP server for porting and tuning software on Arm — semantic docs search, codebase migration scanning, container architecture checks and LLVM-MCA assembly analysis.

New

Official AntV MCP server that turns a description of your data into a rendered chart — 26 visualization types from bar and line to sankey, mind-map, fishbone and geographic maps.

MCP: Headroom

by Headroom Labs

New

Context-compression MCP server that shrinks tool outputs, logs, files and RAG chunks before they reach the model, cutting 60-95% of tokens on JSON payloads.

MCP: Engram

by Gentleman Programming

New

Persistent memory for coding agents as a single Go binary — SQLite and FTS5 behind MCP, an HTTP API, a CLI and a TUI, with no Node, Python or Docker required.

Browse all MCP servers →