streamable-httpMITupdated 14d ago
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.
What can you do with Sanity?
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.
- Agent skills: Comprehensive best practices skills for Sanity development, content modeling, SEO/AEO, and experimentation. Includes 21 integration/topic guides and 26 focused best-practice rules.
- Agent Plugin:
plugin.json,skills/, andmcp.jsoncomponents for any Agent Plugins-compatible client. - Claude Code plugin: MCP server, agent skills, and slash commands for Claude Code users. Available on the official Anthropic plugin marketplace.
- 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
Or manually: Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) ā View: Open MCP Settings ā + New MCP Server ā add to mcp.json:
{
"mcpServers": {
"Sanity": {
"type": "http",
"url": "https://mcp.sanity.io"
}
}
}
Run in terminal. Authenticate with OAuth on next launch:
claude mcp add Sanity -t http https://mcp.sanity.io --scope user
Run in terminal. Authenticate with OAuth on next launch:
codex mcp add Sanity --url https://mcp.sanity.io
Or manually add to ~/.codex/config.toml:
[mcp_servers.Sanity]
url = "https://mcp.sanity.io"
Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) ā MCP: Open User Configuration ā add:
{
"servers": {
"Sanity": {
"type": "http",
"url": "https://mcp.sanity.io"
}
}
}
Sanity is available as a prebuilt chat connector in Lovable:
- Open Connectors ā Chat connectors
- Select Sanity
- Click Connect and sign in to authorize your Sanity account
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:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"sanity": {
"type": "remote",
"url": "https://mcp.sanity.io",
"oauth": {}
}
}
}
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:
{
"mcpServers": {
"Sanity": {
"command": "npx",
"args": ["mcp-remote", "https://mcp.sanity.io", "--transport", "http-only"]
}
}
}
Authorization and troubleshooting
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.
npx skills add sanity-io/agent-toolkit
See Option 3 for plugin installation.
Option 3: Install plugin
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.
Claude Code
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:
/plugin marketplace update claude-plugins-official
Then run /reload-plugins to activate without restarting.
Alternative: interactive install
- Run
/pluginand open the Discover tab - Search for Sanity
- Review what the plugin will install ā commands, skills, hooks, and MCP servers ā before confirming (Anthropic recommends reviewing plugin permissions and source before installing)
- Choose an installation scope:
- User (default): all projects on this machine
- Project: shared with collaborators via
.claude/settings.json - Local: this repository only
- Run
/reload-pluginsto activate without restarting
Verify 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.
Cursor
Install from the Cursor Marketplace by running this in Cursor chat:
/add-plugin sanity
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
Codex
- Add the Sanity marketplace:
codex plugin marketplace add sanity-io/agent-toolkit
-
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.
Option 4: Manual installation
Install the skill references locally to teach your editor Sanity best practices:
- Copy
skills/sanity-best-practices/to your project. - (Recommended) Copy
AGENTS.mdto your project root to act as a knowledge router.
Capabilities
MCP tools
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 issues
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.
See the full list of available tools.
Agent skills
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 |
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'slist_sanity_rules/get_sanity_rulestools. Each file must have validnameanddescriptionfrontmatter ā rule names are derived from filenames (e.g.,nextjs.mdānextjs).
sanity-io/agent-toolkit/
āāā AGENTS.md # Knowledge router & agent behavior
āāā README.md # This file
āāā plugin.json # Portable Agent Plugins v1 manifest
āāā mcp.json # Portable Agent Plugins v1 MCP configuration
āāā .agents/plugins/ # Codex marketplace
ā āāā marketplace.json # Codex marketplace metadata
āāā .claude-plugin/ # Claude Code plugin configuration (distributed via claude-plugins-official)
ā āāā plugin.json # Plugin manifest (name: sanity)
ā āāā marketplace.json # Marketplace manifest for repo-based discovery
āāā .codex-plugin/ # Codex plugin configuration
ā āāā plugin.json # Codex plugin manifest
āāā .cursor-plugin/ # Cursor plugin configuration (distributed via cursor.com/marketplace)
ā āāā marketplace.json # Cursor marketplace metadata
ā āāā plugin.json # Per-plugin manifest
āāā .mcp.json # Legacy client MCP compatibility configuration
āāā assets/ # Plugin branding
ā āāā logo.svg # Sanity logo for marketplace display
āāā commands/ # Agent commands
ā āāā sanity.md # /sanity help
ā āāā sanity-review.md # /sanity-review
ā āāā typegen.md # /typegen
ā āāā deploy-schema.md # /deploy-schema
āāā scripts/ # Validation and CI scripts
ā āāā validate-agent-plugin.mjs # Validate manifests against the v1 JSON Schemas
ā āāā validate-cursor-plugin.mjs # Cursor plugin validator
āāā skills/ # Agent skills (agentskills.io format)
āāā sanity-best-practices/ # Comprehensive Sanity skill
ā āāā SKILL.md # Skill definition and quick reference
ā āāā references/ # Canonical content (22 guides)
ā āāā get-started.md # Onboarding guide
ā āāā nextjs.md # Next.js integration
ā āāā groq.md # GROQ patterns & performance
ā āāā schema.md # Schema design & validation
ā āāā ... # See SKILL.md for full index
āāā content-modeling-best-practices/ # Modeling guidance + topic references
āāā seo-aeo-best-practices/ # SEO/AEO guidance + topic references
āāā content-experimentation-best-practices/ # Experiment design + stats references
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.
Resources
- Create Sanity account
- Sanity documentation
- GROQ language reference
- Visual Editing guide
- Sanity TypeGen
- MCP server docs
- Agent Plugins specification
- Blueprints Infrastructure as Code
Contributing
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:allto check skill and plugin validity. - Submit a PR.
Support
License: MIT
Install
Add Sanity to your client. Pick the one you use.
claude mcp add --transport http sanity https://mcp.sanity.iocodex mcp add sanity --url https://mcp.sanity.io{
"mcpServers": {
"sanity": {
"url": "https://mcp.sanity.io"
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
{
"servers": {
"sanity": {
"type": "http",
"url": "https://mcp.sanity.io"
}
}
}Add to `.vscode/mcp.json` in your workspace.
{
"mcpServers": {
"sanity": {
"url": "https://mcp.sanity.io"
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"sanity": {
"serverUrl": "https://mcp.sanity.io"
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
Score
81 / 100
Excellent
- Documentation25/25
- Maintenance25/25
- Trust16/20
- Capability3/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 6 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 6 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint ā no local install
Version history
| Versions | Published |
|---|---|
| 2.31.0Latest | Aug 29, 2026 |
| 2.30.2 | Aug 26, 2026 |
| 2.30.1 | Aug 24, 2026 |
| 2.30.0 | Aug 18, 2026 |
| 2.29.1 | Aug 12, 2026 |
| 2.29.0 | Aug 12, 2026 |
| 2.28.0 | Aug 10, 2026 |
| 2.27.0 | Aug 4, 2026 |
| 2.26.7 | Jul 31, 2026 |
| 2.26.6 | Jul 23, 2026 |
| 2.26.5 | Jul 23, 2026 |
| 2.26.4 | Jul 21, 2026 |
| 2.26.3 | Jul 15, 2026 |
| 2.26.2 | Jul 8, 2026 |
| 2.26.1 | Jul 6, 2026 |
| 2.26.0 | Jul 3, 2026 |
| 2.25.0 | Jun 24, 2026 |
| 2.24.0 | Jun 17, 2026 |
| 2.23.0 | Jun 16, 2026 |
| 2.22.0 | Jun 12, 2026 |
| 2.21.0 | Jun 10, 2026 |
| 2.20.1 | Jun 2, 2026 |
| 2.20.0 | May 29, 2026 |
| 2.19.0 | May 8, 2026 |
| 2.18.2 | May 1, 2026 |
| 2.18.1 | Apr 28, 2026 |
| 2.18.0 | Apr 27, 2026 |
| 2.17.2 | Apr 22, 2026 |
| 2.17.1 | Apr 17, 2026 |
| 2.17.0 | Apr 3, 2026 |
| 2.16.0 | Mar 31, 2026 |
| 2.15.1 | Mar 22, 2026 |
| 2.15.0 | Mar 13, 2026 |
| 2.14.0 | Mar 3, 2026 |
| 2.13.2 | Feb 19, 2026 |
| 2.13.1 | Feb 18, 2026 |