Skip to main content
Cursor supports remote MCP servers. After you add Grain, the Cursor agent and Composer can list events, run queries, and analyze funnels inside the editor. This puts the data next to the code when you fix a conversion drop. Cursor reads MCP servers from a JSON file. There are two locations:

1. Create the configuration file

2. Add the Grain server

Paste this into mcp.json:
This is the whole configuration. Grain does client registration and PKCE itself. You do not add a client_id, a secret, or an Authorization header.

3. Reload and authorize

Open Cursor Settings → MCP (or Settings → Tools & MCP, depending on the version). The list shows grain with an Authorize button. Click it. Cursor opens the Grain consent screen in your browser. Pick the workspace, read the scopes, and click Authorize. A workspace on the consent screen is a tenant. Back in Cursor, the grain server shows a green “Connected” state and a tool count. The count is 11 tools when you grant all scopes.

4. Ask the agent a question

Open the Cursor chat or Composer and ask, for example, “@grain What is my top traffic source for the landing page I am editing?”. Cursor calls grain.query. Because Cursor knows the file you are in, it can filter by the correct page property. The @grain prefix tells Cursor that you want the Grain tools. Cursor picks the tool on its own in most cases. The prefix reduces round trips on an ambiguous question. The Cursor documentation on MCP is at cursor.com/docs/context/mcp.

Project rule

A short project rule routes analytics questions to Grain without the tool names in every prompt. The rule is optional. Create .cursor/rules.md:

What the assistant can do

Read Tools for every tool.

Troubleshooting