Sanity MCP server

Connect Sanity to Claude, ChatGPT, Cursor, Claude Code, Codex, Gemini, GitHub Copilot and any other MCP client, for your whole team. Metorial adds security, governance, and tracing, and gives everyone one Magic MCP URL to connect.

What you can do with the Sanity MCP server

Ask your agent in plain language. Each of these maps to a real tool on the server.

  • Use the query documents tool in Sanity
  • Use the manage webhooks tool in Sanity
  • Use the list projects tool in Sanity
  • Use the mutate documents tool in Sanity
  • Use the upload asset tool in Sanity
  • Use the manage datasets tool in Sanity

Supported Tools

query_documents

Query Documents

Query a selected dataset with GROQ. Call list_projects and manage_datasets to discover scope. Results preserve the query shape; apply explicit GROQ ordering and slices to bound reads.

manage_webhooks

Manage Webhooks

List, read, create, or delete GROQ-powered document webhooks in an accessible project. Creating a hook can deliver content to its receiver when content changes. Deletion does not erase previously delivered events, queued attempts, or external records.

list_projects

List Projects

Discover accessible native project IDs and names, or read one project by projectId. Robot tokens are limited by their granted scope; no projects are inferred from token contents.

mutate_documents

Mutate Documents

Submit document mutations in one native transaction. Discover project/dataset first. Native receipts distinguish accepted operations and dry-run validation; deletion does not promise to erase transaction history, caches, backups, webhooks, or external effects.

upload_asset

Upload Asset

Upload bounded base64 image/file bytes into a selected dataset. Returns native assetId content hash and explicit documentId/_id for references and document operations. Identical bytes can reuse an existing asset, and CDN caches can persist after deletion.

manage_datasets

Manage Datasets

List datasets, read one dataset, create a dataset, or permanently delete a dataset. Call list_projects to select a project. Dataset deletion affects all content and does not promise removal from caches, history, backups, or external deliveries.

get_document

Get Document

Read exact current document IDs or one historical revision using current access permissions. Discover project and dataset with list_projects and manage_datasets.

download_asset

Download Asset

Prepare the original file or image from an exact Content Lake asset document. Use upload_asset documentId/_id or query_documents to discover asset documents. This excludes Media Library signed/container URLs and transformations.

get_current_user

Get Current User

Read the actual authenticated personal user profile. This endpoint requires a user session and is unavailable to robot tokens; project access does not imply user identity.

Connect Sanity to your AI client

Every client uses the same Magic MCP URL, and so does any other MCP client. Add it once and sign in with SSO.

  1. Enable Sanity in Metorial. In your Metorial portal, enable the Sanity MCP server and sign in with the account that owns the data. Access stays governed by your team policies.
  2. Add a custom connector. Open Customize, then Connectors. Select Add, then Custom, then Web.
  3. Paste your Metorial MCP URL. Name it Metorial, paste your Magic MCP URL (<your-magic-mcp-url>) and continue.
  4. Sign in. Select Add and sign in to load Sanity tools.

Run Sanity through the Metorial gateway

One governed layer for every app your agents reach, not a separate connector per tool.

  • Give Sanity and every other app to your whole team through one MCP gateway, behind your SSO.
  • Scope which teams and agents can use Sanity tools with role-based access control, and trace every call.
  • Prefer to run it yourself? Metorial is open source and self-hostable.

More integrations teams use with Sanity

Notion

Create, read, update, and archive pages and databases in a Notion workspace. Manage blocks (paragraphs, lists, headings, embeds, etc.) within pages. Query databases with filters and sorts across rich property types including text, numbers, dates, selects, relations, and formulas. Search across pages and databases by title. Add and read comments on pages and blocks. Upload files to pages. Manage workspace users and retrieve user profiles.

Google Sheets

Create, read, and update spreadsheets and their cell data. Read and write values to individual cells, ranges, or multiple ranges using A1 notation or named ranges. Apply cell formatting including text styles, backgrounds, borders, number formats, and conditional formatting. Manage sheets (tabs) within a spreadsheet—add, delete, copy, rename, and reorder them. Create and manage embedded charts, pivot tables, filter views, data validation rules, protected ranges, named ranges, and merged cells. Perform batch operations to apply multiple updates atomically.

GitHub

Manage repositories, issues, and pull requests. Create and configure branches, star repositories, review code, and merge changes. Automate CI/CD workflows with GitHub Actions, manage workflow runs, secrets, and artifacts. Track issues with labels, milestones, and assignees. Search across code, repositories, issues, and users. Manage organizations, teams, and memberships. Create and manage projects, gists, packages, deployments, and environments. Access security alerts including code scanning, secret scanning, and Dependabot alerts. Read and write file contents in repositories. Manage webhooks, notifications, and codespaces.

Salesforce

Manage CRM data including Accounts, Contacts, Leads, Opportunities, Cases, and custom objects. Create, read, update, and delete records. Query data using SOQL and search across objects using SOSL. Perform bulk data operations for large-scale imports, exports, and migrations. Execute composite requests to batch multiple operations in a single API call. Access analytics, reports, and dashboards. Manage files and attachments associated with records. Interact with Chatter feeds, posts, and groups for social collaboration. Manage org metadata including custom objects, fields, layouts, and workflows. Query data using GraphQL for precise data retrieval across related objects.

Sharepoint

Manage SharePoint sites, document libraries, lists, and files. Create, read, update, and delete lists and list items with custom columns. Resolve site users to numeric Person/Group LookupId values. Upload, download, move, copy, and version files in document libraries. Search across sites, files, folders, lists, and list items using Microsoft Search. Manage permissions at site, list, and item levels with granular access control. Define and manage content types and site columns. Retrieve site properties and search for sites across Microsoft 365.

Airtable

Create, read, update, and delete records in Airtable bases and tables. Manage base schemas including creating tables and fields. Filter records using formulas, sort by fields, and scope queries to specific views. Upsert records to find, create, or update in a single call. Upload attachments to records, read and write record comments, list accessible bases, and receive real-time base change events through webhooks.

Technical notes for Sanity

Query and mutate Content Lake documents, discover projects and datasets, read document revisions, manage datasets and document webhooks, upload assets, download original dataset files, and read personal user identity.

Frequently asked questions

Common questions about connecting Sanity to AI agents with Metorial.

  1. How many tools does the Sanity MCP server have?
    The Sanity MCP server exposes 9 tools, including Query Documents, Manage Webhooks, List Projects. Each one is governed and traced through Metorial.
  2. Sanity exposes tools your agents call on demand; it does not publish event triggers yet. Everything still runs through one governed MCP URL.
  3. Any MCP client, including VS Code, Windsurf, Zed, OpenCode and Grok. Each one reaches the Sanity MCP server through the same Metorial URL.
  4. Use role-based access control to decide which teams, users, and agents can use Sanity and which of its tools they can call.
  5. Yes. Metorial is open source, so you can run the Sanity MCP server yourself or use the hosted gateway.

Connect Sanity to production AI agents

See how Metorial gives your team governed access to Sanity, with tracing and security controls built in.