Sanity logo

Sanity

Manage Sanity content, schemas, releases, and hosted Studios through MCP tools and authenticated agent workflows.

Install Sanity

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": {
    "sanity": {
      "command": "npx",
      "args": [
        "-y",
        "sanity@latest"
      ]
    }
  }
}

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

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

Sanity MCP server connects AI agents to Sanity projects through a hosted MCP endpoint. It supports GROQ queries, document creation and patching, release versions, schema-bound Studio deployment, project Studio discovery, and identity checks. OAuth handles authentication by default, with bearer-token configuration also available. Reach for Sanity when an agent needs to inspect or modify Sanity content and project resources from an MCP-compatible client.

Use cases

  • Query Sanity content with GROQ
  • Create draft documents from structured data
  • Patch existing Sanity documents
  • Prepare document versions for releases
  • Deploy a hosted Studio from a managed schema

Key features

  • Direct Sanity project and dataset access
  • GROQ document queries
  • Draft creation and surgical document patches
  • Release version management
  • Hosted Studio deployment
  • OAuth and bearer-token authentication

Tools8

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

Self-reported~148 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 1d ago

Recent health check succeeded.

8/8 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · sanity@latest (npm)

Adoption & maintenance

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

GitHub stars192Stargazers on the source repository.
npm downloads4.3MPackage downloads in the last 30 days.
Last commit1d agoMost recent push to the default branch.
Tools exposed8Callable tools this server registers over MCP.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How Sanity works

What Sanity MCP server does

Sanity MCP server gives AI agents direct access to Sanity projects, including content, datasets, releases, schemas, and linked Studio applications. Its tools cover both read and write workflows: agents can execute GROQ queries, create structured documents, apply targeted edits, prepare release versions, deploy a hosted Studio, and confirm the currently authenticated Sanity user.

The toolkit also provides agent rules and guidance for Sanity development, content modeling, SEO/AEO, and experimentation. Those resources are separate from the MCP operations but are bundled into the broader agent toolkit for supported plugin and skills workflows.

How it works

The hosted MCP endpoint is available at https://mcp.sanity.io. MCP-compatible clients connect to that URL and authorize access to a Sanity account. OAuth is the default authentication method for manual MCP configuration. A client that needs token-based access can send an Authorization: Bearer <token> header instead.

Agents call individual MCP tools rather than interacting with Sanity through a local project file. GROQ queries run against the connected Sanity data, while write operations create documents, drafts, patches, or release versions according to the request. Published documents are handled through drafts when they are edited.

Clients without native support for remote MCP servers can connect through mcp-remote using the HTTP-only transport. The toolkit also offers client plugins and agent-skill installations for supported environments.

Setup and configuration

The Sanity CLI can configure MCP automatically for Cursor, Claude Code, and VS Code:

Terminal
npx sanity@latest mcp configure

This uses the logged-in CLI user for authentication. Remote clients can instead be configured manually with https://mcp.sanity.io as the server URL. Claude Code and Codex provide command-line registration, while Cursor and VS Code accept JSON MCP configurations. Lovable, v0, Replit, and OpenCode provide their own connection flows and authenticate with OAuth.

If authentication stops working after setup, rerun the CLI configuration and restart the MCP client. Cursor and VS Code also expose controls for clearing or removing stored MCP authentication providers.

Tools and capabilities

  • query_documents runs GROQ queries directly against Sanity content.
  • create_documents creates draft documents from structured content, or creates release versions when given a release ID.
  • patch_documents applies focused changes to existing documents. Changes to published documents are made through draft creation or updates.
  • deploy_studio deploys a hosted Studio associated with an MCP-managed schema.
  • create_version creates version documents for releases.
  • whoami checks the authenticated Sanity user.
  • get_project_studios lists Studio applications associated with a project.
  • give_feedback reports tool errors, unclear output, missing capabilities, or documentation problems.

Limitations and notes

The available operations depend on the authenticated Sanity account and the projects it can access. Write actions may create drafts or release versions instead of changing published content directly. A release ID is required when creating versioned documents through create_documents. The server is remote by default, so clients must support remote MCP connections or use a compatible proxy.

Reviews

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

Frequently Asked Questions about Sanity

Sanity is an MCP server that connects AI agents to Sanity projects, datasets, schemas, releases, and Studio applications. Its main tools query documents with GROQ, create and patch documents, create release versions, deploy hosted Studios, inspect project Studios, verify the authenticated user, and report tool feedback.

Run `npx sanity@latest mcp configure` to configure MCP automatically for Cursor, Claude Code, and VS Code. For other MCP clients, add `https://mcp.sanity.io` as the server URL and complete OAuth authorization, or use `mcp-remote` when the client cannot connect to remote MCP servers.

Yes, Sanity works with Cursor through the hosted MCP endpoint or the Sanity Cursor plugin. Add `https://mcp.sanity.io` in Cursor MCP settings, use the one-click installation, or run the Sanity CLI configuration command. Cursor authenticates the connection through OAuth.

Yes, but published documents are edited by creating or updating drafts rather than changing the published document directly. The `patch_documents` tool applies targeted edits, while `create_documents` creates new drafts from structured content.

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 PreviewSanity AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/sanity?style=directory)](https://allmcps.com/mcp/sanity)
HTML Embed
<a href="https://allmcps.com/mcp/sanity"><img src="https://allmcps.com/api/badge/sanity?style=directory" alt="Sanity on AllMCPs" /></a>