CoursesAI-powered Sanity developmentConnect to the Sanity MCP server
AI-powered Sanity development

Connect to the Sanity MCP server

The Model Context Protocol (MCP) allows AI tools to reach out and perform actions on external applications—like your Sanity project.
Log in to mark your progress for each Lesson and Task

The Sanity MCP server is a hosted service at mcp.sanity.io that gives AI assistants like Cursor direct access to your Sanity project. Once connected, your AI can execute GROQ queries, read and write documents, explore your schema, and more—without you having to paste in context manually.

The fastest way to get set up is with the Sanity CLI. Run this command from your project directory—it auto-detects Cursor, Claude Code, and VS Code and configures the MCP server for you:

npx sanity@latest mcp configure
  • This uses your logged-in CLI user for authentication. No manual token management needed.

If you prefer to configure manually, open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P), run View: Open MCP Settings, select + New MCP Server, and add the following to your mcp.json file:

{
"mcpServers": {
"Sanity": {
"type": "http",
"url": "https://mcp.sanity.io"
}
}
}

Save the file. Cursor will detect the new server and prompt you to authenticate via OAuth.

Open Cursor's agent chat and ask:

Do you have access to the Sanity MCP server? What can you tell me about the project?

If it responds with details about your schema and project, you are connected and ready to go.

Mark lesson as complete
You have 1 uncompleted task in this lesson
0 of 1