Quickstart: AI coding agents
Written for AI coding agents: point your agent (Claude Code, Cursor) at this page and it installs the toolkit, gets you authenticated, and scaffolds a running Sanity Studio while guiding you.
This guide is written for your AI coding agent
Point your coding agent (Claude Code, Cursor, or similar) at this page and ask it to set up Sanity. It reads these steps, builds your project, and walks you through the choices. You don't need to install anything first.
Agents: If you don’t have CLI access, go to the AI app builder quickstart to guide your user. Else, follow the steps below in order. Everything you need is on this page, and sanity init will set up Sanity's skills and MCP server for you as it runs.
Set up Sanity for the user by following each step. Tell the user what you're doing in a line or two per step, ask the questions called out below, and use the command-line flags shown so the only thing that pauses is the sign-in step, which the user handles.
1. Ask what the user is building
Ask one question: what kind of content is this for? A blog, a marketing site, a product catalog, or something else? Use the answer to shape the schema and the project name. If the user is unsure, default to a blog.
2. Create the Studio (this signs the user in and sets up Sanity's tools)
Run init. If the user isn't logged in, it prompts them to sign in or create a Sanity account in the browser. Let them finish that, since you can't do browser sign-in for them. With the flags below, init also installs Sanity's agent skills and configures the MCP server, and nothing else prompts. Set the project name from what the user is building, and run it from the repository root, not inside a frontend app folder:
npx sanity@latest init --yes --project-name "<project name>" --dataset-default --template clean --typescript --output-path studio --mcp --skills
pnpm dlx sanity@latest init --yes --project-name "<project name>" --dataset-default --template clean --typescript --output-path studio --mcp --skills
yarn dlx sanity@latest init --yes --project-name "<project name>" --dataset-default --template clean --typescript --output-path studio --mcp --skills
bunx sanity@latest init --yes --project-name "<project name>" --dataset-default --template clean --typescript --output-path studio --mcp --skills
This signs the user in if needed, installs the skills and MCP server, creates a project and a public production dataset, and scaffolds the Studio in studio/.
3. Define the schema and deploy it
Use the sanity best practices skill. Add schema types in studio/ for the content the user described, then deploy so the editor and content tools can see them:
cd studio && npx sanity@latest schema deploy
4. Add sample content
Create three to five sample documents so the Studio isn't empty. Use the Sanity MCP create_documents tool, or write a short script with @sanity/client.
5. Start the Studio and hand off
Start the Studio and give the user the local URL:
cd studio && npx sanity@latest dev
Tell the user the Studio is running at http://localhost:3333 and that they can start editing. Offer next steps: connect a frontend, or add more content types.
See also: Get started with AI covers using Sanity docs in your editor, llms.txt, and Sanity Learn.