create-agent-with-sanity-context — Claude Code skill: what it does
Walks through wiring an AI agent to Sanity content via a Sanity Context MCP endpoint, covering auth and system prompt setup.
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a claude-codeWhat create-agent-with-sanity-context does
The skill guides setting up an agent on top of Sanity Context: creating an MCP endpoint in the Context app, picking a retrieval mode (querying a dataset with GROQ, or reading a prebuilt Knowledge Base), and feeding the initial context into the agent's system prompt. The schema is handed to the agent and it's taught GROQ syntax, but domain knowledge has to come from an Instructions field and, optionally, a separate system prompt.
Running the agent needs three things: the MCP endpoint URL, an organization API token scoped to Context (project tokens won't work), and an API key from any LLM provider. That organization token is a server-side secret and must stay off the browser. An org admin has to turn Context on from the Labs page in Manage first.
One detail worth knowing before setup: if an endpoint has both a dataset source and Knowledge Base sources attached, the dataset quietly wins and the Knowledge Bases get ignored.
What it helps with
- wire an MCP endpoint for agent access to Sanity content
- choose between GROQ querying and a Knowledge Base mode
- authenticate an LLM agent against a Sanity dataset with a bearer token
- write Instructions and a system prompt tailored to the domain
- add client-side tools and Insights tracking to the agent
Example prompts for the agent
- Set up a Sanity Context MCP endpoint for my dataset
- Build a chatbot on top of Sanity Context in GROQ mode
- Wire up a Knowledge Base source for my Sanity agent
How to install create-agent-with-sanity-context
1Skills CLI (Vercel)
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a claude-code2Manually: put the files in place
~/.claude/skills/create-agent-with-sanity-context/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/create-agent-with-sanity-context/
1Skills CLI (Vercel)
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a codex2Manually: put the files in place
.agents/skills/create-agent-with-sanity-context/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a cursor2Manually: put the files in place
.cursor/skills/create-agent-with-sanity-context/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install sanity-io/context create-agent-with-sanity-context2Manually: put the files in place
.github/skills/create-agent-with-sanity-context/SKILL.md1Skills CLI (Vercel)
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a gemini-cli2Platform CLI
gemini skills install https://github.com/sanity-io/context --path skills/create-agent-with-sanity-contextManually: put the files in place
.devin/skills/create-agent-with-sanity-context/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about create-agent-with-sanity-context
How do I install create-agent-with-sanity-context in Claude Code?
Run npx skills add sanity-io/context --skill create-agent-with-sanity-context -a claude-code; the skill lands at ~/.claude/skills/create-agent-with-sanity-context/SKILL.md.
What does create-agent-with-sanity-context do?
It walks through building an AI agent with structured access to Sanity content, covering MCP endpoint setup, picking a retrieval mode, and shaping the agent's system prompt.
How do GROQ mode and Knowledge Base mode differ?
GROQ mode has the agent query a live dataset guided by the schema, which fits structured content like catalogs or FAQs. Knowledge Base mode reads a prebuilt index spanning datasets, websites, and files, which suits answers scattered across prose.