Setup
Cursor reads MCP servers from a JSON file. You pick where to put it:- Global —
~/.cursor/mcp.jsonin your home directory. Available in every project you open. - Project —
.cursor/mcp.jsonin the repo root. Commit it if you want every teammate to inherit the same MCP servers.
Add the Grain server
Paste this into That’s the whole config. Grain handles client registration and PKCE automatically — you do not need to supply a
mcp.json:client_id, a secret, or an Authorization header.Reload and authorize
Open Cursor Settings → MCP (or Settings → Tools & MCP depending on version). You should see grain listed with an Authorize button. Click it.Cursor opens Grain’s consent screen in your browser. Pick the workspace, review the scopes, and click Authorize.
Back in Cursor, the grain server switches to a green “Connected” state and the tool count appears (11 tools if you granted all scopes).
Project rule for consistent prompts
Adding a short project rule helps Cursor route analytics questions to Grain without you having to remember the tool names. Create.cursor/rules.md:
Good prompts to try
Before touching a checkout flow
Before touching a checkout flow
Before I refactor this checkout page, show me the Track for checkout_started → checkout_completed over the last 30 days and flag the biggest drop‑off step.
Uses grain.track.analyze.Tag audit after a deploy
Tag audit after a deploy
Did my last deploy break any events? Compare event volumes this week to last week and list anything that dropped more than 50%.Uses
grain.query.compare.Debugging a single user report
Debugging a single user report
A user says signup is broken on Safari. Count signup_failed events in the last 24h, grouped by browser, and tell me if Safari is an outlier.
Uses grain.query with a browser group‑by.Troubleshooting
“Server failed to start” in Cursor's MCP panel
“Server failed to start” in Cursor's MCP panel
Almost always a JSON typo. Validate
mcp.json with a linter — a trailing comma is the usual suspect. Then click Reload in the MCP panel.No Authorize button appears
No Authorize button appears
Tools return “insufficient scope”
Tools return “insufficient scope”
You probably approved
mcp:read only. Revoke Grain from Settings → Connectors and reconnect; the consent screen will re‑prompt for the full scope set.Want to share the config with your team?
Want to share the config with your team?
Next steps
Tool reference
Every tool Grain exposes and what it returns.
Security & scopes
How to audit and revoke connections.