sanity-io avatar

Sanity

sanity-io/agent-toolkitOfficial

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.

tools
41
transport
HTTP
last updated
Nov 11, 2026

Tools

41 tools

Public tool metadata for what this MCP can expose to an agent.

get_schemaGet the full schema of the current Sanity workspace3 params

Get the full schema of the current Sanity workspace

Parameters* required
resourceobject
Resource information indicating which project id and dataset to target
typestring
Optional: Specific type name to fetch. If not provided, returns the full schema without detailed field definitions. Full field definitions are only available when requesting a specific type.
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
list_workspace_schemasGet a list of all available workspace schema names1 params

Get a list of all available workspace schema names

Parameters* required
resourceobject
Resource information indicating which project id and dataset to target
deploy_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 params

Deploy 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.

Parameters* required
resourceobject
Resource information indicating which project id and dataset to target
schemaDeclarationstring
Sanity schema declaration <syntax> - Requires literal values only: no spread operators, variables, dynamic expressions, imports, or function bodies - If your schema makes references to othe...
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
create_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 params

Create one or more draft documents by directly providing JSON content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.

Parameters* required
documentsarray
Array of documents to create. Each document must have a type and content.
releaseIdstring
Optional release ID for creating versioned documents. If provided, documents will be created under the specified release version instead of as drafts.
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
create_documents_from_markdownCreate one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.4 params

Create one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.

Parameters* required
documentsarray
Array of documents to create. Each document must have a type and Markdown content.
releaseIdstring
Optional release ID for creating versioned documents. If provided, documents will be created under the specified release version instead of as drafts.
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
create_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 params

Create 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.

