Sanity MCP server
Enable AI assistants to interact with your Sanity workspace through the Model Context Protocol (MCP).
The Sanity Model Context Protocol (MCP) server provides AI assistants like Claude Code and Cursor with direct, authenticated access to your Sanity projects. Instead of manually writing API calls or copying documentation, AI assistants can discover and use Sanity tools automatically through a standardized protocol.
Experimental feature
This article describes an experimental Sanity feature. The APIs described are subject to change and the documentation may not be completely accurate.
Prerequisites:
- An MCP-compatible client, such as Claude Code or Cursor.
Remote server (preferred)
The remote MCP server is hosted on Sanity's infrastructure and is the easiest way to get started.
The server follows Anthropic's official MCP specification and should work with any MCP clients. Follow the documentation for your client for how to add MCP servers. Typically, you add a section like the following to the relevant configuration file:
{
"mcpServers": {
"Sanity Developer": {
"url": "https://mcp.sanity.io/developer",
"type": "http"
}
}
}
Claude Code
Use Claude's HTTP transport method to add Sanity.
claude mcp add sanity -t http https://mcp.sanity.io/developer
Cursor

Use the following link to directly install the MCP server in Cursor. Once installed, you'll be prompted to authorize access. You can confirm tool availability using the command palette and choosing "Open MCP settings".
Alternatively, you can update your mcp.json
configuration with the following:
{
"mcpServers": {
"Sanity Developer": {
"url": "https://mcp.sanity.io/developer",
"type": "http"
}
}
}
Other clients
If your client does not support remote MCP servers, you may be able to use a proxy such as mcp-remote.
{
"mcpServers": {
"Sanity Developer": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.sanity.io/developer",
"--transport",
"http-first"
]
}
}
}
Run commands (or tools)
Once configured and started, authenticate with your Sanity credentials when prompted. You can then use natural language to work with Sanity development tasks, such as:
- Help me migrate this project to Sanity.
- Run a GROQ query for all articles written by Mark.
- Add localization to my article document type.
- Help me migrate existing content to a new schema shape.
- List all releases in this dataset.
The /developer
endpoint at mcp.sanity.io/developer
provides development-focused tools for schema exploration, GROQ query execution, project management such as creating and managing resources like datasets and api keys, and providing migration assistance. These tools allow your AI assistant to interact with your Sanity data directly.
Local server (alternative method)
If you'd prefer to run the MCP server locally rather than connect to the remote server, you can install it locally following the instructions in the Sanity MCP Server GitHub readme.
Troubleshooting
Authentication issues: Ensure you have valid Sanity credentials and necessary permissions. Sessions expire after 7 days. Your client should prompt to re-authenticate when needed. If it doesn't, check the MCP list in your client.
For vscode you can solve some authentication issues by running
Authentication: Remove Dynamic Authentication Providers
from the command palette, resetting the relevant authentication provider, and starting the server again.
Tool availability: Verify project permissions and dataset access for the operation you're attempting. The set of tools available will vary over time as we add new or update existing tools.
Support
Join us in the Sanity community to ask questions and discuss our MCP server with other developers.
Was this page helpful?