Skip to main content
Grain’s MCP server works with every Claude surface Anthropic ships: the web app, the desktop app, and the Claude Code CLI. Pick the one you use most — the OAuth flow is identical under the hood.
You’ll need: an active Grain workspace and whatever plan your Claude client requires. Custom connectors are available on Claude Free, Pro, Max, Team, and Enterprise — Free accounts are limited to a single custom connector.

Claude.ai (web) and Claude Desktop

The web and desktop apps share the same connector UI.
1

Open the connector settings

In Claude, click your profile, then Settings → Connectors. On Team and Enterprise plans, an owner adds the connector org‑wide under Organization settings → Connectors, and members connect individually afterwards.
2

Add a custom connector

Click + Add connector, then Add custom connector (on Team/Enterprise: Add → Custom → Web).
3

Paste the Grain endpoint

https://grainql.com/api/mcp
Leave Advanced settings alone — Grain handles client registration automatically via RFC 7591. You don’t need to provide a client ID or secret.
4

Authorize in the browser

Claude opens Grain’s consent screen. Pick the workspace you want Claude to see, review the scopes, and click Authorize. You’ll see a 7‑day preview of the workspace so you know exactly what’s being shared.
You land back in Claude with the connector enabled.
5

Turn it on in a chat

In any conversation, click the + button, open Connectors, and toggle Grain on. Ask something like:
What were my top 5 traffic sources last week?
Claude will call grain.query, narrate the result, and cite the rows it used.
The first tool call of a fresh session is the slowest — Claude is discovering the tool surface. Follow‑ups are instant.

Claude Code

Claude Code ships a first‑class CLI for MCP servers. One command gets you connected.
1

Install Claude Code

npm install -g @anthropic-ai/claude-code
If you already have it, make sure you’re on a recent version — remote HTTP transport is relatively new.
2

Add the Grain server

claude mcp add --transport http grain https://grainql.com/api/mcp
Add --scope user to make Grain available across every project, or --scope project to commit the connection to .mcp.json for your whole team.
3

Authenticate

Inside Claude Code, run:
/mcp
Select grain, then Authenticate. The CLI pops Grain’s consent screen in your browser, you approve the workspace, and control returns to the terminal.
4

Try it

Ask Claude Code a question that needs Grain data:
Which pages had the biggest drop in conversions this week vs last?
It will pick the right tool (grain.query.compare or grain.segment.compare), run it, and summarize.

Useful CLI commands

# Confirm the server is listed
claude mcp list

# Inspect just Grain
claude mcp get grain

# Remove it
claude mcp remove grain

What Claude can actually do

With all three scopes granted, Claude has eleven tools at its disposal. A few high‑leverage prompts to try:
What events do I track, and which dimensions can I break them down by?
Uses grain.events.list + grain.dimensions.discover. Great first prompt on a brand new workspace.
Give me a digest of what changed this week — metrics, sources, and anything that looks surprising.
Uses grain.query.digest. The result includes Grain’s surprise‑detection hints (concentration, volatility, rank changes) so the narration calls out anomalies, not just numbers.
Checkout conversions fell Tuesday. Compare the users who dropped against those who converted and tell me what’s different.
Uses grain.segment.compare + grain.sessions.cluster under the hood.
Is my analytics tag firing correctly?
Uses grain.integration.status. Handy before an investigation so you know the data itself is trustworthy.

Troubleshooting

Claude Desktop needs a default browser. On macOS, check System Settings → Desktop & Dock → Default web browser. On the web, make sure popups are allowed for claude.ai.
You probably picked a workspace you don’t have access to. Revoke the connection from Grain’s settings and reconnect — the consent screen will only show workspaces you actually belong to.
Grain filters tools by granted scope. If grain.segment.compare isn’t showing up, reconnect and approve the mcp:investigate scope.
Claude Code auto‑reconnects with exponential backoff (up to 5 attempts). If it gives up, run /mcp → select grain → Reconnect.

Next steps

Tool reference

Every tool, its inputs, and what scope it requires.

Security & scopes

How tokens, scopes, and revocation work.

References