Parameters* required
documentIdsarray
Array of document IDs to create versions for (min 1, max 10)
instructionstring
Natural language instruction for internal Sanity AI to modify the document while creating the version. Use this to make content updates, rewrites, or improvements (e.g., "Update all dates to 2025",...
releaseIdstring
ID of the release to associate this version with
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
patch_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 params

Apply 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.

Parameters* required
appendarray
Adds items to the END of an array. Can ONLY append to arrays that already EXIST in the document. CANNOT be used on non-array fields. Each append operation targets ONE specific array. For referen...
documentIdstring
Document ID to patch. For drafts use "drafts." prefix (e.g., "drafts.myDocId"). For published use ID directly.
releaseIdstring
Optional release ID for patching within a specific release. Omit for standard drafts.
resourceobject
Resource information indicating which project id and dataset to target
setarray
BATCHED operation that replaces field values at specified paths. Can set fields that don't exist yet - the field will be created based on schema. CRITICAL: 'set' is DESTRUCTIVE - scope matters: -...
unsetarray
Removes fields and array items from the document. Use UNSET to delete data - specify only what to remove. Array item removal: - Object arrays (with _key): "categories[_key==\"guide\"]", "tags[_ke...
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
patch_document_from_markdownPatch a specific field in a document using Markdown content6 params

Patch a specific field in a document using Markdown content

Parameters* required
documentIdstring
The ID of the document to patch
markdownstring
Markdown content to apply to the target field. The content will be converted to the appropriate structure based on the target field schema.
pathstring
Path to the field to update (e.g., "bio", "hero.contents")
releaseIdstring
Optional release ID for patching versioned documents. If provided, the document in the specified release will be patched.
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
query_documentsQuery documents from Sanity using GROQ query language6 params

Query documents from Sanity using GROQ query language

Parameters* required
limitinteger
Maximum number of documents to returndefault: 10
paramsobject
Optional parameters for the GROQ query
perspectivevalue
Optional perspective to query from: "raw", "drafts", "published", or a release ID. Models should examine available releases and perspectives in the dataset before selecting one to ensure they are q...default: raw
querystring
Complete GROQ query (e.g. "*[_type == \"post\"][0...10]{title, _id}")
resourceobject
Resource information indicating which project id and dataset to target
singleboolean
Whether to return a single document or a listdefault: false
generate_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 params

Generate 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...

Parameters* required
documentIdstring
The ID of the document containing the image
imagePathstring
Path to the image field in the document (e.g., "image", "hero.image", "images"). For arrays of images, provide the array field name and a new image will be added automatically.
instructionstring
Natural language instructions for generating the image. Acts like a prompt telling the internal Sanity AI what to do. Describe the complete image to create (e.g., "A serene mountain landscape at da...
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
transform_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 params

Transform 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...

Parameters* required
documentIdstring
The ID of the document containing the image
imagePathstring
Path to the image field in the document (e.g., "image", "hero.image"). For image arrays, target with _key filtering: "images[_key==\"img1\"]".
instructionstring
Natural language instructions for transforming the image. Acts like a prompt telling the internal Sanity AI what to do. Describe the desired changes (e.g., "Make the background more vibrant and add...
resourceobject
Resource information indicating which project id and dataset to target
workspaceNamestring
Workspace name derived from the manifest, not document type. Derived from context or listSchemaWorkspacesTooldefault: default
get_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 params

Fetch 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.

Parameters* required
documentIdstring
The exact document ID to fetch. Must be a complete, known document ID (e.g., "movie-123" or "drafts.article-456"). This is a direct ID lookup only - it does not search, filter, or query.
resourceobject
Resource information indicating which project id and dataset to target
publish_documentsPublish one or more draft documents to make them live2 params

Publish one or more draft documents to make them live

Parameters* required
idsarray
IDs of the documents to publish
resourceobject
Resource information indicating which project id and dataset to target
unpublish_documentsUnpublish one or more published documents (moves them back to drafts)2 params

Unpublish one or more published documents (moves them back to drafts)

Parameters* required
idsarray
IDs of the documents to unpublish (published document IDs only)
resourceobject
Resource information indicating which project id and dataset to target
version_replace_documentReplace the contents of a document version with contents from another document5 params

Replace the contents of a document version with contents from another document

Parameters* required
idstring
ID of the published document
releaseIdstring
ID of the release that contains this document version
resourceobject
Resource information indicating which project id and dataset to target
sourceDocumentIdstring
ID of the document to copy contents from
typestring
discard_draftsDiscard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided.3 params

Discard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided.

Parameters* required
idsarray
IDs of the documents to discard (published IDs without drafts. prefix)
releaseIdstring
Optional release ID. If provided, discards the versions from this release instead of the draft versions.
resourceobject
Resource information indicating which project id and dataset to target
version_unpublish_documentMark a document to be unpublished when the release is run3 params

Mark a document to be unpublished when the release is run

Parameters* required
idstring
ID of the published document
releaseIdstring
ID of the release that contains this document version
resourceobject
Resource information indicating which project id and dataset to target
list_organizationsLists all organizations the user has access to in Sanity

Lists all organizations the user has access to in Sanity

No parameter schema in public metadata yet.

list_projectsLists all Sanity projects associated with your account

Lists 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 params

Retrieves all studio applications linked to a specific Sanity project

Parameters* required
resourceobject
create_projectCreates a new Sanity project and initializes it with a dataset and API tokens4 params

Creates a new Sanity project and initializes it with a dataset and API tokens

Parameters* required
allowCredentialsboolean
Allow authenticated requests from this origin. Required for hosting a Studio. Defaults to truedefault: true
corsOriginstring
CORS origin to allow, in format protocol://hostname[:port]. Use * for wildcard. Common values: - http://localhost:3000: For embedding Studio in Next.js, React, or similar frameworks during local d...
displayNamestring
The display name for the new project
organizationIdstring
Organization ID to create the project in
add_cors_originAdds CORS origin(s) to allow client-side requests to a Sanity project3 params

Adds CORS origin(s) to allow client-side requests to a Sanity project

Parameters* required
allowCredentialsboolean
Allow authenticated requests from this origin. Required for hosting a Studio or making authenticated API requests. Defaults to true.default: true
originstring
CORS origin to allow, in format protocol://hostname[:port]. Wildcards (*) are supported for subdomains (e.g., https://*.example.com). Common values: - http://localhost:3000: Local development wit...
projectIdstring
The ID of the Sanity project to add the CORS origin to
list_datasetsLists all datasets in your Sanity project1 params

Lists all datasets in your Sanity project

Parameters* required
resourceobject
create_datasetCreates a new dataset with specified name and access settings3 params

Creates a new dataset with specified name and access settings

Parameters* required
aclModestring
The ACL mode for the datasetone of private · public
datasetNamestring
The name of the dataset (will be automatically formatted to match requirements)
resourceobject
update_datasetModifies a dataset's name or access control settings2 params

Modifies a dataset's name or access control settings

Parameters* required
aclModestring
The ACL mode for the datasetone of private · public
resourceobject
Resource information indicating which project id and dataset to target
list_releasesList content releases in Sanity, optionally filtered by state (active, scheduled, etc)2 params

List content releases in Sanity, optionally filtered by state (active, scheduled, etc)

Parameters* required
resourceobject
Resource information indicating which project id and dataset to target
statestring
Filter releases by state. Use "all" to get all non-archived releases (active, scheduled, published). Use "archived" or "deleted" to specifically list those.one of active · scheduled · published · archived · deleted · alldefault: active
create_releaseCreate a new content release in Sanity with an automatically generated ID5 params

Create a new content release in Sanity with an automatically generated ID

Parameters* required
descriptionstring
Description for the release
intendedPublishAtstring
Date can be ISO format (2025-04-04T18:36:00.000Z) or natural language like "in two weeks"
releaseTypestring
Type of release (asap, undecided, scheduled)one of asap · undecided · scheduleddefault: undecided
resourceobject
Resource information indicating which project id and dataset to target
titlestring
Title for the release (e.g., "Spring 2025 Product Launch")
edit_releaseUpdate metadata for an existing content release6 params

Update metadata for an existing content release

Parameters* required
descriptionstring
Description for the release
intendedPublishAtstring
When the release is intended to be published (informational only)
releaseIdstring
ID of the release
releaseTypestring
Type of release (asap, undecided, scheduled)one of asap · undecided · scheduled
resourceobject
Resource information indicating which project id and dataset to target
titlestring
Title for the release (e.g., "Spring 2025 Product Launch")
schedule_releaseSchedule a content release to be published at a specific time3 params

Schedule a content release to be published at a specific time

Parameters* required
publishAtstring
Date can be ISO format (2025-04-04T18:36:00.000Z) or natural language like "in two weeks"
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
publish_releasePublish a release immediately2 params

Publish a release immediately

Parameters* required
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
archive_releaseArchive a release that is no longer active2 params

Archive a release that is no longer active

Parameters* required
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
unarchive_releaseRestore an archived release2 params

Restore an archived release

Parameters* required
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
unschedule_releaseRemove a previously set schedule from a release2 params

Remove a previously set schedule from a release

Parameters* required
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
delete_releaseDelete a release2 params

Delete a release

Parameters* required
releaseIdstring
ID of the release
resourceobject
Resource information indicating which project id and dataset to target
list_embeddings_indicesList all available embeddings indices for a dataset1 params

List all available embeddings indices for a dataset

Parameters* required
resourceobject
Resource information indicating which project id and dataset to target
semantic_searchPerform a semantic search on an embeddings index4 params

Perform a semantic search on an embeddings index

Parameters* required
indexNamestring
The name of the embeddings index to search
limitinteger
Maximum number of results to returndefault: 10
querystring
The search query to find semantically similar content
resourceobject
Resource information indicating which project id and dataset to target
migration_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 params

Get 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...

Parameters* required
guidestring
The type of migration guide to retrieve. - Use "general" for a high-level Sanity migration guide - Use "schema.{platform}" for a platform-specific guide for migrating schemas to Sanity - Use "conte...one of general · schema.generic · schema.contentful · schema.wordpress · schema.strapi · schema.drupal
search_docsSearch Sanity docs2 params

Search Sanity docs

Parameters* required
limitinteger
Maximum number of results to return (default: 10, max: 50)default: 10
querystring
The search query for documentation
read_docsRead a specific Sanity documentation article1 params

Read a specific Sanity documentation article

Parameters* required
pathstring
The documentation path (e.g., "/docs/studio/installation") or full URL (e.g., "https://www.sanity.io/docs/studio/installation")
list_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 params

Load 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.

Parameters* required
rulesarray
One or more rule names to load. Use list_sanity_rules to see available rules.

Sponsors

Readme

d6cf401d52c33b7a5a354a14ab7de94dea2f0c02 192x192

Sanity Agent Toolkit

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


View the full README on GitHub

Details

Repository
github.com/sanity-io/agent-toolkit
Website
www.sanity.io/docs/ai/mcp-server
Category
AI & LLM Tools
Transport
HTTP
Registry
MCP registry, active

Related AI & LLM Tools MCP servers

View all
1shinpr avatarMcp Imageshinpr/mcp-imageAI image generation and editing with prompt optimization and quality presets187stars
2codegraph-ai avatarCodegraphcodegraph-ai/codegraphSemantic code graph: 42 tools, 38 languages. Callers, impact, AI context, memory, PR review.144stars
3jnmetacode avatarShellwardjnmetacode/shellwardAI agent security: 7 MCP tools for injection detection, PII scanning, command safety, DLP.108stars
4frumu-ai avatarDocs Mcpfrumu-ai/tandemRemote MCP server for Tandem docs, install guides, SDKs, workflows, and agent setup help.107stars
5major7apps avatarPensyvemajor7apps/pensyveUniversal memory runtime for AI agents — episodic, semantic, and procedural memory.99stars
6vortx-ai avataremem, the verifiable memory protocol for the physical worldvortx-ai/ememShared, verifiable memory for machines and AI. Encode where data lives; decode with any AI.89stars