Skip to content
Back to search

agent-toolkit

Collection of resources to help AI agents build better with Sanity.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/sanity-io/agent-toolkit with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/sanity-io/agent-toolkit'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/sanity-io--agent-toolkit/badge.svg)](/listings/sanity-io--agent-toolkit)

HTML

<a href="/listings/sanity-io--agent-toolkit"><img src="/api/listings/sanity-io--agent-toolkit/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Run in terminal to detect and configure MCP for Cursor, Claude Code and VS Code automatically:

npx sanity@latest mcp configure

Uses your logged-in CLI user for authentication — no manual tokens or OAuth needed.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 39 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. {
  2. "name": "sanity-agent-toolkit",
  3. "owner": {
  4. "name": "Sanity",
  5. "email": "support@sanity.io",
  6. "url": "https://www.sanity.io"
  7. },
  8. "metadata": {
  9. "description": "Sanity plugin for Claude Code with MCP server, agent skills, and agent rules.",
  10. "version": "1.0.0"
  11. },
  12. "plugins": [
  13. {
  14. "name": "sanity",
  15. "source": "./",
  16. "description": "Sanity plugin for Claude Code with MCP server, agent skills, agent rules, and slash commands.",
  17. "version": "1.0.0",
  18. "homepage": "https://github.com/sanity-io/agent-toolkit",
  19. "repository": "https://github.com/sanity-io/agent-toolkit",
  20. "license": "MIT",
  21. "keywords": [
  22. "sanity",
  23. "cms",
  24. "content-lake",
  25. "groq",
  26. "content",
  27. "structured-content",
  28. "visual-editing"
  29. ],
  30. "author": {
  31. "name": "Sanity",
  32. "email": "support@sanity.io",
  33. "url": "https://www.sanity.io"
  34. },
  35. "category": "cms",
  36. "tags": ["sanity", "cms", "groq", "structured-content", "visual-editing"]
  37. }
  38. ]
  39. }
