Sanity MCP Server – Content and Schema Tools
Sanity's official hosted MCP server gives AI assistants structured access to Sanity projects, schemas, datasets, documents, releases, and development tools. Use it to query content, manage approved editorial operations, inspect schemas, and assist with migrations and project configuration.
Overview
Sanity's official MCP server connects compatible AI assistants directly to
Sanity projects. It provides schema-aware tools for content and development
workflows, allowing agents to operate with live project context instead of
relying only on copied documents, local schema files, or static model knowledge.
What the MCP server enables
The hosted server exposes editorial and development-focused tools. Depending on
the authenticated user's role or API-token permissions, an AI agent can:
- Inspect deployed schemas and retrieve detailed field and reference metadata.
- Run GROQ queries against authorized datasets.
- Create, retrieve, patch, and manage supported documents.
- Work with releases and migration-related workflows.
- Assist with schema changes, localization, and content-model migrations.
- Manage selected project resources such as datasets and API keys where allowed.
- Retrieve current Sanity guidance and agent rules for supported workflows.
- Use pagination and token-aware responses for large result sets.
When to use it
Use Sanity MCP when an AI workflow needs current project context or must perform
an authorized content or schema operation. Typical examples include querying
articles, inspecting references, patching content, listing releases, adding
localization, migrating documents to a new schema shape, creating datasets,
and helping an agent build or maintain a Sanity-backed application.
Connection and authentication
Sanity hosts the managed server at https://mcp.sanity.io. It supports remote
HTTP connections and works with MCP-compatible clients. OAuth is the default
authentication method and links changes to the signed-in Sanity user.
API token authentication is also supported by sending
Authorization: Bearer <token>. Token-authenticated tool calls are limited by
the token's role and permissions. Clients that cannot connect directly to a
remote MCP server can use the documented mcp-remote stdio bridge.
Key considerations
Access follows the authenticated user's role or the configured API token's
permissions. Use OAuth for user-attributed changes and scoped API tokens when a
narrower permission boundary is required. Review document mutations, release
actions, dataset changes, API-key operations, and migrations before approval.
Keep tokens outside source control, rotate unused credentials, and confirm that
deployed schemas are current before relying on schema-aware tools. Sanity also
offers a separate read-only Sanity Context MCP server for production agents
that only need filtered dataset access.
Supported Transports
streamable_http
URL: https://mcp.sanity.io
stdio
Command: npx
Args:
mcp-remotehttps://mcp.sanity.io--transporthttp-only
Frequently Asked Questions
- When should an AI agent use the Sanity MCP server?
- Use it when a workflow needs live Sanity project context or authorized operations, such as inspecting schemas, running GROQ queries, managing documents and releases, assisting with migrations, or configuring supported project resources.
- What does the Sanity MCP server add to an AI agent's capabilities?
- It gives the agent structured, schema-aware access to current Sanity projects and content tools, allowing it to query, inspect, and perform permitted operations instead of relying only on static model knowledge or manually supplied schema and document data.
- What can an AI agent access or manage through Sanity MCP?
- Depending on permissions, the agent can inspect schemas, run GROQ queries, work with documents and releases, assist with schema and content migrations, and manage selected project resources such as datasets and API keys.
- How is authentication configured for the Sanity MCP server?
- OAuth is the default and recommended method and attributes changes to the signed-in Sanity user. API token authentication is also supported through the Authorization header with the Bearer scheme, with access limited by the token's role and permissions.
- Which transport should be used for the Sanity MCP server?
- Use remote HTTP with https://mcp.sanity.io for modern MCP clients. Use the documented mcp-remote stdio bridge only when the client cannot connect directly to a remote MCP server.