# create-agent-with-sanity-context

Walks through wiring an AI agent to Sanity content via a Sanity Context MCP endpoint, covering auth and system prompt setup.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1200 installs · ★ 7
- Author: sanity-io
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/sanity-io/context/tree/HEAD/skills/create-agent-with-sanity-context/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/create-agent-with-sanity-context

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/create-agent-with-sanity-context/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/create-agent-with-sanity-context/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/create-agent-with-sanity-context/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/create-agent-with-sanity-context/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install sanity-io/context create-agent-with-sanity-context
```

2. **Manually: put the files in place**
- File: `.github/skills/create-agent-with-sanity-context/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/sanity-io/context --path skills/create-agent-with-sanity-context
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/create-agent-with-sanity-context/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add sanity-io/context --skill create-agent-with-sanity-context -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/sanity-io/context/tree/HEAD/skills/create-agent-with-sanity-context/SKILL.md

## When to use it
- 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
- 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

## Similar
- [setup-matt-pocock-skills](https://affpapa.org/en/nevibecode/skills/setup-matt-pocock-skills.md) — skill · 1052851 installs
- [ask-matt](https://affpapa.org/en/nevibecode/skills/ask-matt.md) — skill · 766587 installs
- [to-tickets](https://affpapa.org/en/nevibecode/skills/to-tickets.md) — skill · 711230 installs
- [writing-plans](https://affpapa.org/en/nevibecode/skills/writing-plans.md) — skill · 282859 installs
- [caveman-review](https://affpapa.org/en/nevibecode/skills/caveman-review.md) — skill · 411800 installs
- [caveman-compress](https://affpapa.org/en/nevibecode/skills/caveman-compress.md) — skill · 411500 installs

From the same set: [sanity-io/context](https://affpapa.org/en/nevibecode/by/sanity-io/context.md) — 3 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
