Sanity MCP Server: Setup for Claude, Cursor and Other Apps
Lets Claude, Cursor and other assistants query and edit your Sanity content, schemas, releases, datasets and Media Libraries.
This is Sanity's own hosted server. Your assistant can run GROQ queries, create and edit documents, deploy schemas, manage releases and datasets, and work with Media Libraries, using your Sanity account. There is nothing to run on your computer.
You sign in with your Sanity account in the browser, or you can send an API token instead. Edits go to drafts or release versions, and nothing is published until the assistant calls the publish tool. Sanity's older local server is archived in favor of this one.
Good for
- Developers who build on Sanity and want help with GROQ queries and schemas
- Content teams who want an assistant to draft, edit and publish documents
- Teams moving content into Sanity and reshaping it with a migration
- Designers and marketers who manage assets in a Media Library
Works in
14 should work
Tap an app to see how to set it up and any known problems.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Supports hosted MCP servers.
Install Sanity MCP
Claude Code
- 1
Copy this prompt.
Add the Sanity MCP server to Claude Code. Run this command: claude mcp add Sanity -t http https://mcp.sanity.io --scope user Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Sign-in with the vendor account (OAuth).
From the vendor's docs. Source.
Tools
Runs a GROQ query on your content
Runs a GROQ query against a dataset and returns the matching documents. Results over 64 KiB are rejected, so ask for only the fields you need.
Try: “Show all articles written by Mark, titles only.”
Read ·
query_documentsFetches one document by its ID
Looks up a single document by its exact ID and returns all of it. It does not search.
Try: “Open the document with ID article-1.”
Read ·
get_documentShows the deployed content schema
Fetches the schema deployed for a project and dataset, so the assistant knows your document types before it queries or edits.
Try: “What document types does my production dataset have?”
Read ·
get_schemaLists every deployed schema, by source
Shows each deployed schema for a dataset, grouped by where it came from, with an ID to read an exact one.
Try: “Which schemas are deployed to this dataset?”
Read ·
list_workspace_schemasReads one type from the schema
Returns one document or object type from the current schema in editable form, with the version number later edits must pass.
Try: “Show me the definition of the article type.”
Read ·
schema_type_getChecks documents against the schema
Validates documents against the deployed schema without changing them. It is in beta, so review the results.
Try: “Validate my draft articles against the schema.”
Read ·
documents_validateShows which Sanity account is connected
Returns the signed-in account name, email and how the server is authenticated, to confirm the right identity.
Try: “Which Sanity account am I connected as?”
Read ·
whoamiLists your Sanity organizations
Returns the organizations your account can access.
Try: “Which Sanity organizations do I belong to?”
Read ·
list_organizationsLists your Sanity projects
Returns the projects linked to your account.
Try: “List my Sanity projects.”
Read ·
list_projectsLists Studios linked to a project
Returns the Studio applications attached to one project.
Try: “Which Studios does this project have?”
Read ·
get_project_studiosLists a project's datasets
Returns the datasets in one project.
Try: “What datasets are in this project?”
Read ·
list_datasetsLists content releases in a dataset
Shows active and scheduled releases by default, and published or archived ones when you filter by state.
Try: “Show all releases in production.”
Read ·
list_releasesLists allowed web origins for a project
Returns the CORS origins that may make browser requests to the project.
Try: “Which CORS origins are allowed on this project?”
Read ·
cors_origins_listLists search indexes for a dataset
Returns the embeddings indexes available for meaning-based search.
Try: “Which semantic search indexes exist here?”
Read ·
list_embeddings_indicesSearches content by meaning
Runs a semantic search on an embeddings index and returns the closest documents.
Try: “Find articles about remote work policies.”
Read ·
semantic_searchSearches Sanity's documentation
Looks up pages in the Sanity docs by keyword.
Try: “Search the Sanity docs for GROQ joins.”
Network ·
search_docsReads one Sanity docs article
Fetches the full text of a named documentation article.
Try: “Read the docs page on releases.”
Network ·
read_docsLists Sanity's coding best-practice rules
Lists the development rule sets the server can load for your assistant.
Try: “Which Sanity best-practice rules are available?”
Read ·
list_sanity_rulesLoads chosen best-practice rules
Returns the text of specific rule sets, for example for writing GROQ, so the assistant follows them.
Try: “Load the GROQ rules before you write the query.”
Read ·
get_sanity_rulesCreates new documents
Creates documents from the content you give. They become drafts, live documents for types with live edit, or release versions when a release is named.
Try: “Create a draft article titled Spring launch.”
Write ·
create_documentsEdits existing documents
Applies edits to up to 25 documents per call in single transactions. Changes go to drafts or release versions, never straight to published content.
Try: “Change the title of article-1 to New title.”
Write ·
patch_documentsAdds a document to a release
Creates a release-specific copy of a document, used before you patch content that belongs to a release.
Try: “Add article-1 to the autumn release.”
Write ·
create_versionPublishes drafts
Publishes the drafts you name, which makes the content live. Documents are checked against the schema first.
Try: “Publish the draft article-1.”
Write ·
publish_documentsTakes published documents back to drafts
Unpublishes documents so they stop being live and return to draft state.
Try: “Unpublish the old pricing page.”
Write ·
unpublish_documentsDeletes draft documents
Throws away the drafts you name and keeps the published versions. The draft edits are lost.
Try: “Discard my draft of article-1.”
Delete ·
discard_draftsRemoves documents from a release
Discards document versions from a release, which deletes those release copies.
Try: “Drop article-1 from the autumn release.”
Delete ·
version_discardCreates a content release
Makes a new release for grouping changes. It does not schedule or publish it; that happens in Studio or the HTTP API.
Try: “Create a release called Autumn campaign.”
Write ·
create_releaseDeploys schema types to the cloud
Directly deploys schema types to the project, creating or replacing the schema the server manages.
Try: “Deploy an article type with title and body fields.”
Write ·
deploy_schemaAdds or edits fields on a type
Adds, replaces or removes top-level fields on one document or object type, using its current version number.
Try: “Add a slug field to the article type.”
Write ·
schema_fields_patchRemoves types from the schema
Deletes one or more types from the dataset schema. Types still used by other types cannot be removed, and a dry run shows losses first.
Try: “Remove the unused promo type from the schema.”
Delete ·
schema_types_deleteRemoves a server-managed schema
Removes a legacy schema the server manages in a named workspace. Documents and hosted Studios are kept.
Try: “Undeploy the old schema in the marketing workspace.”
Delete ·
undeploy_schemaDeploys a hosted Sanity Studio
Creates a hosted Studio bound to the server-managed schema and returns its address. Run it again after schema changes.
Try: “Deploy a Studio for this schema.”
Write ·
deploy_studioCreates a new Sanity project
Makes a project with a dataset and API tokens.
Try: “Create a Sanity project called Docs site.”
Write ·
create_projectCreates a new dataset
Adds a dataset with the name and access setting you choose.
Try: “Create a private dataset called staging.”
Write ·
create_datasetChanges a dataset's visibility
Switches a dataset between public and private and sets its description. Public datasets can be read without sign-in.
Try: “Make the staging dataset private.”
Write ·
update_datasetAllows a web origin
Adds origins that may make browser requests to the project.
Try: “Allow https://example.com to call this project.”
Write ·
add_cors_originRemoves an allowed web origin
Deletes a CORS origin, so browsers from that site lose access.
Try: “Remove the old staging origin.”
Delete ·
cors_origins_deleteGenerates an image for a document field
Starts AI image generation for a field. It uses your Sanity AI credits.
Try: “Generate a hero image for article-1.”
Write ·
generate_imageTransforms an existing image with AI
Starts an AI change to an image already in your content. It uses AI credits.
Try: “Make the cover image of article-1 look like a watercolor.”
Write ·
transform_imageUploads a file from a web link to a dataset
Starts an upload of an image or file from a public HTTPS link and returns an operation ID to track it.
Try: “Upload this logo URL to my dataset.”
Write ·
dataset_assets_upload_from_urlPrepares a one-use upload link for a dataset
Returns a temporary address where the client posts file bytes of up to 50 MiB into a dataset.
Try: “Upload the attached PDF to my dataset.”
Write ·
dataset_assets_upload_from_fileUploads a ChatGPT file to a dataset
Fetches a ChatGPT web attachment or generated file from its temporary link and stores it in a dataset.
Try: “Add the image I just generated to my dataset.”
Write ·
dataset_assets_upload_from_web_chatgptChecks progress of asset uploads
Looks up one to 20 uploads by operation ID and returns asset IDs, links and references for up to 24 hours.
Try: “Is my logo upload done?”
Read ·
assets_upload_statusLists Media Libraries in an organization
Returns library IDs to pass to the other Media Library tools.
Try: “Which Media Libraries does my organization have?”
Read ·
media_library_listShows a Media Library's types
Returns the document types of a library, or the fields of one type, before you query or edit.
Try: “What fields do assets have in this library?”
Read ·
media_library_get_schemaQueries a Media Library with GROQ
Searches assets, collections, folders and aspect definitions in a library.
Try: “Find all PNG assets added this month.”
Read ·
media_library_query_documentsFetches one Media Library document
Looks up a single library document by its exact ID.
Try: “Open asset image-abc in the library.”
Read ·
media_library_get_documentShows where an asset is used
Lists documents across project datasets that reference a library asset, so you can check before replacing it.
Try: “Where is this logo used?”
Read ·
media_library_list_asset_referencesCreates collections in a Media Library
Creates asset collections. Assets themselves cannot be created this way.
Try: “Create a collection called Press photos.”
Write ·
media_library_create_documentsEdits Media Library metadata
Changes asset titles, aspects and CDN access policy, and collection details. Title and aspect edits stay as drafts until published.
Try: “Retitle this asset to Team photo 2026.”
Write ·
media_library_patch_documentsPublishes Media Library asset edits
Publishes draft edits to assets after checking them against the library's aspect definitions.
Try: “Publish my changes to the Team photo asset.”
Write ·
media_library_publish_documentsDiscards Media Library asset drafts
Throws away unpublished metadata edits and keeps the published asset.
Try: “Discard my draft edits on this asset.”
Delete ·
media_library_discard_draftsMakes library assets usable in documents
Returns field values that reference chosen library assets, ready to apply with the document edit tool. Image and file assets get a local copy.
Try: “Link this library image into article-1.”
Write ·
media_library_link_assetsUploads a file from a web link to a library
Starts an upload of an image, video or file from a public HTTPS link into a Media Library, or adds a version to an asset.
Try: “Upload this video link to the Media Library.”
Write ·
media_library_upload_from_urlPrepares a one-use upload link for a library
Returns a temporary address where the client posts file bytes of up to 50 MiB into a Media Library.
Try: “Upload the attached photo to the Media Library.”
Write ·
media_library_upload_from_fileOld name for the library upload tool
Marked deprecated by Sanity. It does not start an upload, and points you to the library upload tool.
Try: “Upload this link to the Media Library.”
Read ·
media_assets_upload_from_urlRuns a limited set of Sanity CLI commands
Runs approved Sanity commands without a shell and returns their output. It cannot touch your files or sign-in.
Try: “Run the Sanity help command to list options.”
Runs code ·
run_sanity_cliSends feedback about Sanity to Sanity
Submits a message to Sanity about an error, a missing feature or unclear docs.
Try: “Tell Sanity that the schema tool error was confusing.”
Write ·
give_sanity_feedback
Read from the source code
Permissions
high risk · 4 things to watch
High risk
The assistant can edit and publish live content and delete drafts, release versions, schema types and web origins in your Sanity projects. Use a token or role that fits the job, and approve each publish, delete and schema change yourself.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It can delete drafts, release items and schema types
Discard, version-discard, schema type delete, undeploy and CORS delete tools remove real data or settings. Approve each call. sanity.io
It can publish and change live content
The publish tool makes content live, and the project tools create projects and datasets and switch datasets to public. Review each call before you accept it. sanity.io
No read-only mode is documented
Sanity lists no setting to turn off writes. If you use an API token, a token with a viewer role limits what the tools can do. sanity.io
Two tools use AI credits
The image generation and image transform tools use Sanity AI credits. You can turn them off in your client. sanity.io
Technical details
| Talks to | mcp.sanity.io (hosted by Sanity) |
|---|---|
| Sign-in and keys | OAuth by default, managed by your client. Sessions typically expire after 7 days. An API token can be set in an Authorization header instead. |
| Scopes |
|
Questions
Is the Sanity MCP server official?
Yes. Sanity runs it on its own servers, and Sanity's docs describe it as the Sanity MCP server.
What is the Sanity MCP server URL?
https://mcp.sanity.io. It uses streamable HTTP, and clients that cannot connect to a web address can use the mcp-remote bridge.
Do I need an API token?
No. It signs you in with OAuth by default. You can set an API token in an Authorization header instead, and then the tools are limited to that token's role.
What happened to the local @sanity/mcp-server?
Sanity archived it and says to use the hosted server instead. The hosted one is updated continuously and needs no Node.js.
Can it run read-only?
No setting for it is documented. It can create, edit, publish and delete content with your account's permissions.
Is there an easier way to set it up?
Yes. The Sanity command line has a configure command that detects editors such as Cursor, VS Code and Claude Code and sets them up. For Claude Code, Codex CLI, Cursor, OpenCode and VS Code it uses OAuth with no token.
Does it cost extra?
Most tools are normal API calls with no extra charge. Only the image generation and image transform tools use Sanity AI credits.
Can it publish content on its own?
Only if it calls the publish tool. Edits to documents are saved as drafts or release versions, and published content is not changed directly.
Information
updated Nov 2, 2026
- Publisher
- Official
- Transport
- Streamable HTTP
- Auth
- OAuth
- Last commit
- Feb 6, 2026
- Open issues
- 0
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 2Hide
- www.sanity.io · sanity.io
- github.com · github.com