drio
Open app

Sanity MCP Server

Source

Connect your Sanity content to AI agents. Create, update, and explore structured content using Claude, Cursor, and VS Code via the Model Context Protocol. Transform content operations from complex queries to simple conversations—giving your team superpowers without sacrificing structure.

Catalog onlyCatalog onlySTDIO

Overview

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.

To use the Sanity MCP Server:

  1. Prerequisites: - Deploy your Sanity Studio with schema manifest - Get your API credentials (Project ID, Dataset name, API token)
  2. Add configuration to your application's MCP settings: json { "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" } } } }
  3. 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
  • 🤖 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
  1. AI-powered content creation and management: Create, update, and manage documents using natural language instructions
  2. Intelligent content exploration: Query your content using GROQ, or search semantically based on meaning
  3. Release management: Plan and coordinate content releases through conversational interfaces
  4. Schema exploration: Help AI understand your content structure to work more effectively
  5. Content operations automation: Streamline repetitive tasks through natural language commands

Add to your AI client

Use these steps to connect Sanity MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "sanity-mcp-server-sanity-io": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "sanity-mcp-server-sanity-io": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "sanity-mcp-server-sanity-io": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "sanity-mcp-server-sanity-io": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "sanity-mcp-server-sanity-io": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "sanity-mcp-server-sanity-io": {
      "command": "npx",
      "args": [
        "-y",
        "@sanity/mcp-server@latest"
      ],
      "env": {
        "SANITY_API_TOKEN": "your-sanity-api-token",
        "SANITY_DATASET": "production",
        "SANITY_PROJECT_ID": "your-project-id"
      }
    }
  }
}