Skip to content

Development integration

Sanity MCP server for Claude, Codex and Cursor

Query and edit structured content in Sanity. Connect the Sanity MCP server to Toolstile once, then choose which of its tools Claude Code, Codex, Cursor and Claude Desktop may use.

Free plan available. Server credentials stay in Toolstile, not in agent configs.

On this page

What your AI apps can do with Sanity

  • Query documents with GROQ
  • Create and update content

Sanity MCP tools

58 tools, taken from the publisher's documentation on 29 October 2026. The server decides what it offers and can add or rename tools at any time; after you connect, Toolstile shows the current list.

ToolWhat it does
dataset_assets_upload_from_web_chatgptUpload a ChatGPT web attachment or generated file to a dataset
dataset_assets_upload_from_urlStart an image or file upload from a public HTTPS URL to a dataset
media_library_upload_from_urlStart an image, video or file upload from a public HTTPS URL to a Media Library
media_assets_upload_from_urlDeprecated alias that does not start an upload; use media_library_upload_from_url
assets_upload_statusCheck the status of one to 20 asset uploads by operation ID
media_library_upload_from_filePrepare a one-use URL to upload a local or private file to a Media Library
dataset_assets_upload_from_filePrepare a one-use URL to upload an image or file up to 50 MiB to a dataset
get_schemaFetch the deployed schema for a project and dataset
list_workspace_schemasList every deployed schema for a project and dataset, grouped by source
deploy_schemaDeploy schema types directly to the cloud
undeploy_schemaRemove a legacy MCP-managed schema from a named workspace
schema_type_getRead one schema type and its current version before granular schema edits
schema_types_deleteRemove one or more types from the dataset schema
schema_fields_patchAdd, replace or remove top-level fields on a document or object type
deploy_studioDeploy a hosted Sanity Studio bound to an MCP-managed schema
create_documentsCreate one or more documents from structured content
create_versionCreate a version document for a specific release
patch_documentsUpdate existing documents with patch operations, up to 25 per call
query_documentsQuery documents using GROQ
generate_imageTrigger async AI image generation for a document field
transform_imageTrigger async AI transformation of an existing image
get_documentFetch a single document by its exact ID
documents_validateValidate documents against the deployed schema without changing them (beta)
publish_documentsPublish one or more drafts
unpublish_documentsUnpublish published documents, moving them back to drafts
discard_draftsDiscard draft documents while keeping published ones intact
version_discardDiscard one or more document versions from a release
list_organizationsList the organizations you can access
list_projectsList the Sanity projects on your account
get_project_studiosRetrieve the Studio applications linked to a project
create_projectCreate a new project with a dataset and API tokens
cors_origins_listList the CORS origins configured for a project
add_cors_originAdd CORS origins to a project
cors_origins_deleteDelete a CORS origin from a project
whoamiReturn the currently authenticated Sanity account
list_datasetsList the datasets in a project
create_datasetCreate a new dataset with a name and access settings
update_datasetUpdate a dataset's visibility and description
create_releaseCreate a release for grouping content changes, without scheduling it
list_releasesList releases in a dataset
list_embeddings_indicesList the embeddings indices for a dataset
semantic_searchRun a semantic search on an embeddings index
media_library_listList an organization's Media Libraries and their IDs
media_library_get_schemaGet a Media Library's document types or one type's fields
media_library_query_documentsRun GROQ queries against a Media Library
media_library_get_documentFetch one Media Library document by exact ID
media_library_create_documentsCreate Media Library documents (collections only)
media_library_patch_documentsMake limited safe edits to Media Library documents
media_library_publish_documentsValidate and publish Media Library asset drafts
media_library_discard_draftsDiscard unpublished Media Library asset metadata edits
media_library_list_asset_referencesFind project documents that reference a library asset
media_library_link_assetsReturn field values that link library assets into project documents
run_sanity_cliRun a limited set of Sanity CLI commands as a fallback
search_docsSearch the Sanity documentation
read_docsRead a specific Sanity documentation article
list_sanity_rulesList available Sanity best-practice development rules
get_sanity_rulesLoad specific Sanity best-practice rules
give_sanity_feedbackSend feedback about problems or gaps encountered using Sanity

Suggested access for each AI app

The documentation this list comes from doesn't mark Sanity's tools as read-only or destructive. Read each tool's description and decide per app before allowing it.

Coding agent in Claude Code or Cursor. Allow the read tools so the agent can look things up without stopping, and require approval for tools that change shared data.

Chat or research app in Claude Desktop. Allow reading and searching. Allow writes only where you want the app to act for you.

Unattended agent, such as a scheduled Codex job. No one is watching the session, so keep it narrow: allow what the job needs, require approval for changes and block the rest.

Blocked tools are removed from the tool list an app sees, so it won't try them. Because rules apply per app, the same Sanity connection can be broad in one app and read-only in another, and the credential stays in Toolstile instead of each app's config file.

How it works with Toolstile

  1. Connect once. Add Sanity to a workspace (browser sign-in). Toolstile keeps the credential, so no agent config holds it.
  2. Choose access per app. Give Claude Code every Sanity tool, give Cursor only the read tools, or keep Sanity away from an app entirely.
  3. Share approved accounts. Teammates use the connection without copying tokens, and you can remove access in one place.
  4. Review activity. See which app called which tool and when, so you can tighten access with evidence.

Add the Sanity MCP server to an AI app

Through Toolstile, every AI app uses one gateway entry, whichever servers you connect. In Claude Code:

Shell
claude mcp add --transport http toolstile 'https://mcp.toolstile.com/mcp'

Then connect Sanity in your workspace and choose which of its tools that app may use. Client setup covers Codex, Cursor and Claude Desktop.

To connect directly instead, add the Sanity endpoint to each app separately. In Claude Code:

Shell
claude mcp add --transport http sanity 'https://mcp.sanity.io'

In Cursor's mcp.json:

JSON
{
  "mcpServers": {
    "sanity": {
      "url": "https://mcp.sanity.io"
    }
  }
}

Some servers accept only clients they have approved, or need a token header. Check the Sanity MCP documentation for what your client needs.

Before you connect

A Sanity account. Sign-in uses your Sanity permissions.

Server details

DetailValue
PublisherSanity
Endpointhttps://mcp.sanity.io
AuthenticationBrowser sign-in
CategoriesDevelopment, Productivity
Tool list58 tools, observed 29 October 2026 (docs)

Sanity MCP documentation