{"id":44840895,"url":"https://github.com/sanity-io/agent-toolkit","last_synced_at":"2026-02-17T03:36:08.812Z","repository":{"id":282015485,"uuid":"946644982","full_name":"sanity-io/agent-toolkit","owner":"sanity-io","description":"Collection of resources to help AI agents build better with Sanity.","archived":false,"fork":false,"pushed_at":"2026-02-13T22:33:05.000Z","size":240,"stargazers_count":79,"open_issues_count":6,"forks_count":4,"subscribers_count":12,"default_branch":"main","last_synced_at":"2026-02-13T23:35:16.323Z","etag":null,"topics":["agent-rules","ai-rules","claude-code","claude-code-plugin","cursor-ai","mcp","mcp-server","vs-code"],"latest_commit_sha":null,"homepage":"https://www.sanity.io","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanity-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-03-11T13:10:12.000Z","updated_at":"2026-02-13T14:56:09.000Z","dependencies_parsed_at":"2025-03-12T11:20:35.681Z","dependency_job_id":"a50d0ae7-ec2c-4231-b5d2-5a53ff77f1ef","html_url":"https://github.com/sanity-io/agent-toolkit","commit_stats":null,"previous_names":["sanity-io/ai-rules","sanity-io/agent-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sanity-io/agent-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fagent-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fagent-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fagent-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fagent-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanity-io","download_url":"https://codeload.github.com/sanity-io/agent-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanity-io%2Fagent-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29532437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T03:01:11.216Z","status":"ssl_error","status_checked_at":"2026-02-17T03:00:31.803Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-rules","ai-rules","claude-code","claude-code-plugin","cursor-ai","mcp","mcp-server","vs-code"],"created_at":"2026-02-17T03:36:08.118Z","updated_at":"2026-02-17T03:36:08.800Z","avatar_url":"https://github.com/sanity-io.png","language":null,"funding_links":[],"categories":["Productivity \u0026 Workflow"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://sanity.io\"\u003e\n    \u003cimg src=\"https://cdn.sanity.io/images/3do82whm/next/d6cf401d52c33b7a5a354a14ab7de94dea2f0c02-192x192.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ch1 align=\"center\"\u003eSanity Agent Toolkit\u003c/h1\u003e\n\u003c/p\u003e\n\nCollection of resources to help AI agents build better with [Sanity](https://www.sanity.io). Supports Cursor, Claude Code, VS Code, Lovable, v0, and any other editor/agent compatible with MCP, [Agent Skills](https://agentskills.io), or `.mdc` rules.\n\n---\n\n## Features\n\n- **Agent rules:** 20+ portable `.mdc` files covering schema design, GROQ, Visual Editing, SEO, localization, migrations, and front-end framework integrations.\n- **Agent skills:** Comprehensive best practices skills for Sanity development, content modeling, SEO/AEO, and experimentation.\n- **MCP server:** Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules.\n- **Claude Code plugin:** Slash commands and MCP integration for Claude Code 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, 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. **Claude Code plugin** — Adds interactive skills and slash commands on top of MCP for guided workflows.\n4. **Manual installation** — Copy rules 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\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCursor\u003c/strong\u003e\u003c/summary\u003e\n\nOne-click install:\u003cbr\u003e\n[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Sanity\u0026config=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\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClaude Code\u003c/strong\u003e\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eVS Code\u003c/strong\u003e\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eLovable\u003c/strong\u003e\u003c/summary\u003e\n\n**Settings** → **Connectors** → **Personal connectors** → **New MCP server** → Enter `Sanity` as name and `https://mcp.sanity.io` as Server URL → **Add \u0026 authorize** → Authenticate with OAuth.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003ev0\u003c/strong\u003e\u003c/summary\u003e\n\nIn the prompt input field, click **Prompt Tools** → **MCPs** → **Add New** → Select **Sanity** → **Authorize** → Authenticate with OAuth.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eReplit\u003c/strong\u003e\u003c/summary\u003e\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 \u0026 Save** → Authenticate with OAuth.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eOpenCode\u003c/strong\u003e\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eOther clients\u003c/strong\u003e\u003c/summary\u003e\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\u003c/details\u003e\n\n\u003cbr /\u003e\n\nSee the [Sanity MCP docs](https://www.sanity.io/docs/compute-and-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\n**Cursor:**\n1. Open **Cursor Settings** (Cmd+Shift+J / Ctrl+Shift+J)\n2. Navigate to **Rules** → **Add Rule** → **Remote Rule (Github)**\n3. Enter: `sanity-io/agent-toolkit`\n\nSee [Option 3](#option-3-install-claude-code-plugin) for Claude Code plugin installation.\n\n### Option 3: Install Claude Code plugin\n\nFor Claude Code users, install the full plugin with skills and slash commands:\n\n1. Add the Sanity marketplace:\n\n```\n/plugin marketplace add sanity-io/agent-toolkit\n```\n\n2. Install the plugin:\n\n```\n/plugin install sanity-plugin@sanity-agent-toolkit\n```\n\n3. Verify installation: Ask Claude Code: \"which skills do you have access to?\"\n\nYou should see the Sanity skills listed.\n\n4. Start using: Use natural language and skills activate automatically:\n\n\u003e Use the sanity-scaffold skill to create a blog post schema\n\nOr run `/sanity` to explore all capabilities.\n\n### Option 4: Manual installation\n\nInstall the context rules locally to teach your editor Sanity best practices:\n\n1. Create a rules directory: `mkdir -p .cursor/rules`\n2. Copy the contents of the `rules/` folder to your project's `.cursor/rules/` directory.\n3. (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_project` — create a new Sanity project\n- `create_documents_from_markdown` — map markdown to Sanity documents\n- `patch_document_from_json` — surgical edits to existing documents\n- `transform_image` — edit images with AI\n- `list_sanity_rules` / `get_sanity_rules` — load agent rules on demand\n\nSee the [full list of available tools](https://www.sanity.io/docs/compute-and-ai/mcp-server#k4ae680bb2e88).\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, and migrations |\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 \u0026 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### Context rules\n\nThese files provide passive knowledge to the AI, ensuring generated code follows Sanity standards.\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCore fundamentals\u003c/strong\u003e\u003c/summary\u003e\n\n- **`sanity-schema.mdc`**: The \"Data \u003e Presentation\" philosophy, `defineType` syntax, and shared fields.\n- **`sanity-groq.mdc`**: Performance rules, fragment reuse, and the \"Golden Rule\" of projections.\n- **`sanity-visual-editing.mdc`**: Implementation of Content Source Maps (Stega) and Presentation Tool.\n- **`sanity-typegen.mdc`**: TypeScript type generation from schema.\n- **`sanity-project-structure.mdc`**: File organization for Studio and monorepos.\n- **`sanity-get-started.mdc`**: Interactive 3-phase onboarding guide.\n- **`sanity-app-sdk.mdc`**: Building custom apps with the Sanity App SDK, React hooks, and real-time patterns.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eFramework rules\u003c/strong\u003e\u003c/summary\u003e\n\n- **`sanity-nextjs.mdc`**: App Router, `defineLive`, and metadata handling.\n- **`sanity-remix.mdc`**: React Router loaders and data fetching patterns.\n- **`sanity-svelte.mdc`**: SvelteKit hooks and loaders.\n- **`sanity-nuxt.mdc`**: Nuxt modules and `useSanityQuery`.\n- **`sanity-astro.mdc`**: Astro content collections and islands.\n- **`sanity-hydrogen.mdc`**: Shopify Hydrogen and Sanity Connect.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBest practices\u003c/strong\u003e\u003c/summary\u003e\n\n- **`sanity-migration.mdc`**: Strategies for importing HTML/Markdown from legacy CMSs.\n- **`sanity-image.mdc`**: Hotspots, LQIP, and the `urlFor` builder.\n- **`sanity-studio-structure.mdc`**: Organizing the Studio sidebar (singletons, groupings).\n- **`sanity-portable-text.mdc`**: Rendering rich text with custom components.\n- **`sanity-page-builder.mdc`**: Page builder patterns and block component rendering.\n- **`sanity-localization.mdc`**: Internationalization patterns.\n- **`sanity-seo.mdc`**: Metadata, sitemaps, and Open Graph.\n\u003c/details\u003e\n\n### Slash commands (Claude Code)\n\n| Command | What it does |\n| :--- | :--- |\n| `/sanity` | List available skills and help topics |\n| `/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```text\nsanity-io/agent-toolkit/\n├── AGENTS.md                      # Knowledge router \u0026 agent behavior\n├── README.md                      # This file\n├── .claude-plugin/                # Claude Code plugin configuration\n│   └── marketplace.json           # Plugin metadata and marketplace config\n├── .mcp.json                      # MCP server configuration\n├── commands/                      # Slash commands (Claude Code)\n│   ├── sanity.md                  # /sanity help\n│   ├── review.md                  # /review\n│   ├── typegen.md                 # /typegen\n│   └── deploy-schema.md           # /deploy-schema\n├── rules/                         # Context rules (.mdc)\n│   ├── sanity-schema.mdc          # Schema design patterns\n│   ├── sanity-groq.mdc            # GROQ query patterns\n│   ├── sanity-nextjs.mdc          # Next.js integration\n│   └── ...                        # Additional framework rules\n└── skills/                        # Agent skills (agentskills.io format)\n    ├── sanity-best-practices/     # Comprehensive Sanity skill\n    │   ├── SKILL.md\n    │   └── rules/                 # Individual rule files\n    ├── content-modeling-best-practices/\n    ├── seo-aeo-best-practices/\n    └── content-experimentation-best-practices/\n```\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/compute-and-ai/mcp-server)\n\n\n---\n\n## Contributing\n\nFound a better pattern? Missing a framework or best practice?\n\n1. Fork the repo.\n2. Update the relevant file:\n   - **Rules:** Edit `.mdc` files in `rules/`\n   - **Skills:** Edit rule files in `skills/\u003cskill-name\u003e/rules/`\n3. Run `npm run validate` to check skill validity.\n4. 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanity-io%2Fagent-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanity-io%2Fagent-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanity-io%2Fagent-toolkit/lists"}