.Microsoft Clarity MCP Server
This MCP server lets AI agents query Microsoft Clarity behavioral UX data and run related diagnostics.
Retrieve high-level UX insights: sessions, rage clicks, dead clicks, quick backs, excessive scrolling, JS errors, and quota status.
Break down frustration metrics by URL, device, browser, OS, or country/region.
Analyze JavaScript runtime errors and error clicks across browsers and operating systems.
Run diagnostics for token format, project configuration, cache integrity, and remaining daily API quota.
List and read bundled operational skill playbooks such as
ux-triage,setup-clarity-token, andfrustration-audit.Check PyPI for newer versions and upgrade instructions.
Benefit from local caching and stale-cache fallback to protect the 10-requests-per-project-per-day Clarity quota.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@.Microsoft Clarity MCP Server show me rage clicks and dead clicks from the last 3 days"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Microsoft Clarity MCP Server (microsoft-clarity-mcp)
FastMCP server exposing Microsoft Clarity's Data Export API for behavioral UX analysis, rage clicks, dead clicks, quick backs, excessive scrolling, and JavaScript runtime errors.
Companion behavioral diagnostics engine to Google Analytics and Search Console for AI agents.
1. Quickstart
Run directly without installing via uvx (Python) or npx (Node):
Via Python (uvx)
uvx microsoft-clarity-mcpVia Node (npx)
npx microsoft-clarity-mcpRelated MCP server: KrystalView MCP Server
2. MCP Client Configuration
Add to your MCP client config (claude_desktop_config.json, cursor.json, or Antigravity/OpenCode):
{
"mcpServers": {
"microsoft-clarity": {
"command": "uvx",
"args": ["microsoft-clarity-mcp"],
"env": {
"CLARITY_API_TOKEN": "your_clarity_api_token_here"
}
}
}
}Or using npx:
{
"mcpServers": {
"microsoft-clarity": {
"command": "npx",
"args": ["-y", "microsoft-clarity-mcp"],
"env": {
"CLARITY_API_TOKEN": "your_clarity_api_token_here"
}
}
}
}3. Authentication & API Tokens
Microsoft Clarity secures data export via static JWT Bearer tokens:
Log in to Microsoft Clarity.
Open your project dashboard.
Navigate to Settings -> Data Export.
Click Generate new API token (provide a name between 4 and 32 alphanumeric characters, e.g.
clarity-agent).Copy the generated token and configure
CLARITY_API_TOKEN.
4. Rate-Limit Defense & Persistent Caching
Daily Quota: Microsoft Clarity strictly allows 10 requests per project per day.
Automatic Cache: To safeguard user quota from runaway agent loops, all responses are cached locally on disk at
~/.clarity_mcp/cache.jsonwith a 1-hour TTL (configurable viaCLARITY_CACHE_TTL).Stale Cache Fallback: If the daily 10-request quota is reached, the server automatically serves stale cached data with an explicit warning, ensuring your agents remain operational without hard crashing.
Quota Transparency: Every tool response includes metadata detailing
calls_used_today,remaining_today, anddaily_limit.
5. Tools
Tool | Parameters | Description |
|
| High-level behavioral friction metrics: session counts, rage clicks, dead clicks, quick backs, excessive scroll, and JS errors. |
|
| Ranks friction severity broken down across URL paths, devices, browsers, operating systems, or countries. |
|
| JavaScript runtime exceptions and error clicks grouped across browsers and operating systems. |
|
| Diagnostic utility checking token format, cache integrity, and remaining daily API quotas. |
| (none) | Lists dynamic skill playbooks bundled with the server. |
|
| Fetches operational playbooks (e.g. |
| (none) | Queries PyPI for newer versions and upgrade commands. |
6. Telemetry & Privacy
This package includes anonymous usage telemetry to ensure reliability and detect runtime bugs across different client harnesses. Telemetry adheres strictly to Schema v2:
Opt-Out: Strictly respects
DO_NOT_TRACK=1,DISABLE_TELEMETRY=1, orCLARITY_TELEMETRY=false.Zero PII: No user URLs, personal identifiers, or authentication tokens are ever captured.
License
MIT License. Copyright (c) 2026 Surendran B.
Available Tools
7 toolscheck_for_updatesA
Check PyPI for newer versions of microsoft-clarity-mcp and get upgrade instructions.
Inputs: no named parameters. Returns: result
doctorB
Validate Microsoft Clarity credentials, project configurations, on-disk cache, and remaining daily request quota.
Inputs: token, project_id. Returns: result
get_frustration_breakdownA
Break down user frustration metrics (rage clicks, dead clicks, quick backs) across a specific dimension.
Args: project_id: Microsoft Clarity Project ID. dimension: Breakdown dimension: 'URL', 'Device', 'Browser', 'OS', or 'Country/Region'. Defaults to 'URL'. num_of_days: Lookback window in days (1, 2, or 3; defaults to 3). token: Optional Clarity API token.
Returns: Structured JSON ranking dimension values by user frustration severity.
Inputs: project_id (required), token, dimension, num_of_days. Returns: result
get_js_errorsA
Analyze JavaScript errors and unhandled exceptions across browsers and operating systems.
Args: project_id: Microsoft Clarity Project ID. num_of_days: Lookback window in days (1, 2, or 3; defaults to 3). token: Optional Clarity API token.
Returns: Structured JSON breakdown of JavaScript script errors and error clicks by Browser and OS.
Inputs: project_id (required), token, num_of_days. Returns: result
get_ux_insightsA
Retrieve high-level UX insights, frustration rates, and technical health for a Clarity project.
Args: project_id: Microsoft Clarity Project ID (e.g., 'yz5idaioq2'). num_of_days: Lookback window in days (1, 2, or 3 days; defaults to 3). token: Optional Clarity API token. If omitted, uses CLARITY_API_TOKEN environment variable.
Returns: Structured JSON summary of session overview, rage clicks, dead clicks, quick backs, excessive scrolling, JS errors, and quota status.
Inputs: project_id (required), token, num_of_days. Returns: result
skill_readB
Load a dynamic skill playbook by name from GitHub (with local fallback).
Args: name: Skill name (e.g., 'ux-triage', 'setup-clarity-token', 'frustration-audit').
Inputs: name (required). Returns: result
skills_listA
List available dynamic skill playbooks bundled with microsoft-clarity-mcp.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The three data tools overlap somewhat: get_ux_insights already surfaces rage clicks, dead clicks, quick backs, and JS errors that get_frustration_breakdown and get_js_errors cover in more depth. However, granularity distinguishes them (summary vs. dimension breakdown vs. focused error analysis), and the meta tools (doctor, skills_list, skill_read, check_for_updates) are clearly distinct.
Data tools follow a clean get_<noun> pattern (get_ux_insights, get_frustration_breakdown, get_js_errors), but the rest deviate: skills_list and skill_read use noun_verb, check_for_updates uses verb_for_noun, and doctor is a bare noun. Mixed conventions, though all still readable.
Seven tools is well-scoped for an analytics server: three domain tools for insights/frustration/errors plus four supporting utilities for auth, skills, and updates. Each tool earns its place with no redundancy in count.
Core workflows (overview insights, frustration breakdown, JS error analysis) are covered, along with credential validation and skill playbooks. Minor gaps exist—no raw session/heatmap retrieval, no multi-project or custom-range support beyond the 3-day window—but agents can work around these.
Maintenance
Related MCP Connectors
Session replays, JS errors, funnel drop-offs and revenue-loss diagnostics.
Ranked fixes from real users of your site: rage clicks, dead buttons, JS errors and slow pages.
Query real user session replay data: tapes, transcripts, error/rage-click filters, alerts.
Session replay and product analytics with an AI judge. Ask about sessions, findings and funnels.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI-powered analytics for OpenReplay user sessions through natural language queries. Supports session search, user journey analysis, error tracking, performance metrics, and funnel analysis to understand user behavior patterns.112MIT
- AlicenseAqualityDmaintenanceEnables AI agents to access website analytics, including visitor sessions, UX friction, conversion funnels, and anomaly alerts.6MIT

hootlens-mcpofficial
AlicenseNot gradedqualityBmaintenanceSession replay and click heatmaps for AI agents. Read a site’s visits as timed narratives, find repeated or dead clicks and the JavaScript errors behind them, and measure the impact of shipped changes.2MIT- FlicenseNot gradedqualityAmaintenanceEnables coding agents to access recorded browser flows with user actions, network, console, storage, DOM events, and screen recording so they can debug, report bugs, perform regression testing, and generate Playwright tests without reproducing the issue.-