home / mcp / sanity mcp server

Sanity MCP Server

Provides up-to-date Sanity MCP access to data sources and actions for agent-driven workflows.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "sanity-io-agent-toolkit": {
      "url": "https://mcp.sanity.io",
      "headers": {
        "YOUR_ENV": "VALUE"
      }
    }
  }
}

The Sanity MCP Server provides a centralized, up-to-date gateway for your Sanity projects that enables agents to access content, datasets, releases, schemas, and a rich set of agent rules through MCP-compatible clients. It streamlines automation, enables direct queries and edits, and lets you scale agent interactions across editors and tools without manual file maintenance.

How to use

Connect your MCP client to the Sanity MCP Server to enable agents to work with your Sanity projects. You can use the remote HTTP MCP endpoint to load agent rules, run queries, create documents, patch content, and run image transformations through agent skills. If your client supports MCP native configuration, point it to the provided server URL and let the agent toolkits supply the rules and capabilities you need.

How to install

Prerequisites: install Node.js (recommended LTS) and npm or npx. Ensure you are signed in to your Sanity CLI if you plan to use the quick install flow.

Option 1 — Install the MCP server (recommended) using the quick setup.

Run in your terminal to configure MCP for Cursor, Claude Code, and VS Code automatically:

npx sanity@latest mcp configure

Additional setup options

Option 2 — Install Agent Skills to enable best practices for Sanity development and experimentation.

npx skills add sanity-io/agent-toolkit

Claude Code plugin

Option 3 — Install the Claude Code plugin to access MCP-enabled skills and slash commands.

/plugin marketplace add sanity-io/agent-toolkit
```
```
/plugin install sanity-plugin@sanity-agent-toolkit

Manual installation

Option 4 — Copy rules locally for offline use. Create a rules directory and populate it with the context rules so editors can learn Sanity best practices.

Available tools

sanity-best-practices

GROQ performance, schema design, Visual Editing, images, Portable Text, Studio, TypeGen, localization, and migrations

content-modeling-best-practices

Structured content principles: separation of concerns, references vs embedding, content reuse

seo-aeo-best-practices

SEO/AEO with EEAT principles, structured data (JSON-LD), technical SEO patterns

content-experimentation-best-practices

A/B testing methodology, statistical foundations, experiment design

Sanity MCP Server - sanity-io/agent-toolkit