# Sanity — MCP Server

> Query and edit structured content with GROQ, on a CMS built to be read by machines.

**Source:** https://mcpplaygroundonline.com/mcp-servers/sanity  
**Transport:** http  
**Requires auth:** Yes

---

## What it does

The server is organised around GROQ, Sanity’s query language for filtering and projecting document trees. An agent can run a query to find documents matching arbitrary criteria and shape exactly which fields come back, which keeps responses small enough to reason over — a real advantage when a content set runs to thousands of documents. Schema information is readable, so the model can discover document types and their fields rather than guessing at names. Mutations are available for creating and updating documents, which is what turns this from a reporting tool into an editorial one: bulk metadata fixes, systematic retagging, or drafting a new document that conforms to an existing type. Sanity’s draft and published separation is preserved, so an agent can work on drafts without touching what readers see.

## Tools exposed

- GROQ query — filter and project across documents with full query control
- schema — list document types and the fields each one defines
- document read — fetch a single document by id, draft or published
- mutations — create, patch and delete documents
- datasets — list the datasets available in the project

## Example queries you can run

- "Which blog posts are missing a meta description or an author reference?"
- "List every product document whose category field no longer resolves to a real category."
- "Draft a new landing page document following the same shape as the pricing page."
- "Find posts published last quarter that were never assigned a tag, and tag them."

## Details

- **Recommended model:** anthropic/claude-sonnet-4.5 — GROQ projections and reference following are unlike SQL. Sonnet 4.5 writes correct traversals; weaker models fall back to SQL habits and return empty result sets.
- **Transport:** http
- **Authentication:** Required — A Sanity API token scoped to a project and dataset. Use a read token for exploration and a write token only when you intend edits.
- **Hosted endpoint:** https://mcp.sanity.io
- **Official source:** [Sanity documentation](https://www.sanity.io/docs)

## Frequently asked questions

### What is the Sanity MCP server?

Sanity’s hosted MCP server. It exposes GROQ queries, schema introspection, document reads and content mutations as MCP tools, letting an AI assistant query and edit structured content directly.

### What is GROQ?

Sanity’s query language for JSON documents. It filters and projects in one expression and follows references inline, which is why responses stay small — you ask for exactly the fields you want rather than whole documents.

### Will an agent overwrite published content?

Only if you give it a write token and it targets published documents. Sanity separates drafts from published versions, so the safe pattern is drafts-only edits with a human publishing step — and a read-only token whenever you are just exploring.

### Is this useful for content audits?

It is one of the strongest fits. Questions like "which documents violate this editorial rule" are a single GROQ query that nobody wants to write by hand, and the model can then fix what it finds in the same session.

### How does it compare with the Notion MCP server?

Notion is a workspace with loose, page-shaped content. Sanity is a typed content backend with a real schema. For questions that depend on structure — every document of this type missing this field — Sanity gives a model far more to work with.

---

_Test this server across 40+ models on MCP Playground: https://mcpplaygroundonline.com/mcp-servers/sanity — free, no install._
