Productivity & Projects · Developer Tools

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.

Tools

This is a reference catalogue. Tools cannot be configured or run from this page.

  • Assets upload status

    Check one to 20 asset uploads using operationIds. Wait at least pollAfterMs between checks and group running uploads in one call. Honor HTTP Retry-After when rate limited. A status lookup error does not mean the upload failed. Results include asset IDs, URLs, and references; set includeMetadata for full metadata. Results are available for up to 24 hours. If an upload outcome is unknown, check the destination before repeating it.

  • Cors origins list

    Lists all CORS origins configured for a Sanity project

  • Documents validate

    Validate documents against the deployed schema without modifying them. This tool is in beta. Results may be incorrect or incomplete; review them before making changes.

  • 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.

  • Get project studios

    Retrieves all studio applications linked to a specific Sanity project

  • 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.

  • Get schema

    Fetch the deployed schema for a project and dataset. Deprecated workspaceName and schemaId selectors remain temporarily available for legacy multi-schema datasets.

  • Get ui context

    Returns UI enrichment data for widgets. When documentId is provided, returns schema fields, deployed Studio URL, and resolved reference previews. When documentId is omitted, returns project-level context only (Studio URL).

  • List datasets

    Lists all datasets in your Sanity project

  • List embeddings indices

    List all available embeddings indices for a dataset

  • List organizations

    Lists all organizations the user has access to in Sanity

  • List projects

    Lists all Sanity projects associated with your account

  • List releases

    List releases in a dataset. By default returns active and scheduled releases. Use the state filter to find published or archived releases.

  • 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.

  • List workspace schemas

    Deprecation notice: list_workspace_schemas is deprecated. Use get_schema to inspect the authoritative schema for a dataset. This tool temporarily remains available to list every deployed schema for a project and dataset, grouped by source (MCP-managed, Studio-deployed, or legacy). Duplicate workspace names and multiple Studio applications are expected; each entry includes a schemaId for exact reads with get_schema.

  • Media assets upload from url

    Deprecated. Use media_library_upload_from_url with the same arguments. This tool does not start an upload.

  • Media library get document

    Fetch a single Media Library document by its exact ID. This is a direct ID lookup only - it does not search, filter, or query.

  • Media library get schema

    Get the document types of a Media Library, or the full field definitions for one type. Call this before querying or editing: the library schema is fixed (assets, collections, folders, aspects), and the organization's own asset aspects are merged onto `sanity.asset` under `aspects`.

  • Media library list

    Lists the Sanity Media Libraries in an organization. Call `list_organizations` first to get an organization ID. Returns library IDs to pass as `mediaLibraryId` to the other `media_library_*` tools.

  • Media library list asset references

    Lists documents (across project datasets) that reference a Media Library asset. Use this before replacing an asset to see what depends on it.

Page 1 / 2Next