Skip to main content
The GrainQL MCP server works with every Claude surface: the web app, the desktop app, and the Claude Code CLI. The OAuth flow is the same on each one. You need an active GrainQL tenant and a Claude plan that supports custom connectors. Custom connectors are available on Claude Free, Pro, Max, Team, and Enterprise. A Free account is limited to one custom connector.

1. Open the connector settings

In Claude, click your profile, then Settings → Connectors. On the Team and Enterprise plans, an owner adds the connector for the organization under Organization settings → Connectors. Members then connect one by one.

2. Add a custom connector

Click + Add connector, then Add custom connector. On Team and Enterprise the path is Add → Custom → Web.

3. Paste the GrainQL endpoint

Do not change Advanced settings. GrainQL registers the client with RFC 7591 Dynamic Client Registration. You do not enter a client ID or a secret.

4. Authorize in the browser

Claude opens the GrainQL consent screen. Choose All workspaces in my account, or Select workspaces and tick the ones that Claude will see. Read the scopes, and click Allow access. A workspace on the consent screen is a tenant. With all workspaces, name the workspace in your prompt, or Claude asks which one you mean. Then you return to Claude with the connector enabled.

5. Turn it on in a chat

In a conversation, click the + button, open Connectors, and switch GrainQL on. Then ask a question, for example “What were my top 5 traffic sources last week?”. Claude calls grain_query, describes the result, and cites the rows it used.
The first tool call of a new session is the slowest. Claude discovers the tool surface on that call. Later calls are faster.

Claude Code

Claude Code has a CLI for MCP servers. One command adds the GrainQL server.
  1. Install Claude Code. If you have it, make sure that you have a recent version. Remote HTTP transport is a recent addition.
  2. Add the GrainQL server.
    Add --scope user to make GrainQL available in every project. Add --scope project to write the connection to .mcp.json for your team.
  3. Authenticate. Inside Claude Code, run /mcp, select grain, then Authenticate. The CLI opens the GrainQL consent screen in your browser. Approve the tenant. Then control returns to the terminal.
  4. Ask Claude Code a question that needs GrainQL data, for example “Which pages had the biggest drop in conversions this week versus last?”. Claude Code picks the tool (grain_query_compare or grain_segment_compare), runs it, and summarizes the result.
These commands manage the server:
list shows every server. get grain shows the GrainQL server. remove grain deletes it. The Claude Code documentation on MCP is at code.claude.com/docs/en/mcp.

What the assistant can do

With all three scopes granted, Claude has twelve tools. These prompts are a good start: The digest result includes the GrainQL surprise hints (concentration, volatility, rank changes), so the summary names anomalies, not only numbers. Run the tracking audit before an investigation, so that you know the data is complete. Read Tools for every tool.

Troubleshooting