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 Microsoft Copilot in 2 minutes
Start a free trial on AnythingMCP Cloud, connect Microsoft Clarity in the guided setup, then add your MCP URL to Microsoft Copilot. 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 + Microsoft Copilot
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 Microsoft Copilot
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.
Microsoft Copilot uses MCP servers through agents built in Copilot Studio: you add AnythingMCP to an agent as a tool, then publish the agent to Microsoft 365 Copilot and Teams. Copilot Studio connects from Microsoft's cloud over Streamable HTTP, which AnythingMCP supports.
- In Copilot Studio, open your agent (or create one), go to Tools and choose Add a tool → New tool → Model Context Protocol.
- Enter a Server name (for example
AnythingMCP), a Server description that says what the connector does, and the Server URLhttps://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID. Copilot Studio uses the description to decide when to call the server. - Under authentication, choose API key, set Type to Header and the header name to
X-API-Key, then select Create. - In Add tool, choose Create a new connection, paste an MCP API key from AnythingMCP (MCP Servers → your server → API keys) and select Add to agent.
- Try it in the agent's Test pane: ask for something that needs the
Microsoft Claritytools. - Select Publish, then Channels → Microsoft 365 and Microsoft Teams, keep Make agent available in Microsoft Copilot selected and choose Add channel. See agent in Teams installs it for you; in Microsoft 365 Copilot, type @ and pick the agent.
Prefer per-user sign-in? Choose OAuth 2.0 → Dynamic discovery instead of an API key: each user then signs in to AnythingMCP the first time the agent calls it.
Self-hosting? Use your instance's public HTTPS address instead of https://cloud.anythingmcp.com. Copilot Studio connects from Microsoft's cloud, so localhost does not work.
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.
Which Copilot is this for? Microsoft 365 Copilot at work, through agents built in Copilot Studio. The Microsoft Copilot app for personal accounts has no option to add your own MCP server.
What do I need? A work account with access to Copilot Studio (a license or a trial) to build the agent. People who use it in Microsoft 365 Copilot or Teams need access to the agent: share it with them, or ask an admin to publish it to the organization. If your organization applies data policies to Power Platform connectors, they cover MCP servers too.
The agent doesn't call the tools. Check that the header name is exactly X-API-Key and that the key belongs to the same MCP server as the URL, and make the server description specific: Copilot Studio uses it to decide when to call the server. Publish the agent again after each change; in an open chat, type "start over" to get the new version.
Next steps
Was this guide helpful?