{
  "markdown": "<p align=\"center\">\n  <a href=\"https://sanity.io\">\n    <img src=\"https://cdn.sanity.io/images/3do82whm/next/d6cf401d52c33b7a5a354a14ab7de94dea2f0c02-192x192.svg\" />\n  </a>\n  <h1 align=\"center\">Sanity Agent Toolkit</h1>\n</p>\n\nCollection of resources to help AI agents build better with [Sanity](https://www.sanity.io). Supports Cursor, Claude Code, Codex, VS Code, Lovable, v0, Replit, OpenCode, and any other editor/agent compatible with MCP or [Agent Skills](https://agentskills.io).\n\n---\n\n## Features\n\n- **MCP server:** Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules.\n- **Agent skills:** Comprehensive best practices skills for Sanity development, content modeling, SEO/AEO, and experimentation. Includes 21 integration/topic guides and 26 focused best-practice rules.\n- **Agent Plugin:** `plugin.json`, `skills/`, and `mcp.json` components for any Agent Plugins-compatible client.\n- **Claude Code plugin:** MCP server, agent skills, and slash commands for Claude Code users. Available on the [official Anthropic plugin marketplace](https://claude.com/plugins/sanity).\n- **Cursor plugin:** MCP server, agent skills, and commands on the [Cursor Marketplace](https://cursor.com/marketplace/sanity).\n- **Codex plugin:** MCP server and agent skills for [OpenAI Codex](https://developers.openai.com/codex) users.\n\n---\n\n## Get started\n\nChoose your path based on how you want agents to work with Sanity:\n\n1. **MCP server** — Give your agent always up-to-date rules and full access to your Sanity projects. No local files to maintain. Works with Cursor, VS Code, Claude Code, Lovable, v0, Replit, OpenCode, and other MCP-compatible clients.\n2. **Agent skills** — Install best practices skills for Sanity, content modeling, SEO/AEO, and experimentation. Works with Cursor, Claude Code, and any [Agent Skills](https://agentskills.io)-compatible agent.\n3. **Plugin** — Install the Sanity plugin for Cursor, Claude Code, or any Agent Plugins-compatible client. Bundles MCP server, agent skills, and commands.\n4. **Manual installation** — Copy the skill references locally for offline use. You'll need to update them yourself.\n\n### Option 1: Install MCP server (recommended)\n\nGive agents direct access to Sanity projects and always up-to-date agent rules via the MCP server.\n\n#### Quick install via Sanity CLI\n\nRun in terminal to detect and configure MCP for Cursor, Claude Code and VS Code automatically:\n\n```bash\nnpx sanity@latest mcp configure\n```\n\nUses your logged-in CLI user for authentication — no manual tokens or OAuth needed.\n\n#### Client-specific instructions\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nOne-click install:<br>\n[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Sanity&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLnNhbml0eS5pbyJ9)\n\nOr manually: Open **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **View: Open MCP Settings** → **+ New MCP Server** → add to `mcp.json`:\n```json\n{\n  \"mcpServers\": {\n    \"Sanity\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.sanity.io\"\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Claude Code</strong></summary>\n\nRun in terminal. Authenticate with OAuth on next launch:\n```bash\nclaude mcp add Sanity -t http https://mcp.sanity.io --scope user\n```\n</details>\n\n<details>\n<summary><strong>Codex</strong></summary>\n\nRun in terminal. Authenticate with OAuth on next launch:\n```bash\ncodex mcp add Sanity --url https://mcp.sanity.io\n```\n\nOr manually add to `~/.codex/config.toml`:\n```toml\n[mcp_servers.Sanity]\nurl = \"https://mcp.sanity.io\"\n```\n</details>\n\n<details>\n<summary><strong>VS Code</strong></summary>\n\nOpen **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **MCP: Open User Configuration** → add:\n```json\n{\n  \"servers\": {\n    \"Sanity\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.sanity.io\"\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Lovable</strong></summary>\n\nSanity is available as a prebuilt chat connector in Lovable:\n\n1. Open **Connectors** → **Chat connectors**\n2. Select **Sanity**\n3. Click **Connect** and sign in to authorize your Sanity account\n\nIn your next prompt, reference your Sanity project or ask the agent to read your schema.\n\nSee the [Lovable MCP documentation](https://docs.lovable.dev/integrations/mcp-servers) or [Sanity + Lovable guide](https://lovable.dev/connect/sanity) for more details.\n</details>\n\n<details>\n<summary><strong>v0</strong></summary>\n\nIn the prompt input field, click **Prompt Tools** → **MCPs** → **Add New** → Select **Sanity** → **Authorize** → Authenticate with OAuth.\n</details>\n\n<details>\n<summary><strong>Replit</strong></summary>\n\nGo to [Integrations Page](https://replit.com/integrations) → scroll to **MCP Servers for Replit Agent** → **Add MCP server** → Enter `Sanity` as name and `https://mcp.sanity.io` as Server URL → **Test & Save** → Authenticate with OAuth.\n</details>\n\n<details>\n<summary><strong>OpenCode</strong></summary>\n\nAdd to your `opencode.json`:\n```json\n{\n  \"$schema\": \"https://opencode.ai/config.json\",\n  \"mcp\": {\n    \"sanity\": {\n      \"type\": \"remote\",\n      \"url\": \"https://mcp.sanity.io\",\n      \"oauth\": {}\n    }\n  }\n}\n```\nThen run: `opencode mcp auth sanity`\n</details>\n\n<details>\n<summary><strong>Other clients</strong></summary>\n\nFor any MCP-compatible client, add `https://mcp.sanity.io` as the server URL.\n\nIf your client doesn't support remote MCP servers, use a proxy like `mcp-remote`:\n```json\n{\n  \"mcpServers\": {\n    \"Sanity\": {\n      \"command\": \"npx\",\n      \"args\": [\"mcp-remote\", \"https://mcp.sanity.io\", \"--transport\", \"http-only\"]\n    }\n  }\n}\n```\n</details>\n\n<br />\n\n#### Authorization and troubleshooting\n\nManual MCP configuration uses OAuth by default. You can use token auth instead by setting an `Authorization: Bearer <token>` header in the MCP config. If authentication fails after CLI setup, rerun `npx sanity@latest mcp configure` and restart your MCP client. For OAuth reset issues, Cursor provides **Cursor: Clear All MCP Tokens** and VS Code provides **Authentication: Remove Dynamic Authentication Providers**.\n\nSee the [Sanity MCP docs](https://www.sanity.io/docs/ai/mcp-server) for authorization options and troubleshooting.\n\n### Option 2: Install Agent Skills\n\nInstall best practices skills that work with any [Agent Skills](https://agentskills.io)-compatible agent.\n\n```bash\nnpx skills add sanity-io/agent-toolkit\n```\n\nSee [Option 3](#option-3-install-plugin) for plugin installation.\n\n### Option 3: Install plugin\n\nInstall the Sanity plugin to get MCP server, agent skills, and commands.\nAvailable on the [Claude Code marketplace](https://claude.com/plugins/sanity), [Cursor Marketplace](https://cursor.com/marketplace/sanity), or from this repo as an [Agent Plugin](https://agent-plugins.org/).\n\n#### Claude Code\n\nThe Sanity plugin is listed on the [official Anthropic plugin marketplace](https://claude.com/plugins/sanity). The official marketplace (`claude-plugins-official`) is pre-registered when you start Claude Code — you do not need to add a custom marketplace.\n\nInstall from Claude Code:\n\n```\n/plugin install sanity@claude-plugins-official\n```\n\nIf the plugin is not found, refresh the marketplace catalog and retry:\n\n```\n/plugin marketplace update claude-plugins-official\n```\n\nThen run `/reload-plugins` to activate without restarting.\n\n**Alternative: interactive install**\n\n1. Run `/plugin` and open the **Discover** tab\n2. Search for **Sanity**\n3. Review what the plugin will install — commands, skills, hooks, and MCP servers — before confirming ([Anthropic recommends reviewing plugin permissions and source before installing](https://code.claude.com/docs/en/discover-plugins#install-plugins))\n4. Choose an installation scope:\n   - **User** (default): all projects on this machine\n   - **Project**: shared with collaborators via `.claude/settings.json`\n   - **Local**: this repository only\n5. Run `/reload-plugins` to activate without restarting\n\n**Verify installation:** Ask Claude Code: \"which skills do you have access to?\"\n\nYou should see the Sanity skills listed.\n\n**Start using:** Use natural language and skills activate automatically:\n\n> Help me create a blog post schema in Sanity\n\n> Review my GROQ query and Next.js Visual Editing setup\n\nOr run `/sanity` to explore all capabilities.\n\n#### Cursor\n\nInstall from the [Cursor Marketplace](https://cursor.com/marketplace/sanity) by running this in Cursor chat:\n\n```\n/add-plugin sanity\n```\n\n**Verify installation:** Ask Cursor: \"which skills do you have access to?\"\n\nYou should see the Sanity skills listed.\n\n**Start using:** Use natural language and skills activate automatically:\n\n> Help me create a blog post schema in Sanity\n\n> Review my GROQ query and Next.js Visual Editing setup\n\n#### Codex\n\n1. Add the Sanity marketplace:\n\n```bash\ncodex plugin marketplace add sanity-io/agent-toolkit\n```\n\n2. Install the plugin from Codex's plugin directory (select the **Sanity Agent Toolkit** marketplace, then install **Sanity**).\n\n3. Restart Codex. Verify by asking: \"which skills do you have access to?\" — you should see the Sanity skills listed.\n\n### Option 4: Manual installation\n\nInstall the skill references locally to teach your editor Sanity best practices:\n\n1. Copy `skills/sanity-best-practices/` to your project.\n2. (Recommended) Copy `AGENTS.md` to your project root to act as a knowledge router.\n\n---\n\n## Capabilities\n\n### MCP tools\n\nWith MCP connected, your AI can use tools like:\n- `query_documents` — run GROQ queries directly\n- `create_documents` — create draft documents from structured content, or version documents when a release ID is provided\n- `patch_documents` — surgical edits to existing documents; published documents are edited by creating or updating drafts\n- `publish_documents` / `unpublish_documents` — manage document lifecycle\n- `deploy_schema` / `get_schema` — deploy MCP-managed schemas and inspect deployed schemas\n- `deploy_studio` — deploy a hosted Studio bound to an MCP-managed schema\n- `create_release` / `list_releases` — create and inspect Content Releases\n- `create_version` — create version documents for releases\n- `generate_image` / `transform_image` — AI image generation and editing\n- `whoami` — verify the authenticated Sanity user\n- `get_project_studios` — list Studio applications linked to a project\n- `search_docs` / `read_docs` — search and read Sanity documentation\n- `list_sanity_rules` / `get_sanity_rules` — load agent rules on demand\n- `give_feedback` — report MCP tool errors, missing capabilities, confusing output, or documentation issues\n\nMCP-managed schemas are resolved before Studio-deployed and legacy schemas. If you deploy schema changes with `deploy_schema`, redeploy any matching MCP-managed Studio with `deploy_studio` so it picks up the latest schema. `generate_image`, `transform_image`, and `create_version` with an `instruction` consume Sanity AI credits.\n\nSee the [full list of available tools](https://www.sanity.io/docs/ai/mcp-server#available-tools).\n\n### Agent skills\n\nBest practices skills that agents like Claude Code, Cursor, GitHub Copilot, etc. can discover and use automatically. Skills follow the [Agent Skills](https://agentskills.io) format. See [Option 2](#option-2-install-agent-skills) for installation.\n\n| Skill | Description |\n| :--- | :--- |\n| **sanity-best-practices** | GROQ performance, schema design, Visual Editing, images, Portable Text, Studio, TypeGen, localization, migrations, and framework integration guides |\n| **content-modeling-best-practices** | Structured content principles: separation of concerns, references vs embedding, content reuse |\n| **seo-aeo-best-practices** | SEO/AEO with EEAT principles, structured data (JSON-LD), technical SEO patterns |\n| **content-experimentation-best-practices** | A/B testing methodology, statistical foundations, experiment design |\n\n### Getting started flow\n\nThe onboarding guide follows three phases:\n\n1. **Studio & Schema** — Set up Sanity Studio and define your content model\n2. **Content** — Import existing content or generate placeholder content via MCP\n3. **Frontend** — Integrate with your application (framework-specific)\n\nJust say: \"Get started with Sanity\" to begin.\n\n### Slash commands (Claude Code)\n\n| Command | What it does |\n| :--- | :--- |\n| `/sanity` | List available skills and help topics |\n| `/sanity-review` | Review code for Sanity best practices |\n| `/typegen` | Run TypeGen and troubleshoot issues |\n| `/deploy-schema` | Deploy schema with verification |\n\n---\n\n## Repository structure\n\n> **Note:** The reference files in `skills/sanity-best-practices/references/` are the canonical content for the Sanity MCP server's `list_sanity_rules` / `get_sanity_rules` tools. Each file must have valid `name` and `description` frontmatter — rule names are derived from filenames (e.g., `nextjs.md` → `nextjs`).\n\n```text\nsanity-io/agent-toolkit/\n├── AGENTS.md                      # Knowledge router & agent behavior\n├── README.md                      # This file\n├── plugin.json                    # Portable Agent Plugins v1 manifest\n├── mcp.json                       # Portable Agent Plugins v1 MCP configuration\n├── .agents/plugins/               # Codex marketplace\n│   └── marketplace.json           # Codex marketplace metadata\n├── .claude-plugin/                # Claude Code plugin configuration (distributed via claude-plugins-official)\n│   ├── plugin.json                # Plugin manifest (name: sanity)\n│   └── marketplace.json           # Marketplace manifest for repo-based discovery\n├── .codex-plugin/                 # Codex plugin configuration\n│   └── plugin.json                # Codex plugin manifest\n├── .cursor-plugin/                # Cursor plugin configuration (distributed via cursor.com/marketplace)\n│   ├── marketplace.json           # Cursor marketplace metadata\n│   └── plugin.json                # Per-plugin manifest\n├── .mcp.json                      # Legacy client MCP compatibility configuration\n├── assets/                        # Plugin branding\n│   └── logo.svg                   # Sanity logo for marketplace display\n├── commands/                      # Agent commands\n│   ├── sanity.md                  # /sanity help\n│   ├── sanity-review.md           # /sanity-review\n│   ├── typegen.md                 # /typegen\n│   └── deploy-schema.md           # /deploy-schema\n├── scripts/                       # Validation and CI scripts\n│   ├── validate-agent-plugin.mjs  # Validate manifests against the v1 JSON Schemas\n│   └── validate-cursor-plugin.mjs # Cursor plugin validator\n└── skills/                        # Agent skills (agentskills.io format)\n    ├── sanity-best-practices/     # Comprehensive Sanity skill\n    │   ├── SKILL.md               # Skill definition and quick reference\n    │   └── references/            # Canonical content (22 guides)\n    │       ├── get-started.md     # Onboarding guide\n    │       ├── nextjs.md          # Next.js integration\n    │       ├── groq.md            # GROQ patterns & performance\n    │       ├── schema.md          # Schema design & validation\n    │       └── ...                # See SKILL.md for full index\n    ├── content-modeling-best-practices/      # Modeling guidance + topic references\n    ├── seo-aeo-best-practices/               # SEO/AEO guidance + topic references\n    └── content-experimentation-best-practices/ # Experiment design + stats references\n```\n\nAll skills use `references/` for detailed content loaded on demand. The `sanity-best-practices` references are also the canonical source for the MCP server's Sanity rules.\n\n---\n\n## Resources\n\n- [Create Sanity account](https://www.sanity.io/get-started)\n- [Sanity documentation](https://www.sanity.io/docs)\n- [GROQ language reference](https://www.sanity.io/docs/groq)\n- [Visual Editing guide](https://www.sanity.io/docs/visual-editing)\n- [Sanity TypeGen](https://www.sanity.io/docs/sanity-typegen)\n- [MCP server docs](https://www.sanity.io/docs/ai/mcp-server)\n- [Agent Plugins specification](https://agent-plugins.org/specification)\n- [Blueprints Infrastructure as Code](https://www.sanity.io/docs/compute-and-ai/blueprints)\n\n---\n\n## Contributing\n\nFound a better pattern? Missing a framework or best practice? Read the [contributing guide](CONTRIBUTING.md) for how skills work and what makes a good contribution, then:\n\n1. Fork the repo.\n2. Install dependencies with `npm install`.\n3. Make your changes in `skills/<skill-name>/`.\n4. Run `npm run validate:all` to check skill and plugin validity.\n5. Submit a PR.\n\n---\n\n## Support\n\n- [Sanity Community (Discord)](https://www.sanity.io/community/join)\n- [GitHub issues](https://github.com/sanity-io/agent-toolkit/issues)\n\n---\n\n**License:** MIT\n",
  "bytes": 16711,
  "sha": "37c68b28aa4b4a36206555f6192c0e8a0fe1f3e0c783ce2ec6cbef80c45d5813",
  "repo_slug": "sanity-io/agent-toolkit",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_sanity_io_agent_toolkit_content_modeling_e0e00e0c/readme"
}