Set up Sanity in Metorial for Claude, ChatGPT and Cursor
Share Sanity with your team in Claude, ChatGPT and Cursor through Metorial: API token sign-in, 9 tools (5 read-only).
To give your team Sanity in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Sanity integration in a Metorial portal, and each person connects with an API token. Agents can query and mutate Content Lake documents, discover projects and datasets, read document revisions, manage datasets and document webhooks, upload assets, download original dataset files, and read personal user identity. The integration has 9 tools, 5 read-only, 1 write and 3 destructive, plus 1 trigger.
What you'll learn
- How an admin shares Sanity in a portal and how each person connects
- What Sanity asks for when you connect, and where to find it
- How to keep the 5 read-only tools and reject the other 4
Before you start
- A portal with at least one access group
- An API token from Sanity for each person, or one for a shared connection
- For the CLI steps: the Metorial CLI, signed in to your portal
Sign-in method
| Method | Type | What a person provides |
|---|---|---|
| API Token | API token | token |
API Token
To connect, a person enters:
token: A Sanity robot token or personal token. Robot tokens are recommended for integrations. Generate one at Settings > API > Tokens in your project management console.
Setup settings
Setup also asks for:
projectId: Your Sanity project ID. Found in your project settings at sanity.io/manage.dataset(optional): The dataset name to operate on (e.g., "production", "staging").apiVersion(optional): API version date string (e.g., "2024-01-01"). Determines API behavior and response format.
Admin: share Sanity in a portal
In the dashboard
Open Shared Resources
Open Workforce, choose the portal, and select Shared Resources under Access.
Share a new integration
Select Share a Resource, then New Integration, and choose Sanity. For how members connect, choose Each person connects so everyone enters their own API token, or Shared connection to enter one API token for everyone.
Limit the tools
Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Sanity.
Choose who gets it
Add the access groups that should see Sanity. When a person asks for access from the portal, the request appears under Access Requests.
With the CLI
The CLI cannot create the per-user Sanity integration. Once it exists, check which groups have it:
Employee: connect Sanity
In the portal
Open Sanity in the catalog
Sign in to your portal and open Sanity. The status reads Available.
Authenticate
Under Quick setup, select Authenticate. In the setup window, enter your API token (token).
Confirm
The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.
With the CLI
catalog search prints the catalog item ID.
Add it to your AI client
metorial install adds your Sanity connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.
For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.
Make it read-only
Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the 5 read-only tools, such as get_document and list_projects, and lose the write tool upload_asset, and the 3 destructive tools, such as manage_datasets or manage_webhooks.
Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.
Check it worked
metorial tools lists the 9 tools, minus any you rejected. list_projects takes no input. It discovers accessible native project IDs and names, or read one project by projectId.
To see every input a tool takes, run metorial schema <integration-id> <tool-key>.
Tools
Read-only tools (5)
query_documents: Query a selected dataset with GROQ. Needsquery.list_projects: Discover accessible native project IDs and names, or read one project by projectId.get_document: Read exact current document IDs or one historical revision using current access permissions.download_asset: Prepare the original file or image from an exact Content Lake asset document.get_current_user: Read the actual authenticated personal user profile.
Write tools (1)
upload_asset: Upload bounded base64 image/file bytes into a selected dataset. NeedsassetTypeandcontentBase64.
Destructive tools (3)
manage_webhooks: List, read, create, or delete GROQ-powered document webhooks in an accessible project. Needsaction.mutate_documents: Submit document mutations in one native transaction. Needsmutations.manage_datasets: List datasets, read one dataset, create a dataset, or permanently delete a dataset. Needsaction.
Triggers
Sanity has 1 trigger, which fire on events in Sanity:
document_change: Triggers when a document in the Content Lake is created, updated, or deleted.
Next steps
- Claude Code, Cursor, Codex and ChatGPT: connect each client to your portal and use Sanity there
- Tool permissions: tool filters and what employees see
- Sanity on metorial.com: the integration overview