Sanity

io.sanity.www由 www.sanity.io 发布v2.46.0更新于 Nov 4, 2026

Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules

已验证Streamable HTTP可网页运行知识与记忆开发者工具媒体与设计

概览

AI 生成的概览

远程 Sanity MCP 服务器,让助手直接访问你的 Sanity 项目内容、数据集、发布版本和 schema,并获取 Sanity 代理规则。

可以做什么
  • 查询与编辑内容:执行 GROQ 查询、创建草稿、修补、发布与取消发布文档
  • 管理 schema 与 Studio:部署或查看 schema、部署托管 Studio、列出项目关联的 Studio
  • 管理发布:创建和列出 Content Releases,并为发布创建版本文档
  • 使用 Sanity AI 生成和转换图片
  • 检索 Sanity 文档、按需加载代理规则,并提交工具反馈
适用场景
适合让助手在已有的 Sanity 项目中工作:编写 GROQ 查询、设计或部署 schema、编辑和发布内容、管理发布版本,且无需维护本地规则文件。
运行要求
需要在支持 MCP 的客户端中添加远程 HTTP 端点 mcp.sanity.io,并拥有 Sanity 账号和项目。默认使用 OAuth 认证,也可通过 Authorization Bearer 请求头使用令牌认证;Sanity CLI 可自动完成客户端配置。
安装前请注意
工具会写入项目:创建、修补、发布和取消发布文档,部署 schema 和 Studio。图片生成、图片转换以及带指令创建版本会消耗 Sanity AI 额度。OAuth 授权会让服务器访问你的 Sanity 账号,Bearer 令牌应视为机密。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sanity,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.sanity.www%2Fmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

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

README

[图片]

Sanity Agent Toolkit

Collection of resources to help AI agents build better with Sanity. Supports Cursor, Claude Code, Codex, VS Code, Lovable, v0, Replit, OpenCode, and any other editor/agent compatible with MCP or Agent Skills.


Features

  • MCP server: Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules.
  • 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.
  • Agent Plugin: plugin.json, skills/, and mcp.json components for any Agent Plugins-compatible client.
  • Claude Code plugin: MCP server, agent skills, and slash commands for Claude Code users. Available on the official Anthropic plugin marketplace.
  • Cursor plugin: MCP server, agent skills, and commands on the Cursor Marketplace.
  • Codex plugin: MCP server and agent skills for OpenAI Codex users.

Get started

Choose your path based on how you want agents to work with Sanity:

  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.
  2. Agent skills — Install best practices skills for Sanity, content modeling, SEO/AEO, and experimentation. Works with Cursor, Claude Code, and any Agent Skills-compatible agent.
  3. Plugin — Install the Sanity plugin for Cursor, Claude Code, or any Agent Plugins-compatible client. Bundles MCP server, agent skills, and commands.
  4. Manual installation — Copy the skill references locally for offline use. You'll need to update them yourself.

Option 1: Install MCP server (recommended)

Give agents direct access to Sanity projects and always up-to-date agent rules via the MCP server.

Quick install via Sanity CLI

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

bash
npx sanity@latest mcp configure

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

Client-specific instructions
Cursor

One-click install:
[Install MCP Server]

Or manually: Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → View: Open MCP Settings → + New MCP Server → add to mcp.json:

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

Run in terminal. Authenticate with OAuth on next launch:

bash
claude mcp add Sanity -t http https://mcp.sanity.io --scope user
Codex

Run in terminal. Authenticate with OAuth on next launch:

bash
codex mcp add Sanity --url https://mcp.sanity.io

Or manually add to ~/.codex/config.toml:

toml
[mcp_servers.Sanity]url = "https://mcp.sanity.io"
VS Code

Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → MCP: Open User Configuration → add:

json
{  "servers": {    "Sanity": {      "type": "http",      "url": "https://mcp.sanity.io"    }  }}
Lovable

Sanity is available as a prebuilt chat connector in Lovable:

  1. Open Connectors → Chat connectors
  2. Select Sanity
  3. Click Connect and sign in to authorize your Sanity account

In your next prompt, reference your Sanity project or ask the agent to read your schema.

See the Lovable MCP documentation or Sanity + Lovable guide for more details.

v0

In the prompt input field, click Prompt Tools → MCPs → Add New → Select Sanity → Authorize → Authenticate with OAuth.

Replit

Go to Integrations Page → 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.

OpenCode

Add to your opencode.json:

json
{  "$schema": "https://opencode.ai/config.json",  "mcp": {    "sanity": {      "type": "remote",      "url": "https://mcp.sanity.io",      "oauth": {}    }  }}

