---
title: Sanity Context
description: Answer from your Sanity content.
url: "https://eve.dev/integrations/sanity-context"
docs_index: /llms.txt
type: extension
keywords:
  - sanity
  - context
  - knowledge base
  - dataset
  - groq
  - cms
  - content
  - mcp
---

> For an index of all documentation, see [/llms.txt](/llms.txt).

Extension integration for eve. Answer from your Sanity content.

## Install

Install the Sanity Context extension for eve:

```bash
eve add extension/sanity-context
```

The extension requires Node.js 24 or later and eve 1.0.0 or later. It connects the agent to a read-only Sanity Context MCP endpoint so it can answer from your Knowledge Bases and datasets. To query and edit a Sanity project instead, use the [Sanity connection](/integrations/sanity).

## Quick start

Create a Context MCP endpoint in the Sanity Dashboard, then create an organization API token with the Context permission at the Viewer role. Project tokens are refused. Add both to the agent's environment:

```bash title=".env.local"
SANITY_CONTEXT_MCP_URL=your_mcp_endpoint_url
SANITY_ORGANIZATION_TOKEN=your_organization_token
```

eve reads the extension's configuration when it builds the agent, so set these variables in the build environment too.

The registry mounts the extension under `agent/extensions/sanity-context.ts`:

```ts title="agent/extensions/sanity-context.ts"
import sanityContext from "@sanity/context-eve";

export default sanityContext({
  url: process.env.SANITY_CONTEXT_MCP_URL!,
  token: process.env.SANITY_ORGANIZATION_TOKEN!,
  description: "Describe what this endpoint's content covers.",
});
```

Replace `description` with what the endpoint's content covers. The model reads it to decide when to use the connection. The filename supplies the `sanity-context` namespace, so tools are named `sanity-context__sanity__initial_context`, `sanity-context__sanity__groq_query`, and so on. The extension's instructions tell the agent to load the endpoint's initial context before its first lookup.

## Configure

The tools depend on the endpoint's sources. The agent gets the endpoint's current tools on every run, so source changes in the Context app reach it without a redeploy:

- Knowledge Base sources: `knowledge_base_search` and `knowledge_base_read`
- Dataset sources: `groq_query`, `schema_explorer`, and `array_field_reader`
- Every endpoint: `initial_context`, which returns the Knowledge Base outline or dataset schema

All tools are read-only. If Sanity Context rejects the token, the connection's tools fail to load and the run continues without Sanity content. A missing or invalid token returns `401`, which eve reports as a connection that requires authorization. A project token, or an organization token without the Context grant, returns `403`, which eve reports with the server's error. Keep the token server-side, out of prompts and source control. Tool results contain your content, so anyone who can edit that content can influence what the agent does. See the [Sanity Context guide for eve](https://www.sanity.io/docs/context/connect-vercel-eve) for creating an endpoint and token, inlining the initial context into instructions, and troubleshooting.

## Related resources

- [Sanity connection](/integrations/sanity): Connect the Sanity MCP server to query and edit documents, inspect schemas, and manage releases in a Sanity project.

[Read the full extension documentation](https://www.sanity.io/docs/context/connect-vercel-eve)

---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)