Sanity MCP

Query, create, patch and publish Sanity content, manage schemas, releases, datasets, projects, CORS origins and Media Library assets through Sanity's hosted MCP server.

61 actionsAPI key

Connect Sanity MCP

What your agent can do in Sanity MCP

Looks up

  • Assets upload statusCheck one to 20 asset uploads using operationIds.
  • Cors origins listLists all CORS origins configured for a Sanity project
  • Documents validateValidate documents against the deployed schema without modifying them.
  • Get documentFetch a single document by its exact ID.
  • Get project studiosRetrieves all studio applications linked to a specific Sanity project
  • Get sanity rulesLoad Sanity development rules.
  • Get schemaFetch the deployed schema for a project and dataset.
  • Get ui contextReturns UI enrichment data for widgets.
  • List datasetsLists all datasets in your Sanity project
  • List embeddings indicesList all available embeddings indices for a dataset
Show 19 more
  • List organizationsLists all organizations the user has access to in Sanity
  • List projectsLists all Sanity projects associated with your account
  • List releasesList releases in a dataset.
  • List sanity rulesIMPORTANT.
  • List workspace schemasDeprecation notice.
  • Media assets upload from urlDeprecated.
  • Media library get documentFetch a single Media Library document by its exact ID.
  • Media library get schemaGet the document types of a Media Library, or the full field definitions for one type.
  • Media library listLists the Sanity Media Libraries in an organization.
  • Media library list asset referencesLists documents (across project datasets) that reference a Media Library asset.
  • Media library query documentsQuery a Media Library using GROQ.
  • Query documentsQuery documents from Sanity using GROQ.
  • Read docsRead a specific Sanity documentation article
  • Schema type getRead one type from the current MCP-managed or Studio-deployed schema before calling a granular schema edit tool.
  • Search docsSearch Sanity docs
  • Semantic searchPerform a semantic search on an embeddings index
  • Usage history getGet metered usage for a project, organization or media library as a series of daily, monthly or yearly data points.
  • Usage snapshot getGet metered usage totals, such as API requests, CDN requests, documents and assets, for a project, organization or media library over one…
  • WhoamiReturns the currently authenticated Sanity account.

Takes action

  • Add cors originAdds CORS origin(s) to allow client-side requests to a Sanity project
  • Cors origins deleteDeletes a CORS origin from a Sanity project
  • Create datasetCreates a new dataset with specified name and access settings
  • Create documentsCreate one or more documents by directly providing structured content.
  • Create projectCreates a new Sanity project and initializes it with a dataset and API tokens
  • Create releaseCreate a new release for grouping content changes.
  • Create versionCreate a version document (versions.{releaseId}.* prefix) for a specific release.
  • Dataset assets upload from filePrepare a one-use URL for uploading an image or file up to 50 MiB to a Content Lake dataset.
  • Dataset assets upload from urlStart an image or file upload from a public HTTPS URL to a Content Lake dataset.
  • Dataset assets upload from web chatgptUpload a ChatGPT web attachment or generated file to a Content Lake dataset.
Show 22 more
  • Deploy schemaOnly use deploy_schema when no local Sanity Studio project exists.
  • Deploy studioDeploy a managed Sanity Studio bound to an MCP-managed schema.
  • Discard draftsDiscard one or more draft documents.
  • Generate imageGenerate a new image in a document using AI.
  • Give sanity feedbackSubmit feedback about Sanity when you encounter issues while working with a Sanity codebase or project.
  • Media library create documentsCreate documents in a Media Library.
  • Media library discard draftsDiscard asset drafts, throwing away unpublished metadata edits and leaving the published asset intact.
  • Media library link assetsMake one or more Media Library assets usable in project documents.
  • Media library patch documentsEdit Media Library documents.
  • Media library publish documentsPublish asset drafts to make unpublished metadata edits (title, aspects.*) live, preserving published-only and system-managed fields.
  • Media library upload from filePrepare a one-use URL to upload a local or private image, video, or file up to 50 MiB to a Media Library, or add a version to an existing…
  • Media library upload from urlStart an image, video, or file upload from a public HTTPS URL to a Media Library.
  • Patch documentsUpdate existing documents with @sanity/client patch() operations.
  • Publish documentsPublish one or more drafts.
  • Run sanity cliRun a limited subset of Sanity CLI commands and return their output.
  • Schema fields patchAdd, replace, or remove top-level fields on one document or object type.
  • Schema types deleteRemove one or more types from the dataset schema.
  • Transform imageTransform an existing image in a document using AI.
  • Undeploy schemaRemove a legacy MCP-managed schema from an explicitly named workspace.
  • Unpublish documentsUnpublish one or more published documents (moves them back to drafts), or provide releaseId to mark them for unpublishing when that…
  • Update datasetUpdate an existing dataset's visibility (public or private) and description.
  • Version discardDiscard one or more document versions from a release

More developer apps