You’ll need a CMS eventually. Let your agent set it up.

With the Sanity MCP server, your AI agent can now create schemas, content, and editorial interfaces from prompts.

  • Jon Eide Johnsen

    Jon Eide Johnsen

    Head of Growth & Data

  • Knut Melvær

    Knut Melvær

    Head of Developer Community and Education

Published

You vibe-coded a site with Cursor. Or shipped a prototype with Loveable. Content lives in markdown files, maybe some JSON. It works.

Then someone else needs to update it. A client, a marketing teammate, a founder who doesn't want to learn Git (not even via AI). Suddenly "just edit the markdown" isn't a content strategy.

The Sanity MCP Server lets your agent set up a real content backend in the same workflow you used to build everything else. Schemas, content, editorial interface: all from prompts. Your AI handles the setup while you stay focused on the product. And yeah, no API tokens or local npm installs required. Just log in with your user account and that’s it.

Run this command in Cursor, Claude Code, or VS Code to automatically set it up:

npx sanity@latest mcp configure

Using other MCP clients like Claude Desktop, v0, or Lovable? Add Sanity as a custom MCP by entering https://mcp.sanity.io as server URL.

Go to the full MCP documentation to learn more →

From prompt to production

You're building something with AI. A side project, a client prototype, an internal tool. It's always better to build experiences with realistic content.

Let's say we're building a new web experience for a vintage car company. You tell your agent something like this:

Create a product catalog for vintage cars with fields for make, model, year, price, condition, and a rich text description. Make the schema. Add five sample cars.
Then create a stylish front-end for the content that is dark and matches Porsche's sophisticated german design language. Make it minimalistic, with high focus on great typography, color palette and spacing. Something that Dieter Rams could design if he was into web.
Show me both the frontend and the studio locally when you are done.

In the video below, the prompt is ran in Cursor and Opus 4.5 with the Sanity MCP server installed. It's speed up for the parts where we're watching the agent do its thing. The whole thing took about 13 minutes from start to end.

At the end, you have:

  • A deployed Sanity schema with proper field types and validation
  • Sample content in your Content Lake
  • A working studio and frontend showing your cars

The AI handles content modeling, sample content, and schema deployment, as well as best-practices for building out the editorial experience in the studio.

Since Sanity's AI comes with image generation and transformation out of the box, you can also ask the MCP server to add car photos and update them with human drives.

A webpage featuring three vintage cars: a white Porsche, an Alfa Romeo, and a green Jaguar, each with descriptions.
The vintage cars aren't self-driving anymore.

For projects already in production

The MCP server isn't just for spinning up prototypes. For teams running Sanity in production, it handles the tedious-but-necessary tasks that usually require scripts, docs dives, or context-switching.

Content audits in seconds

"Which product pages are missing SEO descriptions?" or "Find all documents that reference deleted authors." The AI queries against your actual schema and returns actionable results, not generic suggestions.

Query generation from intent

Need a GROQ query that fetches the 10 most recent published articles with author info and only the first 3 categories? Describe what you want, get correct syntax back. No more tab-switching to the GROQ cheat sheet.

Schema operations through conversation

"Add an SEO metadata object to all page types with fields for title, description, and social image." The AI checks your existing schema, generates compatible additions, and can deploy them.

Content-aware coding

When you're building features, your AI can query your actual content to understand the data shapes you're working with. It generates code that matches your schema, tests against real documents, and catches mismatches before you do.

Low-stakes content migration

Quickly change the structure of documents, move values around. If you have Content Releases, stage those changes into a release so you can test and verify before making them live.

Release coordination

"What's in the Black Friday release and are any required fields missing?" The AI inspects release contents, validates against your schema, and flags problems before they ship. Stage content updates, schedule publication, manage coordinated releases across multiple documents.

Onboarding to unfamiliar projects

"Explain the content model for this project—what are the main document types and how do they connect?" New team member? Context-switching between client projects? Get the mental model in 30 seconds instead of spelunking through schema files.

Debug content issues

"Why doesn't product X show up on the frontend?" Paste a document ID, and the AI fetches the doc, checks publish state, validates required fields, and tells you what's wrong.

Most models already know Sanity well. With the MCP server, they can act on that knowledge directly.

What makes the Sanity MCP server different

The MCP Server is a secure gateway between your agent and your Sanity projects, with 40+ tools for document operations, schema management, content releases, and AI-powered media generation.

But the tools are only part of the story. What matters is how well the AI can actually use them.

Schema-first AI guidance

The server includes over 200 lines of instructions that teach agents how Sanity works. Check the schema before querying. Understand references vs. arrays. Handle multi-step operations correctly. Your AI doesn't guess at field names or return broken queries because it's been taught to verify first.

Always-fresh rules

Static .cursorrules files go stale. You paste them once, best practices evolve, and six months later your AI is confidently recommending deprecated patterns. The MCP Server fetches official agent rules on demand from our Agent Toolkit repo. Best practices update, your AI gets them immediately. No maintenance on your end.

Zero-friction auth

Connect with your existing Sanity login. No tokens required to get started. Your edits show up as you in revision history, not some generic API user. Need more control? You can also use scoped API tokens for specific permissions or automated workflows.

Token-aware responses

Large queries can overwhelm AI context windows. The MCP Server tracks token counts and paginates intelligently, returning maximum useful data within budget. You get "12 of 847 documents (48,392 tokens)" instead of a failed request or truncated response.

Managed infrastructure

Rate limiting, metrics, error tracking included. No self-hosting, no DIY operations. The server handles production concerns so you can focus on building.

The full toolkit

The MCP Server exposes 40+ operations:

CategoryWhat you can do
DocumentsCreate, query, patch, publish, unpublish, delete
SchemasRetrieve full schemas, deploy schema changes (experimental)
ReleasesCreate, schedule, publish coordinated content packages
MediaGenerate images from prompts, transform existing images with AI
SearchSemantic search on embeddings indices, search Sanity docs
ProjectsCreate new projects, manage datasets
MigrationGuided migration paths from Contentful, WordPress, Strapi, Drupal

Get started with the Sanity MCP

We support automatic configuration for Claude Code, Cursor, and VS Code:

  • New projects: When creating new projects with npm create sanity@latest, you'll get the option to configure MCP automatically.
  • Existing projects: Run npx sanity@latest mcp configure to set up MCP for your editor.
  • Manual setup: Visit mcp.sanity.io for step-by-step instructions for all MCP-compatible clients.

Full documentation and tool reference →

The Sanity MCP Server is available now for all Sanity projects.