Skip to content
← All MCP servers

Is the Sanity MCP server safe? What it can reach

What the Sanity MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.

Official serverChecked

Sanity hosts its own remote MCP server at mcp.sanity.io. It signs in with OAuth as you or with an API token, and tool calls are limited to that role. It can query and edit content, publish and unpublish documents, change schemas, deploy a studio and edit CORS origins. A token with a narrow role is the control that matters most.

Who maintains it

ImplementationKindStatus
Sanity MCP server (hosted by Sanity)Officialactive
@sanity/mcp-server (older local npm package)Officialdeprecated

It runs as a hosted remote server. The documented endpoint is https://mcp.sanity.io.

How it signs in

OAuth with your Sanity account, or an API token sent as a Bearer header. With a token the server does not use OAuth and calls are limited to the token’s role and permissions. A personal token shares your role and links you to changes in the revision history.

What its tools can do

KindTools
Readget_schema, list_workspace_schemas, schema_type_get, query_documents, get_document, documents_validate, assets_upload_status, list_releases, list_organizations, list_projects, get_project_studios, list_datasets, cors_origins_list, whoami, media_library_list, media_library_get_schema, media_library_query_documents, media_library_get_document, media_library_list_asset_references, list_embeddings_indices, semantic_search, usage_snapshot_get, usage_history_get, search_docs, read_docs, list_sanity_rules, get_sanity_rules
Writedataset_assets_upload_from_web_chatgpt, dataset_assets_upload_from_url, dataset_assets_upload_from_file, media_library_upload_from_url, media_library_upload_from_file, media_assets_upload_from_url, schema_fields_patch, create_documents, create_version, patch_documents, generate_image, transform_image, create_release, create_project, create_dataset, media_library_create_documents, media_library_patch_documents, media_library_link_assets, run_sanity_cli, give_sanity_feedback
Can’t be undonedeploy_schema, undeploy_schema, schema_types_delete, deploy_studio, publish_documents, unpublish_documents, discard_drafts, version_discard, add_cors_origin, cors_origins_delete, media_library_publish_documents, media_library_discard_drafts, update_dataset

Sanity says the available tools vary as it releases updates, so check the live tools list. run_sanity_cli runs a limited subset of CLI commands and the docs do not list them. generate_image and transform_image use AI credits. update_dataset can make a dataset public, so it is listed as destructive. dataset_assets_upload_from_web_chatgpt and list_workspace_schemas are marked deprecated in the docs.

Built-in limits

OptionWhat it does
API token roleSet an Authorization Bearer header with a token. Tool calls are limited to that token’s role and permissions. The docs do not say whether a read-only role exists.
Disable AI image toolsThe docs say you can disable generate_image and transform_image in your client to avoid spending AI credits.
Account permissionsWith OAuth, access matches your account’s permissions on each project and dataset.

The risks

  • An injected instruction in a content field the agent reads could make it call publish_documents or unpublish_documents and change what your live site shows.
  • deploy_studio, deploy_schema and undeploy_schema change production infrastructure, and schema_types_delete removes schema types.
  • add_cors_origin and cors_origins_delete change which websites can call your project’s API.
  • create_project creates a new project with a dataset and API tokens, and the image tools use AI credits. OAuth sessions act with your account’s permissions and typically expire after 7 days.

Limit it in Claude Code

Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:

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

Claude Code names MCP tools mcp__sanity__<tool>. Deny rules win over ask rules, and ask rules over allow rules. Put these in ~/.claude/settings.json or the project’s .claude/settings.json:

{
  "permissions": {
    "deny": [
      "mcp__sanity__undeploy_schema",
      "mcp__sanity__schema_types_delete",
      "mcp__sanity__deploy_studio",
      "mcp__sanity__cors_origins_delete",
      "mcp__sanity__add_cors_origin",
      "mcp__sanity__unpublish_documents",
      "mcp__sanity__create_project"
    ],
    "ask": [
      "mcp__sanity__publish_documents",
      "mcp__sanity__deploy_schema",
      "mcp__sanity__discard_drafts",
      "mcp__sanity__version_discard",
      "mcp__sanity__media_library_publish_documents",
      "mcp__sanity__media_library_discard_drafts",
      "mcp__sanity__create_documents",
      "mcp__sanity__patch_documents",
      "mcp__sanity__update_dataset",
      "mcp__sanity__create_dataset",
      "mcp__sanity__run_sanity_cli",
      "mcp__sanity__generate_image",
      "mcp__sanity__transform_image"
    ]
  }
}

Limit it in Codex

Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:

[mcp_servers.sanity]
url = "https://mcp.sanity.io"
disabled_tools = ["undeploy_schema", "schema_types_delete", "deploy_studio", "cors_origins_delete", "add_cors_origin", "unpublish_documents", "create_project"]

Checklist

  • Use a token with the narrowest role that covers your task.
  • Deny the schema, studio and CORS change tools.
  • Keep approval on for publishing and for create_documents and patch_documents.
  • Point the agent at a test dataset first.
  • Revoke the token in sanity.io/manage when you finish.

Checked against the vendor documentation on November 25, 2026. Sanity docs: MCP server · Sanity changelog: remote MCP server GA · @sanity/mcp-server on npm (deprecated)

What Excellent covers

Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing