Sanity MCP: Documentation
Updated:
Connection
npx sanity@latest mcp configure — the CLI detects your installed editor (Cursor, VS Code, Claude Code) and writes the config for the hosted mcp.sanity.io endpoint. Default auth is OAuth (sessions last 7 days); an alternative is a project API token in the Authorization header. The older local server is archived in favor of the hosted version.
Tools
40+ tools:
- Content —
query_documents,create_documents,patch_documents,publish_documents,unpublish_documents,discard_drafts. - Schema & Studio —
get_schema,deploy_schema,deploy_studio,list_workspace_schemas. - Releases —
create_release,list_releases,create_version,version_discard. - Projects —
list_projects,create_project,list_datasets,create_dataset,add_cors_origin. - AI —
generate_image,transform_image,semantic_search. - Docs —
search_docs,read_docs,list_sanity_rules,get_sanity_rules.
generate_image, transform_image and create_version with the instruction parameter consume AI credits — they can be disabled in the MCP client's settings.
Agent flow
"Use a GROQ query to find every article by author X with no cover image", "publish draft document Y", "deploy the studio after a schema change".
Pricing
Connecting is free; AI credits and API limits follow the Sanity project's plan.