Connects your MCP-compatible editor directly to Sanity's content management platform through their official API. Exposes tools for running GROQ queries, creating and patching documents, deploying schemas, managing publish states, and generating images. You can query content, push schema changes, and manipulate documents without leaving your editor. Includes comprehensive agent skills covering GROQ optimization, Visual Editing setup, Portable Text handling, and framework integrations. Works with Cursor, Claude Code, VS Code, and other MCP clients. Particularly solid if you're building content-heavy applications and want your AI assistant to understand Sanity's conventions around content modeling and performance patterns.
Public tool metadata for what this MCP can expose to an agent.
get_schemaGet the full schema of the current Sanity workspace3 paramsGet the full schema of the current Sanity workspace
typestringresourceobjectworkspaceNamestringlist_workspace_schemasGet a list of all available workspace schema names1 paramsGet a list of all available workspace schema names
resourceobjectdeploy_schemaDeploy Sanity schema directly to cloud (project and dataset). IMPORTANT: Only use this for projects WITHOUT a local Sanity Studio. If sanity.config.ts/js or a schema directory exists, generate local schema files instead. Can be called iteratively to add/overwrite types.3 paramsDeploy Sanity schema directly to cloud (project and dataset). IMPORTANT: Only use this for projects WITHOUT a local Sanity Studio. If sanity.config.ts/js or a schema directory exists, generate local schema files instead. Can be called iteratively to add/overwrite types.
resourceobjectworkspaceNamestringschemaDeclarationstringcreate_documents_from_jsonCreate one or more draft documents by directly providing JSON content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.4 paramsCreate one or more draft documents by directly providing JSON content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.
resourceobjectdocumentsarrayreleaseIdstringworkspaceNamestringcreate_documents_from_markdownCreate one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.4 paramsCreate one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.
resourceobjectdocumentsarrayreleaseIdstringworkspaceNamestringcreate_versionCreate a version document (versions.{releaseId}.* prefix) for a specific release. Versions are separate from drafts and published documents, and are used for scheduled release workflows.5 paramsCreate a version document (versions.{releaseId}.* prefix) for a specific release. Versions are separate from drafts and published documents, and are used for scheduled release workflows.
resourceobjectreleaseIdstringdocumentIdsarrayinstructionstringworkspaceNamestringpatch_document_from_jsonApply precise modifications to document fields. When targeting a published document, this creates or updates a draft with the changes (published document remains unchanged). When targeting a draft or version, updates it in place.7 paramsApply precise modifications to document fields. When targeting a published document, this creates or updates a draft with the changes (published document remains unchanged). When targeting a draft or version, updates it in place.
setarrayunsetarrayappendarrayresourceobjectreleaseIdstringdocumentIdstringworkspaceNamestringpatch_document_from_markdownPatch a specific field in a document using Markdown content6 paramsPatch a specific field in a document using Markdown content
pathstringmarkdownstringresourceobjectreleaseIdstringdocumentIdstringworkspaceNamestringquery_documentsQuery documents from Sanity using GROQ query language6 paramsQuery documents from Sanity using GROQ query language
limitintegerquerystringparamsobjectsinglebooleanresourceobjectperspectivevaluegenerate_imageGenerate a new image in a document using AI. When targeting a published document, this creates or updates a draft with the generated image (published document remains unchanged). The draft must be published separately to make changes live. For image arrays, automatically adds...5 paramsGenerate a new image in a document using AI. When targeting a published document, this creates or updates a draft with the generated image (published document remains unchanged). The draft must be published separately to make changes live. For image arrays, automatically adds...
resourceobjectimagePathstringdocumentIdstringinstructionstringworkspaceNamestringtransform_imageTransform an existing image in a document using AI. When targeting a published document, this creates or updates a draft with the transformed image (published document remains unchanged). The draft must be published separately to make changes live. Note: Image transformation i...5 paramsTransform an existing image in a document using AI. When targeting a published document, this creates or updates a draft with the transformed image (published document remains unchanged). The draft must be published separately to make changes live. Note: Image transformation i...
resourceobjectimagePathstringdocumentIdstringinstructionstringworkspaceNamestringget_documentFetch a single document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query. Use when you have a specific document ID and need its full content.2 paramsFetch a single document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query. Use when you have a specific document ID and need its full content.
resourceobjectdocumentIdstringpublish_documentsPublish one or more draft documents to make them live2 paramsPublish one or more draft documents to make them live
idsarrayresourceobjectunpublish_documentsUnpublish one or more published documents (moves them back to drafts)2 paramsUnpublish one or more published documents (moves them back to drafts)
idsarrayresourceobjectversion_replace_documentReplace the contents of a document version with contents from another document5 paramsReplace the contents of a document version with contents from another document
idstringtypestringresourceobjectreleaseIdstringsourceDocumentIdstringdiscard_draftsDiscard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided.3 paramsDiscard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided.
idsarrayresourceobjectreleaseIdstringversion_unpublish_documentMark a document to be unpublished when the release is run3 paramsMark a document to be unpublished when the release is run
idstringresourceobjectreleaseIdstringlist_organizationsLists all organizations the user has access to in SanityLists all organizations the user has access to in Sanity
No parameter schema in public metadata yet.
list_projectsLists all Sanity projects associated with your accountLists all Sanity projects associated with your account
No parameter schema in public metadata yet.
get_project_studiosRetrieves all studio applications linked to a specific Sanity project1 paramsRetrieves all studio applications linked to a specific Sanity project
resourceobjectcreate_projectCreates a new Sanity project and initializes it with a dataset and API tokens4 paramsCreates a new Sanity project and initializes it with a dataset and API tokens
corsOriginstringdisplayNamestringorganizationIdstringallowCredentialsbooleanadd_cors_originAdds CORS origin(s) to allow client-side requests to a Sanity project3 paramsAdds CORS origin(s) to allow client-side requests to a Sanity project
originstringprojectIdstringallowCredentialsbooleanlist_datasetsLists all datasets in your Sanity project1 paramsLists all datasets in your Sanity project
resourceobjectcreate_datasetCreates a new dataset with specified name and access settings3 paramsCreates a new dataset with specified name and access settings
aclModestringprivate · publicresourceobjectdatasetNamestringupdate_datasetModifies a dataset's name or access control settings2 paramsModifies a dataset's name or access control settings
aclModestringprivate · publicresourceobjectlist_releasesList content releases in Sanity, optionally filtered by state (active, scheduled, etc)2 paramsList content releases in Sanity, optionally filtered by state (active, scheduled, etc)
statestringactive · scheduled · published · archived · deleted · alldefault: activeresourceobjectcreate_releaseCreate a new content release in Sanity with an automatically generated ID5 paramsCreate a new content release in Sanity with an automatically generated ID
titlestringresourceobjectdescriptionstringreleaseTypestringasap · undecided · scheduleddefault: undecidedintendedPublishAtstringedit_releaseUpdate metadata for an existing content release6 paramsUpdate metadata for an existing content release
titlestringresourceobjectreleaseIdstringdescriptionstringreleaseTypestringasap · undecided · scheduledintendedPublishAtstringschedule_releaseSchedule a content release to be published at a specific time3 paramsSchedule a content release to be published at a specific time
resourceobjectpublishAtstringreleaseIdstringpublish_releasePublish a release immediately2 paramsPublish a release immediately
resourceobjectreleaseIdstringarchive_releaseArchive a release that is no longer active2 paramsArchive a release that is no longer active
resourceobjectreleaseIdstringunarchive_releaseRestore an archived release2 paramsRestore an archived release
resourceobjectreleaseIdstringunschedule_releaseRemove a previously set schedule from a release2 paramsRemove a previously set schedule from a release
resourceobjectreleaseIdstringdelete_releaseDelete a release2 paramsDelete a release
resourceobjectreleaseIdstringlist_embeddings_indicesList all available embeddings indices for a dataset1 paramsList all available embeddings indices for a dataset
resourceobjectsemantic_searchPerform a semantic search on an embeddings index4 paramsPerform a semantic search on an embeddings index
limitintegerquerystringresourceobjectindexNamestringmigration_guideGet comprehensive guidance for migrating existing projects to Sanity. Supports general migration guides, analyzing existing content structures + designing Sanity schemas, and migrating content from various CMS platforms (like Contentful, WordPress, Strapi). Use this tool when...1 paramsGet comprehensive guidance for migrating existing projects to Sanity. Supports general migration guides, analyzing existing content structures + designing Sanity schemas, and migrating content from various CMS platforms (like Contentful, WordPress, Strapi). Use this tool when...
guidestringgeneral · schema.generic · schema.contentful · schema.wordpress · schema.strapi · schema.drupalsearch_docsSearch Sanity docs2 paramsSearch Sanity docs
limitintegerquerystringread_docsRead a specific Sanity documentation article1 paramsRead a specific Sanity documentation article
pathstringlist_sanity_rulesIMPORTANT: Call this FIRST before any Sanity development work. Returns available best practice rules for schemas, queries, frameworks, and visual editing. You MUST load relevant rules before writing Sanity code.IMPORTANT: Call this FIRST before any Sanity development work. Returns available best practice rules for schemas, queries, frameworks, and visual editing. You MUST load relevant rules before writing Sanity code.
No parameter schema in public metadata yet.
get_sanity_rulesLoad Sanity development rules. ALWAYS call list_sanity_rules first to see available rules, then load all rules relevant to your task in a single call.1 paramsLoad Sanity development rules. ALWAYS call list_sanity_rules first to see available rules, then load all rules relevant to your task in a single call.
rulesarrayCollection 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.
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:
npx sanity@latest mcp configure
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:
{
"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:
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"]
}
}
}
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.
npx skills add sanity-io/agent-toolkit
See Option 3 for plugin installation.
Install the Sanity plugin to get MCP server, agent skills, and commands. Available on the Claude Code marketplace and Cursor Marketplace.
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
/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:
/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 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.
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).
sanity-io/agent-toolkit/
├── AGENTS.md # Knowledge router & agent behavior
├── README.md # This file
├── .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 # MCP server 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-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.
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
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent