Contact Us
Webflow Premium Partner Ehab Fayez
Back to Agent Skills
Content & Documentation

Sanity Headless CMS

Interact with Sanity CMS content, schemas, and GROQ queries from your AI coding agent.

Claude Code Cursor Copilot

Overview

Sanity is a structured content platform with real-time collaboration and a powerful query language (GROQ). The MCP server integration allows AI agents to create, read, update, and delete content directly from the development environment.

Agents can define and modify content schemas, write GROQ queries to fetch content, manage media assets, and configure content workflows. This enables a seamless development experience where content modeling and application code evolve together.

The integration supports Sanity's unique features like portable text, image transformations, and content versioning. Teams can use AI agents to scaffold content types, generate sample content for testing, and maintain schema migrations.

Who Is This For?

  • Create and modify Sanity content schemas
  • Write GROQ queries to fetch and filter content
  • Generate sample content for development testing
  • Manage media assets and image transformations

Installation

Setup for Claude Code
npx @anthropic-ai/claude-code mcp add sanity -- npx -y @sanity/mcp-server

Configuration

// .mcp.json
{
  "mcpServers": {
    "sanity": {
      "command": "npx",
      "args": ["-y", "@sanity/mcp-server"],
      "env": {
        "SANITY_PROJECT_ID": "<your-project-id>",
        "SANITY_DATASET": "production",
        "SANITY_API_TOKEN": "<your-token>"
      }
    }
  }
}