Sanity is a headless content platform where structured content lives in datasets and is queried by any front end. Connecting Sanity to clariBI makes the content itself measurable: how much exists, what type, and how often it changes.
Why connect Sanity
Editorial and content operations rarely show up in analytics, so questions about publishing cadence or content inventory mean manual counting.
With Sanity connected, you can ask "How many articles did we publish per month this year?", "How many documents are still in draft?", or "Which content types have the most stale entries?" and the AI engine reads it live.
How the connection works
clariBI talks to Sanity through its hosted MCP server at https://mcp.sanity.io. Authentication uses an OAuth flow that clariBI registers itself for (no developer console setup on your side). Tokens stay encrypted server-side and never leave clariBI in clear form.
sequenceDiagram
actor U as You
participant C as clariBI
participant V as Sanity
U->>C: Click Authorize with Sanity
C->>V: Open OAuth authorization
V-->>U: Grant read access?
U->>V: Approve
V-->>C: Authorization code
C->>V: Exchange code for tokens
V-->>C: Access + refresh tokens
C->>C: Encrypt and store credentials
C-->>U: Connection ready
Available tools
clariBI exposes the read-only Sanity tools that the vendor's MCP server publishes at connection time. Write operations (create, update, delete, send, refund) are filtered out by a name-pattern blocklist before any tool reaches the analysis engine, so connecting Sanity cannot modify data on the vendor side.
The exact tool inventory depends on the Sanity features your account has access to. After connecting, try a few natural-language questions to see what Sanity data clariBI can pull.
Data flow during analysis
When you ask a question that maps to Sanity, the AI engine routes to the right tool, reads the result, and pairs the answer with a chart you can pin to a dashboard.
sequenceDiagram
actor U as You
participant C as clariBI
participant AI as AI engine
participant V as Sanity
U->>C: Ask a question about structured content data
C->>AI: Plan the analysis
AI->>V: Call the right tool
V-->>AI: Tool result
AI->>AI: Summarize and chart
C-->>U: Answer plus visual
Setting up the connection
- Open Data Sources in the clariBI sidebar.
- Click Add data source.
- Open the MCP Servers tab.
- Click the Sanity card.
- Click Authorize with Sanity.
- Sign in to Sanity in the popup window and grant the requested read scopes.
- Back in clariBI, give your data source a name.
- Click Finish.
Permissions and data access
clariBI connects through Sanity's OAuth flow and inherits the connected user's project and dataset access. The catalog exposes read tools only (querying documents and types); clariBI never creates, edits, or deletes content. Disconnect anytime from Settings → Integrations in clariBI.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| "No documents returned" | The connected user cannot see the dataset, or the project uses a private dataset the token lacks access to. | Confirm the project and dataset in Sanity and that your user has read access. |
| "Counts exclude drafts" | Draft documents are stored separately from published ones in Sanity. | Ask the analysis to include drafts explicitly when you want both. |