Then run: opencode mcp auth sanity

Other clients

For any MCP-compatible client, add https://mcp.sanity.io as the server URL.

If your client doesn't support remote MCP servers, use a proxy like mcp-remote:

json
{  "mcpServers": {    "Sanity": {      "command": "npx",      "args": ["mcp-remote", "https://mcp.sanity.io", "--transport", "http-only"]    }  }}

Authorization and troubleshooting

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.

See the Sanity MCP docs for authorization options and troubleshooting.

Option 2: Install Agent Skills

Install best practices skills that work with any Agent Skills-compatible agent.

bash
npx skills add sanity-io/agent-toolkit

See Option 3 for plugin installation.

Option 3: Install plugin

Install the Sanity plugin to get MCP server, agent skills, and commands. Available on the Claude Code marketplace, Cursor Marketplace, or from this repo as an Agent Plugin.

Claude Code

The Sanity plugin is listed on the official Anthropic plugin marketplace. The official marketplace (claude-plugins-official) is pre-registered when you start Claude Code — you do not need to add a custom marketplace.

Install from Claude Code:

/plugin install sanity@claude-plugins-official

If the plugin is not found, refresh the marketplace catalog and retry:

/plugin marketplace update claude-plugins-official

Then run /reload-plugins to activate without restarting.

Alternative: interactive install

  1. Run /plugin and open the Discover tab
  2. Search for Sanity
  3. Review what the plugin will install — commands, skills, hooks, and MCP servers — before confirming (Anthropic recommends reviewing plugin permissions and source before installing)
  4. Choose an installation scope:
    • User (default): all projects on this machine
    • Project: shared with collaborators via .claude/settings.json
    • Local: this repository only
  5. Run /reload-plugins to activate without restarting

Verify installation: Ask Claude Code: "which skills do you have access to?"

You should see the Sanity skills listed.

Start using: Use natural language and skills activate automatically:

Help me create a blog post schema in Sanity

Review my GROQ query and Next.js Visual Editing setup

Or run /sanity to explore all capabilities.

Cursor

Install from the Cursor Marketplace by running this in Cursor chat:

/add-plugin sanity

Verify installation: Ask Cursor: "which skills do you have access to?"

You should see the Sanity skills listed.

Start using: Use natural language and skills activate automatically:

Help me create a blog post schema in Sanity

Review my GROQ query and Next.js Visual Editing setup

Codex
  1. Add the Sanity marketplace:
bash
codex plugin marketplace add sanity-io/agent-toolkit
  1. Install the plugin from Codex's plugin directory (select the Sanity Agent Toolkit marketplace, then install Sanity).

  2. Restart Codex. Verify by asking: "which skills do you have access to?" — you should see the Sanity skills listed.

Option 4: Manual installation

Install the skill references locally to teach your editor Sanity best practices:

  1. Copy skills/sanity-best-practices/ to your project.
  2. (Recommended) Copy AGENTS.md to your project root to act as a knowledge router.

Capabilities

MCP tools

With MCP connected, your AI can use tools like:

  • query_documents — run GROQ queries directly
  • create_documents — create draft documents from structured content, or version documents when a release ID is provided
  • patch_documents — surgical edits to existing documents; published documents are edited by creating or updating drafts
  • publish_documents / unpublish_documents — manage document lifecycle
  • deploy_schema / get_schema — deploy MCP-managed schemas and inspect deployed schemas
  • deploy_studio — deploy a hosted Studio bound to an MCP-managed schema
  • create_release / list_releases — create and inspect Content Releases
  • create_version — create version documents for releases
  • generate_image / transform_image — AI image generation and editing
  • whoami — verify the authenticated Sanity user
  • get_project_studios — list Studio applications linked to a project
  • search_docs / read_docs — search and read Sanity documentation
  • list_sanity_rules / get_sanity_rules — load agent rules on demand
  • give_feedback — report MCP tool errors, missing capabilities, confusing output, or documentation issues

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.

See the full list of available tools.

Agent skills

Best practices skills that agents like Claude Code, Cursor, GitHub Copilot, etc. can discover and use automatically. Skills follow the Agent Skills format. See Option 2 for installation.

SkillDescription
sanity-best-practicesGROQ performance, schema design, Visual Editing, images, Portable Text, Studio, TypeGen, localization, migrations, and framework integration guides
content-modeling-best-practicesStructured content principles: separation of concerns, references vs embedding, content reuse
seo-aeo-best-practicesSEO/AEO with EEAT principles, structured data (JSON-LD), technical SEO patterns
content-experimentation-best-practicesA/B testing methodology, statistical foundations, experiment design
sanity-singletonsFirst-class singleton documents via document.singletons, Structure helpers, and migrating from userland or plugin-based singletons
sanity-form-component-suspenseFix custom Studio form components (inputs, fields, array items) that suspend without their own Suspense boundary, causing layout shift or blocking new documents

