Skip to main content

The #1 agentic semantic tool search: 91.6% first-try accuracy on S1 Search Bench Explore Tool Discovery

Live 34 Actions

Sanity MCP Server
for AI Agents

Connect your AI agent to StackOne's Sanity MCP server and give it 34 MCP tools out of the box. Auth, tool execution, and security all managed.

Sanity logo
Sanity MCP Server
Built by StackOne StackOne
DrataGPLocalyzeFlipMindtoolsScreenloop

Coverage

34 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 34 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

  • Update Project

    Update a project

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

Claude Desktop
{
  "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

Sanity MCP Server FAQ

Does StackOne have a Sanity MCP server?
Yes. StackOne offers a hosted Sanity MCP server with 34 pre-built actions, and every action is tested and QA'd by StackOne. Connect it to Claude, Cursor, and any other MCP client, or to any agent framework through the AI Action SDK. It ships with managed agent authentication, prompt injection defense, and tool discovery with server-side execution that preserve your agent's context window and keep reasoning performance.
Sanity MCP server vs direct API integration — what's the difference?
A Sanity MCP server and direct API integration serve different use cases. Direct API integration is for software-to-software — backend code calling Sanity. A Sanity MCP server is for AI agents — MCP clients like Claude and Cursor, plus framework agents built with OpenAI, LangChain, or Vercel AI — discovering and calling Sanity at runtime. StackOne provides both.
How does Sanity authentication work for AI agents?
Sanity authentication for AI agents works through a StackOne Connect Session. Create one via the dashboard or the SDK — you get an auth link and ready-to-paste config for Claude Desktop, Cursor, and other MCP clients. Your user authenticates their own Sanity account; StackOne handles token exchange, storage, and refresh. Credentials never reach the LLM, and each user is isolated via origin_owner_id.
Are Sanity MCP tools vulnerable to prompt injection?
Yes — Sanity MCP tools can be vulnerable to indirect prompt injection. Any tool that reads user-written content — documents, messages, tickets, records, or free-text fields — is a potential vector. StackOne Defender scans every tool response before it enters the agent's context — regex patterns in ~1ms, then a MiniLM classifier in ~4ms. 88.7% accuracy, CPU-only.
What is the context bloat of a Sanity agent and how do I avoid it?
Context bloat happens when Sanity tool schemas and API responses eat your Sanity agent's memory, preventing it from reasoning effectively. A single Sanity query can return a massive JSON response, and connecting multiple tools compounds the problem. Tools Discovery and Code Mode reduce context bloat — loading only relevant tools per query and keeping raw responses out of the agent's context.
Can I limit which actions my Sanity agent can access?
Yes — you can limit which actions your Sanity agent can access directly from the StackOne dashboard. Toggle actions on or off, or restrict them to specific accounts, with no code changes to your agent. Session tokens can be scoped to exact actions so if one leaks, exposure stays contained.
Can I create custom agent actions for my Sanity MCP server?
Yes — you can create custom agent actions for your Sanity MCP server using Connector Builder. It's an integration agent your coding assistant (Claude Code, Cursor, or Copilot) can invoke to research Sanity's API, generate production-ready connector YAML, test against the live API, and validate before you ship.
When should I NOT use a Sanity MCP server?
Skip a Sanity MCP server if your integration is purely software-to-software — direct Sanity API integration is simpler when no AI agent is involved. For deterministic, compliance-critical operations (financial transactions, regulatory reporting), direct API gives you predictable behavior without agent-driven decision-making. MCP shines when AI agents need to dynamically discover and call Sanity actions at runtime.
What AI frameworks and AI clients does the StackOne Sanity MCP server support?
The StackOne Sanity MCP server supports both. MCP clients (paste-and-go apps): Claude Desktop, Claude Code, Cursor, VS Code, Goose. Agent frameworks (code SDKs you build with): OpenAI Agents SDK, Anthropic, Vercel AI, Google ADK, CrewAI, Pydantic AI, LangChain, LangGraph, Azure AI Foundry.

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.