Sanity MCP Server
for AI Agents
Connect your AI agent to StackOne's Sanity MCP server and give it 33 MCP tools out of the box. Auth, tool execution, and security all managed.
Coverage
33 Agent Actions
Create, read, update, and delete across Sanity — and extend your agent's capabilities with custom actions.
Authentication
Agent Tool Authentication
Per-user OAuth in one call. Your Sanity MCP server gets session-scoped tokens with zero credentials stored on your infra.
Agent Auth →Security
Agent Protection
Every Sanity tool response scanned for prompt injection in milliseconds — 88.7% accuracy, all running on CPU.
Prompt Injection Defense →Performance
Max Agent Context. Min Cost.
Free up to 96% of your agent's context window to enhance reasoning and reduce cost, on every Sanity call.
Tools Discovery →What is the Sanity MCP Server?
A Sanity MCP server lets AI agents read and write Sanity data through the Model Context Protocol — Anthropic's open standard for connecting LLMs to external tools. StackOne's Sanity MCP server ships with 33 pre-built actions, fully extensible via the Connector Builder — plus managed authentication, prompt injection defense, observability, and agent execution runtime. Connect it from MCP clients like Claude Desktop, Claude Code, Cursor, Goose, and VS Code, or from agent frameworks like OpenAI Agents SDK, LangChain, and Vercel AI SDK.
All Sanity MCP Tools
Every action from Sanity's API, ready for your agent. Create, read, update, and delete — scoped to exactly what you need.
Documents
- Query Documents
Query documents with GROQ
- Get Document
Get a document by ID
Datasets
- Create Dataset
Create a dataset
- Copy Dataset
Copy a dataset
- Export Dataset
Export all documents in a dataset
- List Datasets
List datasets
- Update Dataset
Update a dataset
- Delete Dataset
Delete a dataset
Projects
- List Projects
List projects
- Get Project
Get a project by ID
Tags
- Create Tag
Create a project tag
- Update Tag
Update a project tag
- Delete Tag
Delete a project tag
Access Users
- List Access Users
List users and their roles
- Get Access User
Get a user and their roles
Permissions
- List Permissions
List available permissions
- Get Permission
Get a permission by name
Roles
- List Roles
List assignable roles
- Get Role
Get a role by name
Invites
- Create Invite
Invite a user to a resource
- List Invites
List invites for a resource
Other (12)
- Upload Image Asset
Upload an image asset
- Upload File Asset
Upload a file asset
- Get Document History
Get the revision history of a document
- List Dataset Copy Jobs
List dataset copy jobs
- List Dataset Tags
List tags assigned to a dataset
- List Access Requests
List access requests for the project
- Remove Tag From Dataset
Remove a tag from a dataset
- Mutate Documents
Create, update, patch or delete documents
- Link Media Library Asset
Link a Media Library asset into a dataset
- Assign Tag To Dataset
Assign a tag to a dataset
- Replace User Roles
Replace the set of roles assigned to a user
- Revoke Invite
Revoke an invite
Set Up Your Sanity MCP Server in Minutes
One endpoint. Any framework. Your agent is talking to Sanity in under 10 lines of code.
Agent Frameworks
{
"mcpServers": {
"stackone": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://api.stackone.com/mcp?x-account-id=<account_id>",
"--header",
"Authorization: Basic <YOUR_BASE64_TOKEN>"
]
}
}
}Check More Documents & Knowledge MCP Servers
134+ actions
101+ actions
96+ actions
95+ actions
92+ actions
80+ actions
80+ actions
Platform Resources
MCP Code Mode: Keeping Tool Responses Out of Agent Context
Anthropic's code_execution processes data already in context. Custom MCP code mode keeps raw tool responses in a sandbox. 14K tokens vs 500.
11 min
Comparing BM25, TF-IDF, and Hybrid Search for MCP Tool Discovery
Benchmarking BM25, TF-IDF, and hybrid search for MCP tool discovery across 916 tools. The 80/20 TF-IDF/BM25 hybrid hits 21% Top-1 accuracy in under 1ms.
10 min
Indirect Prompt Injection Defense for MCP Tools: A Technical Guide
MCP tools that read emails, CRM records, and tickets are indirect prompt injection vectors. Here's how we built a two-tier defense that scans tool results in ~11ms.
12 min
MCP vs A2A: Architecture, Security, and When to Use Each
MCP vs A2A: what each protocol standardizes, how they differ, their shared security risks including indirect prompt injection, and when to use one, both, or a hybrid architecture.
12 min
MCP vs API: What 200+ Connector Builds Taught Us
MCP wraps APIs, it doesn't replace them. After building 200+ connectors that serve both, here's when each approach wins.
14 min read
Sanity MCP Server FAQ
Does StackOne have a Sanity MCP server?
Sanity MCP server vs direct API integration — what's the difference?
How does Sanity authentication work for AI agents?
origin_owner_id.Are Sanity MCP tools vulnerable to prompt injection?
What is the context bloat of a Sanity agent and how do I avoid it?
Can I limit which actions my Sanity agent can access?
Can I create custom agent actions for my Sanity MCP server?
When should I NOT use a Sanity MCP server?
What AI frameworks and AI clients does the StackOne Sanity MCP server support?
Put your AI agents to work
All the tools you need to build and scale AI agent integrations, with best-in-class connectivity, execution, and security.