Getting started flow

The onboarding guide follows three phases:

  1. Studio & Schema — Set up Sanity Studio and define your content model
  2. Content — Import existing content or generate placeholder content via MCP
  3. Frontend — Integrate with your application (framework-specific)

Just say: "Get started with Sanity" to begin.

Slash commands (Claude Code)

CommandWhat it does
/sanityList available skills and help topics
/sanity-reviewReview code for Sanity best practices
/typegenRun TypeGen and troubleshoot issues
/deploy-schemaDeploy schema with verification

Repository structure

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).

text
sanity-io/agent-toolkit/├── AGENTS.md                      # Knowledge router & agent behavior├── README.md                      # This file├── plugin.json                    # Portable Agent Plugins v1 manifest├── mcp.json                       # Portable Agent Plugins v1 MCP configuration├── .agents/plugins/               # Codex marketplace│   └── marketplace.json           # Codex marketplace metadata├── .claude-plugin/                # Claude Code plugin configuration (distributed via claude-plugins-official)│   ├── plugin.json                # Plugin manifest (name: sanity)│   └── marketplace.json           # Marketplace manifest for repo-based discovery├── .codex-plugin/                 # Codex plugin configuration│   └── plugin.json                # Codex plugin manifest├── .cursor-plugin/                # Cursor plugin configuration (distributed via cursor.com/marketplace)│   ├── marketplace.json           # Cursor marketplace metadata│   └── plugin.json                # Per-plugin manifest├── .mcp.json                      # Legacy client MCP compatibility configuration├── assets/                        # Plugin branding│   └── logo.svg                   # Sanity logo for marketplace display├── commands/                      # Agent commands│   ├── sanity.md                  # /sanity help│   ├── sanity-review.md           # /sanity-review│   ├── typegen.md                 # /typegen│   └── deploy-schema.md           # /deploy-schema├── scripts/                       # Validation and CI scripts│   ├── validate-agent-plugin.mjs  # Validate manifests against the v1 JSON Schemas│   └── validate-cursor-plugin.mjs # Cursor plugin validator└── skills/                        # Agent skills (agentskills.io format)    ├── sanity-best-practices/     # Comprehensive Sanity skill    │   ├── SKILL.md               # Skill definition and quick reference    │   └── references/            # Canonical content (25 guides)    │       ├── get-started.md     # Onboarding guide    │       ├── nextjs.md          # Next.js integration    │       ├── groq.md            # GROQ patterns & performance    │       ├── schema.md          # Schema design & validation    │       └── ...                # See SKILL.md for full index    ├── content-modeling-best-practices/      # Modeling guidance + topic references    ├── seo-aeo-best-practices/               # SEO/AEO guidance + topic references    ├── content-experimentation-best-practices/ # Experiment design + stats references    ├── sanity-singletons/                    # First-class singleton documents (Studio 6.17+)    └── sanity-form-component-suspense/       # Suspense boundaries for custom form components

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.


Resources


Contributing

Found a better pattern? Missing a framework or best practice? Read the contributing guide for how skills work and what makes a good contribution, then:

  1. Fork the repo.
  2. Install dependencies with npm install.
  3. Make your changes in skills/<skill-name>/.
  4. Run npm run validate:all to check skill and plugin validity.
  5. Submit a PR.

Support


License: MIT

来源:README.md,提交 a80f36f

工具

0
该服务器需要登录,因此 SourceWeft 无法在没有账号的情况下读取其工具,也未收录。已连接账号所能看到的内容可能因账号及其权限而异。

版本历史

18
  1. v2.46.0最新Nov 4, 2026
  2. v2.45.2Oct 29, 2026
  3. v2.42.2Oct 26, 2026
  4. v2.42.1Oct 22, 2026
  5. v2.42.0Oct 20, 2026
  6. v2.41.0Oct 17, 2026
  7. v2.40.0Oct 2, 2026
  8. v2.39.0Oct 1, 2026
  9. v2.38.0Oct 1, 2026
  10. v2.37.0Sep 30, 2026
  11. v2.36.0Sep 26, 2026
  12. v2.35.4Sep 25, 2026
  13. v2.35.3Sep 23, 2026
  14. v2.35.2Sep 23, 2026
  15. v2.35.1Sep 22, 2026
  16. v2.35.0Sep 18, 2026
  17. v2.34.0Sep 17, 2026
  18. v2.33.0Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分