Summary
Microsoft Clarity Data Export API: the dashboard numbers of a website for the last 1 to 3 days (sessions, users, engagement time, scroll depth, dead clicks, rage clicks, quick backs, script errors), in total or by page, traffic source, device, browser, OS or country. Read-only, one API token per project, 10 requests per project per day.
Guided setup
Connect Microsoft Clarity to Cursor in 2 minutes
Start a free trial on AnythingMCP Cloud, connect Microsoft Clarity in the guided setup, then add your MCP URL to Cursor. No code and no server to run.
No credit card · 7-day trial · Self-host alternative available
Try asking
Example prompts for Microsoft Clarity
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Microsoft Clarity, paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Microsoft Clarity + Cursor
Microsoft Clarity Data Export API: the dashboard numbers of a website for the last 1 to 3 days (sessions, users, engagement time, scroll depth, dead clicks, rage clicks, quick backs, script errors), in total or by page, traffic source, device, browser, OS or country. Read-only, one API token per project, 10 requests per project per day.
Prerequisites
See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:
CLARITY_API_TOKEN
Step 1 — Get credentials
Setting up takes about 2 minutes.
- Open your project at https://clarity.microsoft.com and go to Settings, Data Export. Only a project admin sees this page.
- Click Generate new API token, give it a name of 4 to 32 characters (letters, digits, hyphen, underscore, period; no spaces) and confirm.
- Copy the token (a long text in three parts separated by periods) into
CLARITY_API_TOKEN. To reach a second Clarity project, install the connector again with that project's token.
The daily limit decides how you work: Clarity allows 10 Data Export requests per project per day, counted for the whole project, not per token. The setup check uses one of them. Plan the calls: one total, one or two breakdowns, then answer from what you have. Never loop, never repeat a call "to be sure", and tell the user when a question would need several calls. An identical call within 30 minutes is answered from the cache and costs nothing. When the limit is reached Clarity answers 429 until the next day.
Where to start: microsoft_clarity_get_dashboard_insights for the totals and the top pages, browsers, devices and countries in a single call. Then one breakdown that fits the question:
microsoft_clarity_get_page_insights: per page URL, to find the pages with rage clicks, dead clicks or script errors.microsoft_clarity_get_traffic_source_insights: per Channel, Source and Medium, to compare search, ads, social and email visitors.microsoft_clarity_get_device_insights: per Device, Browser and OS, to find a platform where the site breaks.microsoft_clarity_get_country_insights: per country or region.microsoft_clarity_get_insights_by_dimensions: any one to three of Browser, Device, Country/Region, OS, Source, Medium, Campaign, Channel and URL, for example Campaign with Source.
Reading the answer: a list of blocks, each with metricName and information (rows). Every call returns all metrics; there is no metric filter. With dimensions, each row carries the dimension values next to the numbers. Counts are strings ("9554"), percentages are numbers, times are seconds and everything is in UTC. totalBotSessionCount is traffic Clarity recognised as bots: leave it out of visitor numbers. The frustration metrics report sessionsCount, the share of sessions with the signal and subTotal (how often it happened).
Limits: only the last 24, 48 or 72 hours counted back from the call (num_of_days 1, 2 or 3), no fixed dates and no older history; at most three dimensions; at most 1,000 rows per call and no paging, so on a busy site prefer one or two dimensions. For a trend, the user has to call once a day and keep the results.
Not covered: session recordings, heatmaps, funnels, the natural-language analytics query and the AI visibility reports. Microsoft's own Clarity MCP server reaches those through endpoints that are not a documented public API, and it is moving them from this token to a personal sign-in, so they are left out here.
Errors: 401 means the token is missing, mistyped or expired; 403 that Clarity does not accept this token (deleted or replaced in Settings, Data Export); 400 an unknown dimension or a day count outside 1 to 3; 429 the daily limit.
Step 2 — Install the adapter
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Step 3 — Add the connector in Cursor
Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (
https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide showsYOUR_SERVER_ID.
Cursor reads MCP servers from ~/.cursor/mcp.json. Add this entry:
{
"mcpServers": {
"anythingmcp": {
"url": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart Cursor.
- Open Cursor → Settings → MCP and check that
anythingmcpis listed and connected. - Start chatting — the agent can now call the
Microsoft Claritytools.
Available tools
| Tool | What it does |
|---|---|
microsoft_clarity_get_dashboard_insights | Read the project's Clarity dashboard totals for the last 1 to 3 days, without any breakdown: sessions, bot sessions, users and pages per… |
microsoft_clarity_get_page_insights | Read the Clarity metrics per page URL for the last 1 to 3 days: for every URL its sessions, engagement time, scroll depth and the… |
microsoft_clarity_get_traffic_source_insights | Read the Clarity metrics per traffic source for the last 1 to 3 days, broken down by Channel (such as OrganicSearch, Direct, Social… |
microsoft_clarity_get_device_insights | Read the Clarity metrics per device type (PC, Mobile, Tablet), browser and operating system for the last 1 to 3 days in one call: sessions… |
microsoft_clarity_get_country_insights | Read the Clarity metrics per visitor country or region for the last 1 to 3 days: sessions, engagement, scroll depth and frustration signals… |
microsoft_clarity_get_insights_by_dimensions | Read the Clarity metrics for the last 1 to 3 days broken down by one to three dimensions of your choice (Browser, Device, Country/Region… |
Example prompts
- "How many sessions and users did the site have in the last 3 days?"
- "Which pages had the most rage clicks and dead clicks yesterday?"
- "Compare search, social and email visitors by engagement time."
- "On which browser and device do script errors happen most?"
- "Which countries sent the most traffic in the last 2 days?"
FAQ
Where does the token come from? In your Clarity project, Settings, Data Export, Generate new API token. Only a project admin sees that page, and one token reads one project: install the connector again for a second project.
Why only a few calls a day? Clarity allows 10 Data Export requests per project per day, for the whole project, and the setup check uses one; an identical call within 30 minutes comes from the cache. Data covers only the last 1 to 3 days, at most three dimensions and 1,000 rows per call, so the AI plans one total and one or two breakdowns.
What is not covered? Session recordings, heatmaps, funnels and the AI visibility reports, which have no documented public API. The connector is read-only; nothing installs switched off.
Does Cursor support custom MCP servers on the free tier? Yes — MCP is available on Hobby, Pro and Business plans.
Next steps
Was this guide helpful?