Sanity

Enable AI agents to interact with your Sanity workspace through the Model Context Protocol (MCP).

Community: Submitted by a user or imported; check the owner before granting accessOnlineNo sign-inGlobalFreeRead-only

What it can do

  • Get Schema: Get the full schema of the current Sanity workspace
  • List Workspace Schemas: Get a list of all available workspace schema names
  • Deploy Schema: 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, g

What data it sees

Do you need an account

No: the server works without sign-in

Enable AI agents to interact with your Sanity workspace through the Model Context Protocol (MCP).

The Sanity Model Context Protocol (MCP) server enables AI assistants like Claude Code and Cursor to interact directly with your Sanity projects.

With the MCP server, agents can go beyond code generation and perform advanced content management operations in your Sanity projects—execute GROQ queries, manage releases, and patch documents with full awareness of your schema, eliminating the need to manually supply context.

Server tool list (41)

Raw names from tools/list. Only developers need these.

get_schemaGet the full schema of the current Sanity workspace
list_workspace_schemasGet a list of all available workspace schema names
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.
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.
create_documents_from_markdownCreate one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation.
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.
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.
patch_document_from_markdownPatch a specific field in a document using Markdown content
query_documentsQuery documents from Sanity using GROQ query language
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 a new array item. Note: Image generation is asynchronous and completes in the background.
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 is asynchronous and completes in the background.
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.
publish_documentsPublish one or more draft documents to make them live
unpublish_documentsUnpublish one or more published documents (moves them back to drafts)
version_replace_documentReplace the contents of a document version with contents from another document
discard_draftsDiscard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided.
version_unpublish_documentMark a document to be unpublished when the release is run
list_organizationsLists all organizations the user has access to in Sanity
list_projectsLists all Sanity projects associated with your account
get_project_studiosRetrieves all studio applications linked to a specific Sanity project
create_projectCreates a new Sanity project and initializes it with a dataset and API tokens
add_cors_originAdds CORS origin(s) to allow client-side requests to a Sanity project
list_datasetsLists all datasets in your Sanity project
create_datasetCreates a new dataset with specified name and access settings
update_datasetModifies a dataset's name or access control settings
list_releasesList content releases in Sanity, optionally filtered by state (active, scheduled, etc)
create_releaseCreate a new content release in Sanity with an automatically generated ID
edit_releaseUpdate metadata for an existing content release
schedule_releaseSchedule a content release to be published at a specific time
publish_releasePublish a release immediately
archive_releaseArchive a release that is no longer active
unarchive_releaseRestore an archived release
unschedule_releaseRemove a previously set schedule from a release
delete_releaseDelete a release
list_embeddings_indicesList all available embeddings indices for a dataset
semantic_searchPerform a semantic search on an embeddings index
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 users want to migrate their existing CMS or content system to Sanity.
search_docsSearch Sanity docs
read_docsRead a specific Sanity documentation article
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.
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.
Sanity: connect to Claude, ChatGPT, Cursor · Connectors.fun