StackMCP

Set up Sanity MCP in Cursor

Manage Sanity CMS content with 40+ tools for document operations, schema management, content releases, GROQ queries, and media generation.

1

Locate the config file

Cursor reads MCP server configuration from the following file:

.cursor/mcp.json

Create this file if it does not already exist.

2

Add the configuration

Add the following to your Cursor config file:

json
{
  "mcpServers": {
    "sanity-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server"
      ],
      "env": {
        "SANITY_PROJECT_ID": "YOUR_SANITY_PROJECT_ID",
        "SANITY_TOKEN": "YOUR_SANITY_TOKEN"
      }
    }
  }
}
3

Set up environment variables

Sanity MCP requires the following environment variables:

SANITY_PROJECT_IDRequired

Sanity project ID

SANITY_TOKENRequired

Sanity API token with write access

4

Verify it works

Restart Cursor. Sanity MCP should appear in your MCP server list with 40 tools available.

This server adds approximately 20,600 tokens to your context window for tool definitions.

Set up Sanity MCP in other editors