Collection of resources to help AI agents build better with Sanity. Supports Cursor, Claude Code, Codex, VS Code, Lovable, v0, Replit, OpenCode, and any other editor/agent compatible with MCP or Agent Skills.
Features
MCP server: Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules.
Collection of resources to help AI agents build better with Sanity.
2026-10-26
星數
194
工具
—
可用率
—
Agent skills: Comprehensive best practices skills for Sanity development, content modeling, SEO/AEO, and experimentation. Includes 25 integration/topic guides and 26 focused best-practice rules.
Agent Plugin:plugin.json, skills/, and mcp.json components for any Agent Plugins-compatible client.
Cursor plugin: MCP server, agent skills, and commands on the Cursor Marketplace.
Codex plugin: MCP server and agent skills for OpenAI Codex users.
Get started
Choose your path based on how you want agents to work with Sanity:
MCP server — Give your agent always up-to-date rules and full access to your Sanity projects. No local files to maintain. Works with Cursor, VS Code, Claude Code, Lovable, v0, Replit, OpenCode, and other MCP-compatible clients.
Agent skills — Install best practices skills for Sanity, content modeling, SEO/AEO, and experimentation. Works with Cursor, Claude Code, and any Agent Skills-compatible agent.
Plugin — Install the Sanity plugin for Cursor, Claude Code, or any Agent Plugins-compatible client. Bundles MCP server, agent skills, and commands.
Manual installation — Copy the skill references locally for offline use. You'll need to update them yourself.
Option 1: Install MCP server (recommended)
Give agents direct access to Sanity projects and always up-to-date agent rules via the MCP server.
Quick install via Sanity CLI
Run in terminal to detect and configure MCP for Cursor, Claude Code and VS Code automatically:
npx sanity@latest mcp configure
Uses your logged-in CLI user for authentication — no manual tokens or OAuth needed.
Client-specific instructions
One-click install:
Or manually: Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → View: Open MCP Settings → + New MCP Server → add to mcp.json:
In the prompt input field, click Prompt Tools → MCPs → Add New → Select Sanity → Authorize → Authenticate with OAuth.
Go to Integrations Page → scroll to MCP Servers for Replit Agent → Add MCP server → Enter Sanity as name and https://mcp.sanity.io as Server URL → Test & Save → Authenticate with OAuth.
Manual MCP configuration uses OAuth by default. You can use token auth instead by setting an Authorization: Bearer <token> header in the MCP config. If authentication fails after CLI setup, rerun npx sanity@latest mcp configure and restart your MCP client. For OAuth reset issues, Cursor provides Cursor: Clear All MCP Tokens and VS Code provides Authentication: Remove Dynamic Authentication Providers.
See the Sanity MCP docs for authorization options and troubleshooting.
Option 2: Install Agent Skills
Install best practices skills that work with any Agent Skills-compatible agent.
The Sanity plugin is listed on the official Anthropic plugin marketplace. The official marketplace (claude-plugins-official) is pre-registered when you start Claude Code — you do not need to add a custom marketplace.
Install from Claude Code:
/plugin install sanity@claude-plugins-official
If the plugin is not found, refresh the marketplace catalog and retry:
MCP-managed schemas are resolved before Studio-deployed and legacy schemas. If you deploy schema changes with deploy_schema, redeploy any matching MCP-managed Studio with deploy_studio so it picks up the latest schema. generate_image, transform_image, and create_version with an instruction consume Sanity AI credits.
Best practices skills that agents like Claude Code, Cursor, GitHub Copilot, etc. can discover and use automatically. Skills follow the Agent Skills format. See Option 2 for installation.
First-class singleton documents via document.singletons, Structure helpers, and migrating from userland or plugin-based singletons
sanity-form-component-suspense
Fix custom Studio form components (inputs, fields, array items) that suspend without their own Suspense boundary, causing layout shift or blocking new documents
Getting started flow
The onboarding guide follows three phases:
Studio & Schema — Set up Sanity Studio and define your content model
Content — Import existing content or generate placeholder content via MCP
Frontend — Integrate with your application (framework-specific)
Just say: "Get started with Sanity" to begin.
Slash commands (Claude Code)
Command
What it does
/sanity
List available skills and help topics
/sanity-review
Review code for Sanity best practices
/typegen
Run TypeGen and troubleshoot issues
/deploy-schema
Deploy schema with verification
Repository structure
Note: The reference files in skills/sanity-best-practices/references/ are the canonical content for the Sanity MCP server's list_sanity_rules / get_sanity_rules tools. Each file must have valid name and description frontmatter — rule names are derived from filenames (e.g., nextjs.md → nextjs).
All skills use references/ for detailed content loaded on demand. The sanity-best-practices references are also the canonical source for the MCP server's Sanity rules.
Found a better pattern? Missing a framework or best practice? Read the contributing guide for how skills work and what makes a good contribution, then:
Fork the repo.
Install dependencies with npm install.
Make your changes in skills/<skill-name>/.
Run npm run validate:all to check skill and plugin validity.