Sanity MCP Server

Official

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_USER_ROLENoDetermines tool access level (developer or editor)
SANITY_DATASETYesThe dataset to use
SANITY_API_HOSTNoAPI host (defaults to https://api.sanity.io)https://api.sanity.io
SANITY_API_TOKENYesYour Sanity API token
SANITY_PROJECT_IDYesYour Sanity project ID

Schema

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Tools

Functions exposed to the LLM to take actions

NameDescription
get_initial_context

IMPORTANT: This tool must be called before using any other tools. It will get initial context and usage instructions for this MCP server.

get_sanity_config

Get current Sanity configuration (projectId, dataset, API settings)

get_groq_specification

Get the GROQ language specification summary

create_document

Create a new document in Sanity with AI-generated content based on instructions

update_document

Update an existing document or version with AI-generated content based on instructions

patch_document

Apply direct patch operations to modify specific parts of a document without using AI generation

query_documents

Query documents from Sanity using GROQ query language

document_action

Perform document actions like publishing, unpublishing, or deleting documents

create_version

Create a version of an existing document for a specific release, with optional AI-generated modifications

discard_version

Discard a draft or delete a specific version document from a release

mark_for_unpublish

Mark a document to be unpublished when a specific release is published

get_schema

Get the full schema of the current Sanity environment

list_schema_ids

Get a list of all available schema IDs

list_releases

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

create_release

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

edit_release

Update metadata for an existing content release

schedule_release

Schedule a content release to be published at a specific time

release_action

Perform basic actions on existing content releases (publish, archive, unschedule, delete)

list_embeddings_indices

List all available embeddings indices for a dataset

semantic_search

Perform a semantic search on an embeddings index

ID: s8v5wceait