create-agent-with-sanity-context

Configure Sanity Studio with Agent Context MCP for structured content access.

4|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/sanity-io/agent-context --skill create-agent-with-sanity-context
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: create-agent-with-sanity-context
Source: https://github.com/sanity-io/agent-context/tree/main/skills/create-agent-with-sanity-context
Command: npx skills add https://github.com/sanity-io/agent-context --skill create-agent-with-sanity-context

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build your AI agents with structured access to Sanity content via Agent Context MCP, enabling schema-aware reasoning over documents instead of free-form text.

Core Features & Use Cases

  • Provides guidance on Studio setup with the Sanity agent-context plugin and creation of Agent Context documents.
  • Explains MCP integration, authentication, tool discovery, and system prompts for production-grade agents.
  • Demonstrates framework-agnostic patterns (Next.js, SvelteKit, or Express) and best practices for semantic search and content access.

Quick Start

Install the agent-context plugin in your Studio, create an Agent Context document, and wire its MCP URL into your app to start building a Sanity-aware agent.

Frequently Asked Questions about create-agent-with-sanity-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I give my AI agent structured access to Sanity content?▼

To give an AI agent structured access to Sanity content, use Agent Context MCP to enable schema-aware reasoning over documents. This involves installing the @sanity/agent-context plugin in your Studio and wiring its MCP endpoint into your application.

What is Agent Context MCP and how does it work with Sanity?▼

Agent Context MCP is a protocol that provides AI agents with structured access to Sanity content. It works by using schema-aware reasoning over documents, allowing agents to query GROQ, follow references, and blend structured filters with semantic search instead of parsing free-form text.

Can I use Sanity Agent Context with frameworks other than Next.js?▼

Yes, you can use Sanity Agent Context with framework-agnostic integration patterns. The setup supports Next.js, SvelteKit, and Express, allowing you to wire the MCP URL into your preferred application architecture with appropriate authentication.

How do I set up a Sanity Studio for AI agent integration?▼

To set up a Sanity Studio for AI agent integration, install the agent-context plugin and create an Agent Context document. This configures the MCP endpoint and system prompts needed for production-grade agents to query your content.

Does my AI agent need to use GROQ to query Sanity via MCP?▼

Yes, using GROQ is fundamental when your AI agent queries Sanity via MCP. The Agent Context MCP enables schema-aware reasoning that empowers agents to execute GROQ queries, follow document references, and blend structured filters with semantic search.

What are the limitations of using free-form text for AI agents querying Sanity?▼

Using free-form text limits AI agents by preventing schema-aware reasoning over documents. By switching to Agent Context MCP, agents overcome this constraint and can follow references, apply structured filters, and execute GROQ queries for precise content retrieval.