Sanity MCP. Query, edit, and manage your entire Content Lake via chat.
Works with every AI agent you already use
…and any MCP-compatible client
Just plug in your AI agents and start using Vinkius.
Sanity MCP Server connects your AI agent directly to your Content Lake. Use it to manage content—not just read it—.
You can execute raw GROQ queries, create or update documents by type, delete assets, and run complex mutations without touching the Sanity UI.
It turns your chatbot into a full-stack CMS power user.
What your AI agents can do
Count entity nodes
Counts how many documents exist for a specific type in your CMS.
Create cms document
Builds and inserts a brand new document into the Content Management System (CMS).
Get document details
Retrieves all field data for a single document using its unique ID.
Run GROQ queries to fetch specific documents and data sets from your CMS.
Create, read, update fields on, or delete entire content documents based on their schema type.
List all unique document types and count the number of records for specific schemas to audit your data model.
Browse, list, and manage uploaded images and file assets stored in Sanity.
Perform complex data changes using raw mutations or mass updates across multiple records.
Ask AI about this MCP
Supported MCP Clients
Waiting for input…
Sanity MCP Server: 10 Tools for Content Management
These tools give your AI client direct command-line access to every core function of the Sanity Content Lake, from querying data to running raw mutations.
019d7603count entity nodes
Counts how many documents exist for a specific type in your CMS.
019d7603create cms document
Builds and inserts a brand new document into the Content Management System (CMS).
019d7603get document details
Retrieves all field data for a single document using its unique ID.
019d7603list media assets
Pulls an inventory of every image and file asset uploaded to your Sanity project.
019d7603list typed documents
Lists all existing document types (like 'post' or 'author') currently defined in the CMS.
019d7603list unique schema types
Gets a definitive list of every unique data schema type present in your dataset.
019d7603patch cms document
Updates specific fields on an existing document without affecting other parts of the record.
019d7603run groq query
Executes a complex Graph-Relational Object Query (GROQ) to filter and fetch content across multiple records.
019d7603run raw mutation
Runs raw Sanity mutations, allowing for highly complex, low-level data transactions in bulk.
019d7603wipe cms document
Permanently deletes a document from the CMS. This action cannot be undone.
Choose How to Get Started
Build a custom MCP for your own tools, or connect a ready-made integration from our catalog.
Build Your Own
Turn any API into an MCP. Import a spec, define Agent Skills, or deploy with MCPFusion.
- Import from OpenAPI, Swagger, or YAML specs
- Create Agent Skills with progressive disclosure
- Deploy to edge with MCPFusion framework
- Built in DLP, auth, and compliance on every call
- Real time usage dashboard and cost metering
- Publish to catalog or keep private
Make Your AI Do More
Start with Sanity, then connect any of our 4,700+ other servers whenever your AI needs more. One click, no limits.
- Use this MCP plus 4,700+ others, all in one place
- Add new capabilities to your AI anytime you want
- Every connection is secured and compliant automatically
- Track usage and costs across all your servers
- Works with Claude, ChatGPT, Cursor, and more
- New servers added to the catalog every week
What you can do with this MCP connector
You connect your AI agent directly to your Content Lake using this server, and you're gonna have total control over your content backend. Stop copy-pasting IDs or wrestling with APIs in a bunch of separate terminal windows. This whole setup exposes every core function of the Sanity Content Lake as tools, letting your agent talk right to your data.
Querying Your Data Set
Need specific information? You run complex Graph-Relational Object Queries (GROQ) using run_groq_query. This lets you filter and fetch content across multiple records based on criteria like date ranges or required field values. If a simple lookup won't cut it, this tool gives your agent the power to pull exactly what you need from deep within your CMS.
Reading Documents
When you know a document's ID, you retrieve all of its stored data using get_document_details. This fetches every field value for a single record. If you just wanna list everything available in the system, you can use list_unique_schema_types to get every unique data schema type defined. You can also run list_typed_documents to see all existing document types—like 'post' or 'author'—that your CMS knows about.
Managing Documents and Assets
You build content with the create_cms_document tool, which builds and inserts a brand new document into your Content Management System. To change an existing record without messing up everything else, you use patch_cms_document, letting your agent update only specific fields on a document. For deletions, you permanently remove a file using wipe_cms_document; remember, that action can't be undone.
Beyond the text, you manage all your files with list_media_assets. This tool pulls an inventory of every single image and file asset uploaded to your Sanity project. If you need to know how big your data set is for a specific type, use count_entity_nodes to count exactly how many documents exist for that schema.
Raw Power Moves and Schema Auditing
Sometimes the high-level tools aren't enough. For complex, multi-step data transactions or bulk updates across multiple records, you run raw mutations using run_raw_mutation. This tool handles highly technical, low-level data changes. If you want a definitive list of every single schema type present in your dataset—for auditing purposes—you use list_unique_schema_types.
This setup turns your agent into a full-stack CMS power user. You're not just reading content; you're building, managing, and restructuring the entire data lake without ever opening the Sanity UI.
How Sanity MCP Works
- 1 Subscribe to the server and provide your Sanity Project ID, Dataset name, API Version, and API Token.
- 2 Connect your preferred AI client (Claude, Cursor, etc.) to the MCP endpoint. Your agent now sees all 10 specialized tools.
- 3 Ask your agent a question like 'Find me all published author profiles' or 'Patch post ABC with new SEO data.' The agent selects and runs the correct tool.
The bottom line is, you configure it once, and your AI client gains API access to every function of your CMS automatically.
Who Is Sanity MCP For?
This is for developers and content managers who are tired of context switching. If you spend time jumping between the Sanity Studio UI, a GraphQL explorer, and a terminal just to run a simple data check or update a field—you need this. It puts your whole Content Lake behind a single conversational interface.
Needs to quickly prototype content displays by running run_groq_query against specific schemas before building the final component.
Wants to bulk edit fields or update taxonomy across multiple drafts without leaving their chat interface. Use patch_cms_document for quick updates.
Needs an audit tool. They run list_unique_schema_types and count_entity_nodes to validate that a new deployment hasn't broken the data model, all from one chat window.
What Changes When You Connect
- Stop manual data querying. Instead of building complex API calls or relying on a visual query builder, you just ask the agent to run
run_groq_query. It fetches exactly the content you need, right in the conversation flow. Right? - No more context switching for updates. Need to change three fields across 20 posts? Instead of opening 20 documents and clicking save repeatedly, use
patch_cms_documentwith a single command. Done. - Full schema governance from chat. You don't have to guess what data types exist. Use
list_unique_schema_typesfirst; then you can reliably ask the agent to run queries or create documents for those specific types, like 'post'. - Audit your content structure easily. Want to know if a certain type of document has been forgotten? Run
count_entity_nodes. It gives you immediate metrics on how many records exist for that schema. Super fast. - Handle media assets natively. Listing images or files used across the site is simple. The agent runs
list_media_assets, giving you an inventory without needing to navigate the Media Library UI.
Real-World Use Cases
The Missing Data Audit
A DevOps engineer needs to check if all product pages have a corresponding author profile. Instead of writing complex joins, they ask their agent to run run_groq_query specifically targeting the 'product' type and filtering by null fields in the 'author' reference. The query returns the exact list of missing links.
The Urgent Content Update
A marketing manager needs to change a single field (like the CTA button text) on 50 draft blog posts simultaneously. They use patch_cms_document with a structured JSON payload, targeting all five drafts by ID list. The agent handles the bulk update and confirms success.
The Initial Schema Deep Dive
A new developer joins the project and needs to understand the content structure immediately. They simply prompt the agent: 'List every document type.' The agent runs list_unique_schema_types and provides a clean, categorized list of everything they're working with.
The Cleanup Operation
A team member accidentally created a test document that must be permanently removed. Instead of searching for it manually or using the web UI, they instruct the agent to use wipe_cms_document on the specific ID. The action is immediate and irreversible.
The Tradeoffs
Blindly running raw mutations
The developer just hits 'run mutation' with a massive JSON object they wrote by hand, without first checking the required schema types or validating field names. This usually results in an obscure API error and hours of debugging.
→
First, run list_unique_schema_types to confirm the target type exists. Then, use patch_cms_document for specific, controlled updates, ensuring your agent handles the validation layer before execution.
Over-relying on UI copy/paste
The editor manually copies a complex GROQ query from documentation into their terminal and has to fix syntax errors or figure out which dataset it belongs to. Time wasted, right?
→
Just tell the agent: 'Find me all authors who wrote posts tagged with X.' The agent constructs and runs the correct run_groq_query internally for you.
Assuming data structure is stable
A developer assumes a field like 'publishDate' always exists, but another team changed it to 'datePublished'. Their query fails silently or returns garbage.
→
Always audit the schema first. Use list_unique_schema_types and then run get_document_details on an example document to confirm all required field names before writing any code.
When It Fits, When It Doesn't
Use this server if your core problem is manipulating structured, semi-headless content data. If you need to read records (GROQ queries), write records (create/patch documents), or audit the schema itself (list_unique_schema_types), then yes, use it. This handles the entire lifecycle of a CMS record.
Don't use this if your problem is displaying content—that happens client-side after you get the data. Also, don't use it if you only need to manage media files; while list_media_assets helps, dedicated asset management tools are better for actual manipulation (like resizing). If you are dealing with a totally different database type—say, Postgres or Redis—this isn't your server. This is strictly for the Sanity Content Lake model, right?
Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Sanity. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
VINKIUS INFRASTRUCTURE
Cloud Hosted
Managed infra
V8 Isolated
Sandboxed per request
Zero-Trust Proxy
No stored credentials
DLP Enforced
Policy on every call
GDPR Compliant
EU data residency
Token Compression
~60% cost reduction
Works with Claude, ChatGPT, Cursor, and more
The Model Context Protocol standardizes how applications expose capabilities to LLMs. Instead of operating in isolation, your AI gains direct access to external platforms, live data, and real-world actions through secure, standardized connections.
This server provides 10 capabilities that interface natively with Claude, ChatGPT, Cursor, and any MCP client. No middleware. No custom integration required.
Available Capabilities
Content data shouldn't require jumping between five different developer tools.
Today, updating a simple field means logging into the CMS Studio, finding the document ID, clicking through multiple panels to confirm the change, and then hitting save. If you have 30 documents that need this tweak? You do it 30 times.
With Sanity MCP Server, you just tell your agent: 'Update all posts with type 'blog' and set the featured image field to asset X.' The server runs `patch_cms_document` in the background. It handles the IDs, the structure, and the updates—you get confirmation, period.
Sanity MCP Server: Full Control Over Your Content Lake
The biggest time sink is figuring out *what* data exists. You waste cycles running ad-hoc queries just to see what schemas are available or how many records you even have. It's guesswork.
This server eliminates that guessing game. By exposing `list_unique_schema_types` and `count_entity_nodes`, your agent instantly tells you the map of your data model, letting you build queries with precision from the first prompt.
Common Questions About Sanity MCP
Can I use run_groq_query to find documents across multiple types? +
Yes. run_groq_query handles cross-type lookups using GROQ syntax, letting you query relationships between schemas like 'post' and 'author'. It’s how you build complex data views.
Is run_raw_mutation the only way to do bulk updates? +
No. While run_raw_mutation is available for maximum power, use patch_cms_document first. It's safer because it forces you to define exactly which fields are changing on existing records.
How do I know if a document type exists before trying to create one? +
Run list_unique_schema_types. This confirms the available types in your dataset. If it's not listed, you probably need to define that schema first.
Can I list all assets using list_media_assets? +
Yes. list_media_assets provides a complete inventory of every image and file attached to your project, which is useful for cleanups or audits.
If I run `get_document_details` for an ID that doesn't exist, how does the server handle the error? +
It returns a clear 404 status code and specific error message. The agent won't crash; it just tells you exactly which document ID failed to load. This lets your workflow proceed without interruption.
Can I use `run_groq_query` to follow content references between different schema types? +
Yes, GROQ handles deep linking across schemas. You can write queries that traverse through component relationships and reference fields, gathering related data points in one call.
Is `wipe_cms_document` truly irreversible, and what safeguards are there? +
Yes, this action is permanent; the document is gone. You'll need to confirm execution explicitly with your agent client before running it. Treat this tool like a trash bin—you can’t get the files back.
When I use `patch_cms_document`, what happens if I try to set a field that doesn't exist on the document's schema? +
It will throw a validation error. The tool requires the target field to be defined in the existing schema for the specified document type. It won't guess or create new fields.
Can my AI agent write complex GROQ queries for me? +
Yes. If you know what data you want but aren't totally familiar with GROQ syntax, you can simply ask your agent: 'Write and execute a GROQ query to find all author documents where the name starts with John and return just their ID and bio.' The agent will draft the query, execute it via the run_groq_query tool, and return the filtered JSON.
How do I perform a bulk update on my documents? +
You can ask your agent to first fetch the documents (e.g., 'List all posts missing a category'), calculate the changes needed, and then use the run_raw_mutation tool or patch_cms_document iteratively to apply the updates. This acts as a conversational migration script, updating dozens of documents safely and quickly.
Can the agent check if media assets are missing from my posts? +
Yes. The agent can use the document querying tools combined with list_media_assets to analyze your content. For instance, you can ask it to generate a report of all products that do not have an associated image reference, giving you an exact list of items to fix in the Studio.
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
More in this category
Semgrep
Equip your AI agent with read/write access to Semgrep's SAST platform to audit code security findings, update triage statuses, and enforce custom semantic rules.
CData Connect Cloud
Universal Data Gateway mapping explicitly proxy structures parsing SQL schemas dynamically connecting APIs natively.
Unkey API Management
Manage and verify your user API keys via Unkey — create, revoke, and track usage directly from any AI agent.
You might also like
Uniqode
Create trackable QR codes with custom branding, dynamic content updates, and scan analytics for marketing and operations.
Fortnite Player Stats & News Intelligence
The definitive server for Fortnite player scouting — track wins, K/D ratios, and official game news via AI.
ReciPal
Manage food recipes — audit ingredients and nutrition via AI.