Data Sources Beginner

Sanity MCP Integration

2 min read Updated June 05, 2026
Content documents, datasets, types, and publishing activity from Sanity, read-only through the planner during AI analyses.

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

  1. Open Data Sources in the clariBI sidebar.
  2. Click Add data source.
  3. Open the MCP Servers tab.
  4. Click the Sanity card.
  5. Click Authorize with Sanity.
  6. Sign in to Sanity in the popup window and grant the requested read scopes.
  7. Back in clariBI, give your data source a name.
  8. 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

ErrorCauseFix
"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.

Related articles

Related Articles

Data Sources Beginner

Foqal MCP Integration

Tickets, request topics, resolution timelines, and CSAT, NPS, and CES scores from Foqal's Slack and…

5 min read
Data Sources Intermediate

Apideck MCP Integration

Normalized records across Accounting, CRM, HRIS, ATS, File Storage, E-commerce, and Issue Tracking …

5 min read
Data Sources Beginner

Hugging Face MCP Integration

Public Hugging Face Hub data: model, dataset, and Space search, research-paper search, repository d…

5 min read

Still Need Help?

Can't find what you're looking for? Our support team is here to help you succeed with clariBI.