Sanity
Enable AI agents to interact with your Sanity workspace through the Model Context Protocol (MCP).
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.
How to connect
How to connect Sanity to Claude
The server address to paste into Claude settings:
https://sanity.run.tools
- Open Claude (claude.ai or the desktop app).
- Go to Settings → Connectors.
- Click Add custom connector.
- Paste the server address copied below into Remote MCP server URL and click Add.
- In a chat, click + → Connectors and switch the new connector on.
Custom connectors are available on Free, Pro, Max, Team and Enterprise plans (Free is limited to one). On Team and Enterprise an organization Owner adds the connector first under Organization settings → Connectors.
Authorization
After you click Add, a sign-in window for the service opens. Sign in with your own account and approve access. Claude never sees your password.
How to connect Sanity to ChatGPT
The server address to paste into ChatGPT settings:
https://sanity.run.tools
- Open ChatGPT in a browser (chatgpt.com). A Plus, Pro, Business, Enterprise or Edu plan is required.
- Turn on developer mode once: Settings → Apps → Advanced settings → Developer mode.
- Open Settings → Connectors and click Create.
- Fill in the form: Name (anything), Description (one line about what the service does), MCP server URL (copy it below).
- Under Authentication choose OAuth if the service requires sign-in, otherwise None. Click Create.
- In a new chat open + → Apps/Connectors and enable the connector.
OpenAI has renamed this section before (Connectors → Apps/Plugins). If the label differs, search settings for "developer mode". On Business/Enterprise workspaces an admin must allow custom connectors first.
Authorization
On first use ChatGPT opens the service's sign-in window. Sign in and approve access.
How to connect Sanity to Cursor
The server address to paste into Cursor settings:
https://sanity.run.tools
Fastest: click Open in Cursor below and confirm the prompt.
Manually:
- In Cursor open Settings → Cursor Settings → MCP and click Add new global MCP server.
- Paste the JSON copied below into
~/.cursor/mcp.json(per project:.cursor/mcp.jsonin the repo root). - Save the file. The server appears in the MCP list; authorize it there if asked.
Authorization
If the service needs sign-in, an authorize button appears next to the server in the MCP list.
Server tool list (41)
Raw names from tools/list. Only developers need these.
| 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, generate local schema files instead. Can be called iteratively to add/overwrite types. |
| create_documents_from_json | Create one or more draft documents by directly providing JSON content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation. |
| create_documents_from_markdown | Create one or more draft documents from Markdown content. Creates drafts (drafts.* prefix) unless releaseId is specified for version creation. |
| create_version | 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. |
| patch_document_from_json | 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. |
| patch_document_from_markdown | Patch a specific field in a document using Markdown content |
| query_documents | Query documents from Sanity using GROQ query language |
| generate_image | 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 a new array item. Note: Image generation is asynchronous and completes in the background. |
| transform_image | 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 is asynchronous and completes in the background. |
| get_document | 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. |
| publish_documents | Publish one or more draft documents to make them live |
| unpublish_documents | Unpublish one or more published documents (moves them back to drafts) |
| version_replace_document | Replace the contents of a document version with contents from another document |
| discard_drafts | Discard one or more draft documents (deletes drafts while keeping published documents intact). Can also discard release versions if releaseId is provided. |
| version_unpublish_document | Mark a document to be unpublished when the release is run |
| list_organizations | Lists all organizations the user has access to in Sanity |
| list_projects | Lists all Sanity projects associated with your account |
| get_project_studios | Retrieves all studio applications linked to a specific Sanity project |
| create_project | Creates a new Sanity project and initializes it with a dataset and API tokens |
| add_cors_origin | Adds CORS origin(s) to allow client-side requests to a Sanity project |
| list_datasets | Lists all datasets in your Sanity project |
| create_dataset | Creates a new dataset with specified name and access settings |
| update_dataset | Modifies a dataset's name or access control settings |
| 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 |
| publish_release | Publish a release immediately |
| archive_release | Archive a release that is no longer active |
| unarchive_release | Restore an archived release |
| unschedule_release | Remove a previously set schedule from a release |
| delete_release | Delete a release |
| list_embeddings_indices | List all available embeddings indices for a dataset |
| semantic_search | Perform a semantic search on an embeddings index |
| migration_guide | 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 users want to migrate their existing CMS or content system to Sanity. |
| search_docs | Search Sanity docs |
| read_docs | Read a specific Sanity documentation article |
| list_sanity_rules | 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. |
| get_sanity_rules | 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. |