README.md · README · 414 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <a href="https://sanity.io">
  3. <img src="https://cdn.sanity.io/images/3do82whm/next/d6cf401d52c33b7a5a354a14ab7de94dea2f0c02-192x192.svg" />
  4. </a>
  5. <h1 align="center">Sanity Agent Toolkit</h1>
  6. </p>
  7. Collection 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).
  8. ---
  9. ## Features
  10. - **MCP server:** Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules.
  11. - **Agent skills:** Comprehensive best practices skills for Sanity development, content modeling, SEO/AEO, and experimentation. Includes 25 integration/topic guides and 26 focused best-practice rules.
  12. - **Agent Plugin:** `plugin.json`, `skills/`, and `mcp.json` components for any Agent Plugins-compatible client.
  13. - **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).
  14. - **Cursor plugin:** MCP server, agent skills, and commands on the [Cursor Marketplace](https://cursor.com/marketplace/sanity).
  15. - **Codex plugin:** MCP server and agent skills for [OpenAI Codex](https://developers.openai.com/codex) users.
  16. ---
  17. ## Get started
  18. Choose your path based on how you want agents to work with Sanity:
  19. 1. **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.
  20. 2. **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.
  21. 3. **Plugin** — Install the Sanity plugin for Cursor, Claude Code, or any Agent Plugins-compatible client. Bundles MCP server, agent skills, and commands.
  22. 4. **Manual installation** — Copy the skill references locally for offline use. You'll need to update them yourself.
  23. ### Option 1: Install MCP server (recommended)
  24. Give agents direct access to Sanity projects and always up-to-date agent rules via the MCP server.
  25. #### Quick install via Sanity CLI
  26. Run in terminal to detect and configure MCP for Cursor, Claude Code and VS Code automatically:
  27. ```bash
  28. npx sanity@latest mcp configure
  29. ```
  30. Uses your logged-in CLI user for authentication — no manual tokens or OAuth needed.
  31. #### Client-specific instructions
  32. <details>
  33. <summary><strong>Cursor</strong></summary>
  34. One-click install:<br>
  35. [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Sanity&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLnNhbml0eS5pbyJ9)
  36. Or manually: Open **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **View: Open MCP Settings** → **+ New MCP Server** → add to `mcp.json`:
  37. ```json
  38. {
  39. "mcpServers": {
  40. "Sanity": {
  41. "type": "http",
  42. "url": "https://mcp.sanity.io"
  43. }
  44. }
  45. }
  46. ```
  47. </details>
  48. <details>
  49. <summary><strong>Claude Code</strong></summary>
  50. Run in terminal. Authenticate with OAuth on next launch:
  51. ```bash
  52. claude mcp add Sanity -t http https://mcp.sanity.io --scope user
  53. ```
  54. </details>
  55. <details>
  56. <summary><strong>Codex</strong></summary>
  57. Run in terminal. Authenticate with OAuth on next launch:
  58. ```bash
  59. codex mcp add Sanity --url https://mcp.sanity.io
  60. ```
  61. Or manually add to `~/.codex/config.toml`:
  62. ```toml
  63. [mcp_servers.Sanity]
  64. url = "https://mcp.sanity.io"
  65. ```
  66. </details>
  67. <details>
  68. <summary><strong>VS Code</strong></summary>
  69. Open **Command Palette** (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **MCP: Open User Configuration** → add:
  70. ```json
  71. {
  72. "servers": {
  73. "Sanity": {
  74. "type": "http",
  75. "url": "https://mcp.sanity.io"
  76. }
  77. }
  78. }
  79. ```
  80. </details>
  81. <details>
  82. <summary><strong>Lovable</strong></summary>
  83. Sanity is available as a prebuilt chat connector in Lovable:
  84. 1. Open **Connectors** → **Chat connectors**
  85. 2. Select **Sanity**
  86. 3. Click **Connect** and sign in to authorize your Sanity account
  87. In your next prompt, reference your Sanity project or ask the agent to read your schema.
  88. See the [Lovable MCP documentation](https://docs.lovable.dev/integrations/mcp-servers) or [Sanity + Lovable guide](https://lovable.dev/connect/sanity) for more details.
  89. </details>
  90. <details>
  91. <summary><strong>v0</strong></summary>
  92. In the prompt input field, click **Prompt Tools** → **MCPs** → **Add New** → Select **Sanity** → **Authorize** → Authenticate with OAuth.
  93. </details>
  94. <details>
  95. <summary><strong>Replit</strong></summary>
  96. Go 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.
  97. </details>
  98. <details>
  99. <summary><strong>OpenCode</strong></summary>
  100. Add to your `opencode.json`:
  101. ```json
  102. {
  103. "$schema": "https://opencode.ai/config.json",
  104. "mcp": {
  105. "sanity": {
  106. "type": "remote",
  107. "url": "https://mcp.sanity.io",
  108. "oauth": {}
  109. }
  110. }
  111. }
  112. ```
  113. Then run: `opencode mcp auth sanity`
  114. </details>
  115. <details>
  116. <summary><strong>Other clients</strong></summary>
  117. For any MCP-compatible client, add `https://mcp.sanity.io` as the server URL.
  118. If your client doesn't support remote MCP servers, use a proxy like `mcp-remote`:
  119. ```json
  120. {
  121. "mcpServers": {
  122. "Sanity": {
  123. "command": "npx",
  124. "args": ["mcp-remote", "https://mcp.sanity.io", "--transport", "http-only"]
  125. }
  126. }
  127. }
  128. ```
  129. </details>
  130. <br />
  131. #### Authorization and troubleshooting
  132. Manual 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**.
  133. See the [Sanity MCP docs](https://www.sanity.io/docs/ai/mcp-server) for authorization options and troubleshooting.
  134. ### Option 2: Install Agent Skills
  135. Install best practices skills that work with any [Agent Skills](https://agentskills.io)-compatible agent.
  136. ```bash
  137. npx skills add sanity-io/agent-toolkit
  138. ```
  139. See [Option 3](#option-3-install-plugin) for plugin installation.
  140. ### Option 3: Install plugin
  141. Install the Sanity plugin to get MCP server, agent skills, and commands.
  142. Available 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/).
  143. #### Claude Code
  144. The 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.
  145. Install from Claude Code:
  146. ```
  147. /plugin install sanity@claude-plugins-official
  148. ```
  149. If the plugin is not found, refresh the marketplace catalog and retry:
  150. ```
  151. /plugin marketplace update claude-plugins-official
  152. ```
  153. Then run `/reload-plugins` to activate without restarting.
  154. **Alternative: interactive install**
  155. 1. Run `/plugin` and open the **Discover** tab
  156. 2. Search for **Sanity**
  157. 3. 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))
  158. 4. Choose an installation scope:
  159. - **User** (default): all projects on this machine
  160. - **Project**: shared with collaborators via `.claude/settings.json`
  161. - **Local**: this repository only
  162. 5. Run `/reload-plugins` to activate without restarting
  163. **Verify installation:** Ask Claude Code: "which skills do you have access to?"
  164. You should see the Sanity skills listed.
  165. **Start using:** Use natural language and skills activate automatically:
  166. > Help me create a blog post schema in Sanity
  167. > Review my GROQ query and Next.js Visual Editing setup
  168. Or run `/sanity` to explore all capabilities.
  169. #### Cursor
  170. Install from the [Cursor Marketplace](https://cursor.com/marketplace/sanity) by running this in Cursor chat:
  171. ```
  172. /add-plugin sanity
  173. ```
  174. **Verify installation:** Ask Cursor: "which skills do you have access to?"
  175. You should see the Sanity skills listed.
  176. **Start using:** Use natural language and skills activate automatically:
  177. > Help me create a blog post schema in Sanity
  178. > Review my GROQ query and Next.js Visual Editing setup
  179. #### Codex
  180. 1. Add the Sanity marketplace:
  181. ```bash
  182. codex plugin marketplace add sanity-io/agent-toolkit
  183. ```
  184. 2. Install the plugin from Codex's plugin directory (select the **Sanity Agent Toolkit** marketplace, then install **Sanity**).
  185. 3. Restart Codex. Verify by asking: "which skills do you have access to?" — you should see the Sanity skills listed.
  186. ### Option 4: Manual installation
  187. Install the skill references locally to teach your editor Sanity best practices:
  188. 1. Copy `skills/sanity-best-practices/` to your project.
  189. 2. (Recommended) Copy `AGENTS.md` to your project root to act as a knowledge router.
  190. ---
  191. ## Capabilities
  192. ### MCP tools
  193. With MCP connected, your AI can use tools like:
  194. - `query_documents` — run GROQ queries directly
  195. - `create_documents` — create draft documents from structured content, or version documents when a release ID is provided
  196. - `patch_documents` — surgical edits to existing documents; published documents are edited by creating or updating drafts
  197. - `publish_documents` / `unpublish_documents` — manage document lifecycle
  198. - `deploy_schema` / `get_schema` — deploy MCP-managed schemas and inspect deployed schemas
  199. - `deploy_studio` — deploy a hosted Studio bound to an MCP-managed schema
  200. - `create_release` / `list_releases` — create and inspect Content Releases
  201. - `create_version` — create version documents for releases
  202. - `generate_image` / `transform_image` — AI image generation and editing
  203. - `whoami` — verify the authenticated Sanity user
  204. - `get_project_studios` — list Studio applications linked to a project
  205. - `search_docs` / `read_docs` — search and read Sanity documentation
  206. - `list_sanity_rules` / `get_sanity_rules` — load agent rules on demand
  207. - `give_feedback` — report MCP tool errors, missing capabilities, confusing output, or documentation issues
  208. MCP-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.
  209. See the [full list of available tools](https://www.sanity.io/docs/ai/mcp-server#available-tools).
  210. ### Agent skills
  211. Best 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.
  212. | Skill | Description |
  213. | :--- | :--- |
  214. | **sanity-best-practices** | GROQ performance, schema design, Visual Editing, images, Portable Text, Studio, TypeGen, localization, migrations, and framework integration guides |
  215. | **content-modeling-best-practices** | Structured content principles: separation of concerns, references vs embedding, content reuse |
  216. | **seo-aeo-best-practices** | SEO/AEO with EEAT principles, structured data (JSON-LD), technical SEO patterns |
  217. | **content-experimentation-best-practices** | A/B testing methodology, statistical foundations, experiment design |
  218. | **sanity-singletons** | First-class singleton documents via `document.singletons`, Structure helpers, and migrating from userland or plugin-based singletons |
  219. | **sanity-form-component-suspense** | Fix custom Studio form components (inputs, fields, array items) that suspend without their own `Suspense` boundary, causing layout shift or blocking new documents |
  220. ### Getting started flow
  221. The onboarding guide follows three phases:
  222. 1. **Studio & Schema** — Set up Sanity Studio and define your content model
  223. 2. **Content** — Import existing content or generate placeholder content via MCP
  224. 3. **Frontend** — Integrate with your application (framework-specific)
  225. Just say: "Get started with Sanity" to begin.
  226. ### Slash commands (Claude Code)
  227. | Command | What it does |
  228. | :--- | :--- |
  229. | `/sanity` | List available skills and help topics |
  230. | `/sanity-review` | Review code for Sanity best practices |
  231. | `/typegen` | Run TypeGen and troubleshoot issues |
  232. | `/deploy-schema` | Deploy schema with verification |
  233. ---
  234. ## Repository structure
  235. > **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`).
  236. ```text
  237. sanity-io/agent-toolkit/
  238. ├── AGENTS.md # Knowledge router & agent behavior
  239. ├── README.md # This file
  240. ├── plugin.json # Portable Agent Plugins v1 manifest
  241. ├── mcp.json # Portable Agent Plugins v1 MCP configuration
  242. ├── .agents/plugins/ # Codex marketplace
  243. │ └── marketplace.json # Codex marketplace metadata
  244. ├── .claude-plugin/ # Claude Code plugin configuration (distributed via claude-plugins-official)
  245. │ ├── plugin.json # Plugin manifest (name: sanity)
  246. │ └── marketplace.json # Marketplace manifest for repo-based discovery
  247. ├── .codex-plugin/ # Codex plugin configuration
  248. │ └── plugin.json # Codex plugin manifest
  249. ├── .cursor-plugin/ # Cursor plugin configuration (distributed via cursor.com/marketplace)
  250. │ ├── marketplace.json # Cursor marketplace metadata
  251. │ └── plugin.json # Per-plugin manifest
  252. ├── .mcp.json # Legacy client MCP compatibility configuration
  253. ├── assets/ # Plugin branding
  254. │ └── logo.svg # Sanity logo for marketplace display
  255. ├── commands/ # Agent commands
  256. │ ├── sanity.md # /sanity help
  257. │ ├── sanity-review.md # /sanity-review
  258. │ ├── typegen.md # /typegen
  259. │ └── deploy-schema.md # /deploy-schema
  260. ├── scripts/ # Validation and CI scripts
  261. │ ├── validate-agent-plugin.mjs # Validate manifests against the v1 JSON Schemas
  262. │ └── validate-cursor-plugin.mjs # Cursor plugin validator
  263. └── skills/ # Agent skills (agentskills.io format)
  264. ├── sanity-best-practices/ # Comprehensive Sanity skill
  265. │ ├── SKILL.md # Skill definition and quick reference
  266. │ └── references/ # Canonical content (25 guides)
  267. │ ├── get-started.md # Onboarding guide
  268. │ ├── nextjs.md # Next.js integration
  269. │ ├── groq.md # GROQ patterns & performance
  270. │ ├── schema.md # Schema design & validation
  271. │ └── ... # See SKILL.md for full index
  272. ├── content-modeling-best-practices/ # Modeling guidance + topic references
  273. ├── seo-aeo-best-practices/ # SEO/AEO guidance + topic references
  274. ├── content-experimentation-best-practices/ # Experiment design + stats references
  275. ├── sanity-singletons/ # First-class singleton documents (Studio 6.17+)
  276. └── sanity-form-component-suspense/ # Suspense boundaries for custom form components
  277. ```
  278. All 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.
  279. ---
  280. ## Resources
  281. - [Create Sanity account](https://www.sanity.io/get-started)
  282. - [Sanity documentation](https://www.sanity.io/docs)
  283. - [GROQ language reference](https://www.sanity.io/docs/groq)
  284. - [Visual Editing guide](https://www.sanity.io/docs/visual-editing)
  285. - [Sanity TypeGen](https://www.sanity.io/docs/sanity-typegen)
  286. - [MCP server docs](https://www.sanity.io/docs/ai/mcp-server)
  287. - [Agent Plugins specification](https://agent-plugins.org/specification)
  288. - [Blueprints Infrastructure as Code](https://www.sanity.io/docs/compute-and-ai/blueprints)
  289. ---
  290. ## Contributing
  291. Found 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:
  292. 1. Fork the repo.
  293. 2. Install dependencies with `npm install`.
  294. 3. Make your changes in `skills/<skill-name>/`.
  295. 4. Run `npm run validate:all` to check skill and plugin validity.
  296. 5. Submit a PR.
  297. ---
  298. ## Support
  299. - [Sanity Community (Discord)](https://www.sanity.io/community/join)
  300. - [GitHub issues](https://github.com/sanity-io/agent-toolkit/issues)
  301. ---
  302. **License:** MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.