The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Sanity listing page.
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.
plugin.json, skills/, and mcp.json components for any Agent Plugins-compatible client.Choose your path based on how you want agents to work with Sanity:
Give agents direct access to Sanity projects and always up-to-date agent rules via the MCP server.
Run in terminal to detect and configure MCP for Cursor, Claude Code and VS Code automatically:
Uses your logged-in CLI user for authentication — no manual tokens or OAuth needed.
Or manually: Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → View: Open MCP Settings → + New MCP Server → add to mcp.json:
Run in terminal. Authenticate with OAuth on next launch:
Run in terminal. Authenticate with OAuth on next launch:
Or manually add to ~/.codex/config.toml:
Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → MCP: Open User Configuration → add:
Sanity is available as a prebuilt chat connector in Lovable:
In your next prompt, reference your Sanity project or ask the agent to read your schema.
See the Lovable MCP documentation or Sanity + Lovable guide for more details.
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.
Add to your opencode.json:
Then run: opencode mcp auth sanity
For any MCP-compatible client, add https://mcp.sanity.io as the server URL.
If your client doesn't support remote MCP servers, use a proxy like mcp-remote:
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.
Install best practices skills that work with any Agent Skills-compatible agent.
See Option 3 for plugin installation.
Install the Sanity plugin to get MCP server, agent skills, and commands. Available on the Claude Code marketplace, Cursor Marketplace, or from this repo as an Agent Plugin.
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:
If the plugin is not found, refresh the marketplace catalog and retry:
Then run /reload-plugins to activate without restarting.
Alternative: interactive install
/plugin and open the Discover tab.claude/settings.json/reload-plugins to activate without restartingVerify installation: Ask Claude Code: "which skills do you have access to?"
You should see the Sanity skills listed.
Start using: Use natural language and skills activate automatically:
Help me create a blog post schema in Sanity
Review my GROQ query and Next.js Visual Editing setup
Or run /sanity to explore all capabilities.
Install from the Cursor Marketplace by running this in Cursor chat:
Verify installation: Ask Cursor: "which skills do you have access to?"
You should see the Sanity skills listed.
Start using: Use natural language and skills activate automatically:
Help me create a blog post schema in Sanity
Review my GROQ query and Next.js Visual Editing setup
Install the plugin from Codex's plugin directory (select the Sanity Agent Toolkit marketplace, then install Sanity).
Restart Codex. Verify by asking: "which skills do you have access to?" — you should see the Sanity skills listed.
Install the skill references locally to teach your editor Sanity best practices:
skills/sanity-best-practices/ to your project.AGENTS.md to your project root to act as a knowledge router.With MCP connected, your AI can use tools like:
query_documents — run GROQ queries directlycreate_documents — create draft documents from structured content, or version documents when a release ID is providedpatch_documents — surgical edits to existing documents; published documents are edited by creating or updating draftspublish_documents / unpublish_documents — manage document lifecycledeploy_schema / get_schema — deploy MCP-managed schemas and inspect deployed schemasdeploy_studio — deploy a hosted Studio bound to an MCP-managed schemacreate_release / list_releases — create and inspect Content Releasescreate_version — create version documents for releasesgenerate_image / transform_image — AI image generation and editingwhoami — verify the authenticated Sanity userget_project_studios — list Studio applications linked to a projectsearch_docs / read_docs — search and read Sanity documentationlist_sanity_rules / get_sanity_rules — load agent rules on demandgive_feedback — report MCP tool errors, missing capabilities, confusing output, or documentation issuesMCP-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.
See the full list of available tools.
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.
| Skill | Description |
|---|---|
| sanity-best-practices | GROQ performance, schema design, Visual Editing, images, Portable Text, Studio, TypeGen, localization, migrations, and framework integration guides |
| content-modeling-best-practices | Structured content principles: separation of concerns, references vs embedding, content reuse |
| seo-aeo-best-practices | SEO/AEO with EEAT principles, structured data (JSON-LD), technical SEO patterns |
| content-experimentation-best-practices | A/B testing methodology, statistical foundations, experiment design |
The onboarding guide follows three phases:
Just say: "Get started with Sanity" to begin.
| 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 |
Note: The reference files in
skills/sanity-best-practices/references/are the canonical content for the Sanity MCP server'slist_sanity_rules/get_sanity_rulestools. Each file must have validnameanddescriptionfrontmatter — 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:
npm install.skills/<skill-name>/.npm run validate:all to check skill and plugin validity.License: MIT