developer-toolsapi_key

Sanity

Sanity is a headless CMS platform that provides structured content storage and APIs for modern applications

Verdict

Sanity is a headless CMS that stores structured content as JSON documents. This MCP exposes 16 tools for managing users, roles, permissions, and custom attributes inside your Sanity organization. Teams use it to automate onboarding (bulk-assign roles, define custom user attributes), audit access (query who has which permissions on which projects), and prototype content workflows (send prompts to Sanity's Content Agent). Most valuable for engineering teams managing multi-project Sanity setups or product teams building content tools on top of Sanity's API. Requires a Sanity API token with admin scope — the MCP cannot read or write your actual content documents, only organization-level config.

Common use cases

  • Bulk-assign default roles to new users
  • Audit who has admin access across projects
  • Define custom user attributes for access tiers
  • Retrieve invite status by token
  • Prototype content workflows with AI prompts

Integration

Vendor
Sanity
Category
developer-tools
Auth
API_KEY
Tools
16
Composio slug
sanity

Tools

  • Add Default Role to Users

    Apply organization default role to all users. Use when you need to assign the organization's default role to all existing users in the organization. Requires the resource ID of the organization.

  • Create Attribute Definition

    Tool to create a new user attribute definition in Sanity. Use when you need to define a custom attribute (like 'customer-tier' or 'subscription-level') that can be attached to resources. The key must be unique within the resource. The attri

  • Create Prompt Post

    Send a one-shot prompt to the Sanity Content Agent. Stateless one-shot prompt endpoint. No thread management or message persistence. Ideal for simple, single-turn interactions. Use when you need to send a single prompt and receive a respons

  • Delete User Attribute Definition
    destructive

    Delete a user attribute definition. Use when you need to remove a custom attribute definition from an organization or project in Sanity. The attribute definition controls how user attributes are structured and validated for a given resource

  • Delete User Attributes
    destructive

    Delete custom attributes from a Sanity user within an organization. Use this tool when you need to remove specific custom attributes from a user account. The action deletes the attributes specified in the request and returns the updated att

  • Get Invite By Token

    Retrieve an invite by its public token. Use this action when you need to fetch details about an invite using the invite token that was shared with the invitee. Returns invite information including status, role, and inviter details.

  • Get Organization Role

    Retrieve a specific organization role by its ID. Use this action when you need to fetch details about an organization role including its permissions, title, description, and whether it applies to users or robots. The role must exist for the

  • Get Permission

    Get a permission for a specific resource. Use when you need to retrieve details about a particular permission including its actions, parameters, and scope. The action retrieves permission information based on the resource type, resource ID,

  • Get Robots

    Tool to get robots with access to a resource. Use when you need to retrieve a list of robots (service accounts) that have been granted access to a specific resource along with their assigned roles. This action supports pagination through th

  • Get Role

    Retrieve a specific role for a given resource type and resource ID. Use this action when you need to fetch details about a role including its permissions, title, description, and whether it applies to users or robots. The role must exist fo

  • List Organization Roles

    List all roles available for an organization. Use this action to retrieve all available roles that can be assigned to users within a specific Sanity organization. The organization_id is required to identify which organization's roles to lis

  • List Resource Users

    List all users of a resource and their assigned roles. Use when you need to retrieve user information and role assignments for a specific project or organization. Supports pagination via cursor.

  • List User Attributes

    Tool to retrieve user attributes from a Sanity organization. Use when you need to get the attributes (such as roles, permissions, or custom properties) associated with a specific user in a Sanity organization. Supports pagination via the cu

  • Query All Screening

    Execute a GROQ query to fetch all screening documents from Sanity. Uses the Sanity HTTP query API endpoint. Default query retrieves all documents of type 'screening'. Supports optional query parameters for dynamic queries.

  • Update Organization ACL

    Tool to assign a role to a member in a Sanity organization. Use when adding or modifying user roles within an organization.

  • Update User Attributes Values

    Update user attribute values for a resource. Use this action to set or update custom attributes for a user within an organization or project. When setting a value for an attribute key that also exists in SAML, the Sanity value will take pre

Setup

Setup guide

  1. 11. In Switchy, open your workspace settings and click 'Add Integration' under the MCP section. 2. Select 'Sanity' from the developer tools category. 3. Open your Sanity project dashboard at sanity.io/manage, navigate to API settings, and generate a new token with 'Admin' scope (you'll need organization owner permissions to create this token). 4. Copy the token and paste it into the API Key field in Switchy, then click 'Connect'. 5. Switchy will validate the token and list the 16 available tools. 6. Open any Space, type '@Sanity get organization role' followed by a role ID from your Sanity org, and send the message. 7. If the MCP returns role details (title, permissions, scope), the connection works. 8. To invoke other tools, @mention Sanity in any Space and describe the task — the AI will map your request to the appropriate tool and prompt you for required parameters like organization ID or attribute keys.

What teammates see: by default, memories from Sanity are scoped to the Space (PROJECT visibility) - you can mark any memory PRIVATE or share it ORG-wide.

Works well with

Top models

Compatibility data appears once enough Spaces have used this MCP together with a given model.

How Switchy teams use it

Not enough Spaces yet to publish anonymised usage stats (we require ≥ 50 Spaces per week).

Starter prompts

Assign Default Roles

@Sanity add the default role to all users in organization org_abc123. Confirm the count of users updated.
Open in a Space →

Create Custom Attribute

@Sanity create a user attribute definition with key 'support-tier' and type 'string' in organization org_abc123. Make it optional.
Open in a Space →

Audit Role Permissions

@Sanity get the organization role with ID role_xyz789. Show me its title, permissions, and scope.
Open in a Space →

Check Invite Status

@Sanity retrieve the invite using token inv_token456. Tell me its status and who it was sent to.
Open in a Space →

Prototype Content Workflow

@Sanity send this prompt to the Content Agent: 'Generate three blog post titles about sustainable packaging for e-commerce brands.'
Open in a Space →

Example outputs

Illustrative - representative of the model's voice and quality, not literal recordings.

Prompt

@sanity list all custom attribute definitions in our organization and show which ones are currently in use by team members

Output

Here are the custom attribute definitions in your Sanity organization: **Active Definitions:** - `customer-tier` (string) — Used by 12 users. Values: 'enterprise', 'pro', 'starter' - `content-specialty` (array) — Used by 8 users. Common values: 'editorial', 'design', 'technical' - `region` (string) — Used by 15 users. Values: 'EMEA', 'APAC', 'Americas' **Unused Definitions:** - `beta-access` (boolean) — Created 3 months ago, no users assigned This is an illustrative example showing how attribute definitions structure your team metadata. Actual values depend on your organization's configuration.

Notes

This example demonstrates Sanity's user attribute system for organizing team members by custom properties. Requires organization-level API key with read permissions. Useful for auditing metadata schemas before creating new attributes or cleaning up unused ones. The MCP can read definitions but won't show historical usage patterns.

Prompt

@sanity create a new attribute definition called 'project-lead' as a boolean type, then assign it to all users with the 'editor' role

Output

I've completed both actions: **Step 1: Attribute Created** Created attribute definition `project-lead` (boolean type) in your organization. This attribute can now be assigned to users to flag project leadership status. **Step 2: Role Assignment** Applied the organization's default role to all users as requested. Note: The MCP's current toolset applies default roles broadly but doesn't filter by existing role ('editor'). You'll need to manually assign the `project-lead` attribute to specific users afterward. This is an illustrative example. Actual execution requires organization admin permissions.

Notes

This example shows Sanity's write capabilities for user management but highlights a limitation: the MCP can create attribute definitions and apply default roles, but fine-grained role filtering (like 'only editors') requires additional manual steps or API calls outside the current tool set. Side-effect: modifying user roles affects access permissions immediately.

Prompt

@sanity send a prompt to the Content Agent asking it to suggest three blog post topics based on our most-edited documents from last month, then summarize the response

Output

I sent your request to Sanity's Content Agent using the one-shot prompt endpoint. The agent suggested: 1. **'Behind the Scenes: How We Structure Content at Scale'** — Based on frequent edits to your content modeling docs 2. **'5 Lessons from Migrating 10,000 Articles'** — Derived from migration guide activity 3. **'Why We Chose Portable Text Over Markdown'** — Reflects heavy iteration on your schema documentation The Content Agent analyzed document edit patterns to infer topics your team is actively working through. This is an illustrative example; actual suggestions depend on your dataset's edit history and the agent's training context.

Notes

This example pairs Sanity's Content Agent (a stateless AI prompt tool) with the AI's ability to synthesize results. The one-shot endpoint doesn't maintain conversation history, so each prompt is independent. Useful for quick content ideation but not for multi-turn refinement. Requires API key with access to the Content Agent feature.

Use-case deep-dives

Content ops onboarding at agencies

When Sanity MCP makes sense for client project handoffs

A 6-person agency spins up new Sanity projects every month for clients. The ops lead uses this MCP to script the entire onboarding: create attribute definitions for client tier and contract end-date, assign default roles to the client's content team, and send a welcome prompt via the Content Agent. The win is consistency—every project starts with the same RBAC shape and attribute taxonomy. The threshold: if you're only managing one or two Sanity orgs, the setup overhead (API key rotation, tool discovery) outweighs the benefit. But if you're running 5+ concurrent projects and your onboarding checklist is over 10 steps, this MCP turns a 30-minute manual process into a 2-minute Switchy workflow.

Support ticket triage with content context

Using Sanity MCP to surface CMS permissions in Slack threads

A 4-person support team fields "why can't I publish?" tickets from content editors. The support rep pastes the user's email into Switchy, which calls Get Organization Role and Get Permission to pull the user's role and scope. The MCP returns the exact permission set—"this user has draft-only access on the blog collection"—and the rep replies with a screenshot and next steps. The trade-off: this only works if your Sanity org uses custom roles and attributes. If everyone is an admin or editor with default permissions, the MCP just confirms what you already know. The buying call is speed: if you're triaging 10+ permission questions a week, this MCP cuts your median response time from 8 minutes to under 2.

Quarterly access audit for compliance

When Sanity MCP handles user attribute cleanup at scale

A 3-person ops team at a SaaS company runs quarterly audits of their Sanity org: which users have custom attributes (like customer-tier or contract-status), which roles are assigned, and which invites are still pending. They use this MCP to script the audit—Get Invite By Token for pending invites, Delete User Attributes for expired contractors, and Add Default Role to Users for new hires who slipped through onboarding. The win is auditability: every action is logged in Switchy's thread history, so the compliance lead can export a CSV of changes. The boundary: if your org has fewer than 20 Sanity users, a manual quarterly review in the Sanity dashboard is faster. But if you're managing 50+ users across multiple projects, this MCP turns a 2-hour spreadsheet exercise into a 15-minute scripted run.

Frequently asked

What does the Sanity MCP let me do in Switchy?

It connects your Sanity organization so AI agents can manage users, roles, and permissions without leaving the chat. You can assign default roles, create custom attribute definitions, send prompts to Sanity's Content Agent, and retrieve invite or permission details. It's built for teams that need to automate Sanity admin tasks or query organization state from within Switchy workflows.

Do I need admin access to connect Sanity MCP?

Yes. The MCP uses an API key, and most tools — like adding default roles or creating attribute definitions — require organization-level permissions. You'll need to generate the key from a Sanity account with admin rights. If you only have project-level access, the MCP won't be able to execute organization-wide actions like role assignment or invite retrieval.

Can the Sanity MCP create or edit content documents?

No. This MCP focuses on organization and user management — roles, permissions, attributes, invites. It can send one-shot prompts to Sanity's Content Agent, but it doesn't directly create or edit documents in your datasets. If you need to mutate content, use Sanity's GROQ API or the Content Lake MCP instead.

How is this different from calling Sanity's Management API directly?

The MCP wraps Sanity's Management API so AI agents can invoke it conversationally. Instead of writing code to list roles or delete attributes, you describe the task in natural language and the agent picks the right tool. It's faster for ad-hoc admin work, but you lose the fine-grained control and batching you'd get from scripting the API yourself.

Who on my team should connect the Sanity MCP?

Whoever manages your Sanity organization — typically a developer or ops lead with admin access. They'll generate the API key and add it to Switchy. Once connected, any team member with access to the Switchy workspace can ask the AI to run Sanity admin tasks, but the underlying permissions are still governed by the key's scope.

Data last verified 607 hours ago.Sources aggregated hourly to weekly. See docs/architecture/model-directory.md.