- Sanity MCP Server
Sanity MCP Server
Sanity MCP Server
What is Sanity MCP Server?
Sanity MCP Server implements the Model Context Protocol to connect your Sanity projects with AI tools like Claude, Cursor, and VS Code. It enables AI models to understand your content structure and perform operations through natural language instructions.
How to use Sanity MCP Server?
To use the Sanity MCP Server:
-
Prerequisites:
- Deploy your Sanity Studio with schema manifest
- Get your API credentials (Project ID, Dataset name, API token)
-
Add configuration to your application's MCP settings:
{ "mcpServers": { "sanity": { "command": "npx", "args": ["-y", "@sanity/mcp-server@latest"], "env": { "SANITY_PROJECT_ID": "your-project-id", "SANITY_DATASET": "production", "SANITY_API_TOKEN": "your-sanity-api-token" } } } } -
The server can be used with any application that supports the Model Context Protocol, including:
- Claude Desktop
- Cursor IDE
- Visual Studio Code
- Custom MCP-compatible applications
Key features of Sanity MCP Server
- 🤖 Content Intelligence: Let AI explore and understand your content library
- 🔄 Content Operations: Automate tasks through natural language instructions
- 📊 Schema-Aware: AI respects your content structure and validation rules
- 🚀 Release Management: Plan and organize content releases effortlessly
- 🔍 Semantic Search: Find content based on meaning, not just keywords
Use cases of Sanity MCP Server
- AI-powered content creation and management: Create, update, and manage documents using natural language instructions
- Intelligent content exploration: Query your content using GROQ, or search semantically based on meaning
- Release management: Plan and coordinate content releases through conversational interfaces
- Schema exploration: Help AI understand your content structure to work more effectively
- Content operations automation: Streamline repetitive tasks through natural language commands
FAQ from Sanity MCP Server
What is the Model Context Protocol (MCP)?
The Model Context Protocol is a standard that allows AI assistants to connect with external tools and data sources. It enables AI models to understand your content structure and perform operations through natural language instructions.
How do I install the Sanity MCP Server?
You don't need to install it separately. Simply add the configuration to your MCP-compatible application (like Claude Desktop, Cursor, or VS Code), and it will be automatically downloaded and run using npx when needed.
What permissions does the Sanity MCP Server need?
The permission level depends on what you want to do:
- For basic read operations:
viewerrole is sufficient - For content management:
editorordeveloperrole recommended - For advanced operations (like managing datasets):
administratorrole may be needed
Is there special setup required for Node Version Manager users?
Yes, if you use tools like nvm, mise, or fnm, you'll need to create symlinks to ensure MCP servers can access Node.js. This is a one-time setup that involves creating symlinks to your Node.js binaries.
What tools are available in the Sanity MCP Server?
The server provides a wide range of tools, including:
- Document operations (create, update, query, patch)
- Release management
- Version management
- Dataset management
- Schema information retrieval
- GROQ query support
- Semantic search
- Project information
Can I use this with any AI assistant?
You can use it with any AI assistant that supports the Model Context Protocol (MCP), such as Claude, and applications that integrate with MCP-compatible models.
Server Config
{
"mcpServers": {
"sanity": {
"command": "npx",
"args": [
"-y",
"@sanity/mcp-server@latest"
],
"env": {
"SANITY_PROJECT_ID": "your-project-id",
"SANITY_DATASET": "production",
"SANITY_API_TOKEN": "your-sanity-api-token"
}
}
}
}