Connector guide4-minute read6 MCP tools7 languages

Microsoft Clarity MCP Server for Claude & ChatGPT

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.

HCBy HelpCode teamUpdated 4 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Microsoft Clarity

Microsoft Clarity

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.

tools

6

Region

INTL

Category

Analytics

Authentication

Bearer Token

Required env vars

CLARITY_API_TOKEN
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

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 Claude, ChatGPT or Copilot in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Microsoft Clarity in the guided setup, then add your MCP URL to your AI assistant. 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.

Microsoft Clarity · live via MCP
Share
Opus 4.7

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

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.

Setup

Setting up takes about 2 minutes.

  1. Open your project at https://clarity.microsoft.com and go to Settings, Data Export. Only a project admin sees this page.
  2. Click Generate new API token, give it a name of 4 to 32 characters (letters, digits, hyphen, underscore, period; no spaces) and confirm.
  3. 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.

Prerequisites: CLARITY_API_TOKEN

Install the connector locally

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

Open http://localhost:3000/connectors/store, pick Microsoft Clarity and paste in the env vars listed under Prerequisites.

Available tools

ToolWhat it does
microsoft_clarity_get_dashboard_insightsRead 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_insightsRead 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_insightsRead 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_insightsRead 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_insightsRead 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_dimensionsRead 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?"

Next steps

Was this guide helpful?

Connect Microsoft Clarity to Claude, ChatGPT or Copilot in 2 minutes

Start a free trial on AnythingMCP Cloud, connect Microsoft Clarity in the guided setup, then add your MCP URL to your AI assistant. No code and no server to run.

Related guides

Connectors

Connect Microsoft Clarity to ChatGPT via MCP

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.

Connectors

Connect Microsoft Clarity to Claude via MCP

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.

Connectors

Connect Microsoft Clarity to Microsoft Copilot via MCP

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.

Connectors

Connect Microsoft Clarity to Cursor via MCP

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.

Connectors

Connect Microsoft Clarity to Gemini CLI via MCP

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.

Connectors

Connect Microsoft Clarity to Meta Muse via MCP

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.