• VIEW
  • CREATE
  • SWITCH
  • HUMAN

How to manage content environments with your AI

Connect Sanity to your AI client once. From there, you can jump between datasets or spin up new ones just by asking.

Ask AI about this page

Short answer

How can I switch Sanity datasets using my AI?

Your agent uses the Sanity MCP to pull a list of your current datasets or build new ones on demand. You can move from staging to production by simply naming the target environment in your chat. You'll see exactly how your data is organized across different environments.

Environment outcomes

Where your data lives

Control your content lifecycle through direct commands.

VIEW

Dataset visibility

The AI pulls your full list of environments. You'll know exactly which datasets are active and ready for use.

CREATE

New sandboxes

Spin up a fresh dataset for testing. This keeps your experimental work away from live production data.

SWITCH

Context shifts

Tell your agent to target a different dataset. It updates its focus so your next command hits the right environment.

HUMAN

Manual oversight

The AI handles the setup, but you decide when a new environment is ready for real content. You stay in control of the final deployment.

The workflow

What your AI does when the request arrives.

The AI handles the technical navigation of your Sanity project.

  1. Inventory check

    The agent looks up all your current Sanity datasets to see what's available.

    list_datasets
  2. Environment setup

    If you need a clean slate, the agent builds a brand new dataset for you.

    create_dataset
  3. Targeting

    The agent maps your request to the specific dataset you named, ensuring commands hit the right target.

    list_datasets
  4. Verification

    The agent confirms the dataset exists and is ready for your content operations.

    list_datasets

Try it

Copy these to start.

Use these prompts to begin managing your Sanity environments.

Starting points

These are opening lines. Swap out the dataset names for your actual Sanity environment names.

Sanity Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_ACkKs6jzV4svPUkN2nvh7GZdikEWKwiWbOMvDihL/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Sanity capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "sanity-alternative-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_ACkKs6jzV4svPUkN2nvh7GZdikEWKwiWbOMvDihL/mcp"
    }
  }
}
Copy into chat04
  • List all my Sanity datasets so I can see what's available.

  • Create a new dataset called 'staging-test' for my project.

  • Switch my context to the 'production' dataset.

  • Show me the datasets I currently have in Sanity.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Sanity once, then ask.

Click the link to connect your account. Your credentials stay encrypted on our side, and you can start managing datasets immediately.

Connect Sanity to your AI

FAQ

How this task behaves

  • 01

    Can the AI delete my production datasets?

    No. The tools only allow for listing and creating datasets. Deletion is not a capability of this MCP.

  • 02

    How do I know which dataset the AI is using?

    You can ask the AI to list your datasets to confirm which one is active in the current conversation.

  • 03

    Can the AI edit the content inside my documents?

    No. These tools are for managing the datasets themselves, not for editing individual content pieces.

  • 04

    Do I need to manually switch environments in Sanity Studio?

    No. Once connected, you can tell your AI to switch datasets, which changes the context for all subsequent commands.

  • 05

    Can I create multiple datasets at once?

    No. You must ask the AI to create them one by one.

  • More questions about Sanity? See everything the Sanity Connector can do

Connect Sanity to Claude, Cursor, ChatGPT & more