About Microsoft Clarity MCP
Microsoft Clarity MCP exposes Clarity behavioral analytics for teams and AI agents investigating website UX. It reports interaction friction and JavaScript errors, with local caching and daily quota metadata for API use.
Key features
- 01Behavioral friction and session metrics
- 02Breakdowns by URL and environment
- 03JavaScript runtime error reports
- 04Local response cache with stale fallback
- 05Daily API quota metadata
Use cases
- 01Locate pages with rage or dead clicks
- 02Compare friction across devices and browsers
- 03Investigate JavaScript errors by browser
- 04Continue analysis when the daily quota is reached
MCP support
The MCP server exposes Microsoft Clarity Data Export API insights as tools for MCP clients, including UX metrics, breakdowns, and JavaScript error reports.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
uvx microsoft-clarity-mcpCLARITY_API_TOKENSecretMicrosoft Clarity Data Export API tokenCLARITY_PROJECT_IDMicrosoft Clarity Project IDLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMicrosoft 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-mcp
Via Node (npx)
npx microsoft-clarity-mcp
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 |
|---|---|---|
get_ux_insights | project_id, num_of_days=3, token | High-level behavioral friction metrics: session counts, rage clicks, dead clicks, quick backs, excessive scroll, and JS errors. |
get_frustration_breakdown | project_id, dimension="URL", num_of_days=3, token | Ranks friction severity broken down across URL paths, devices, browsers, operating systems, or countries. |
get_js_errors | project_id, num_of_days=3, token | JavaScript runtime exceptions and error clicks grouped across browsers and operating systems. |
doctor | project_id, token | Diagnostic utility checking token format, cache integrity, and remaining daily API quotas. |
skills_list | (none) | Lists dynamic skill playbooks bundled with the server. |
skill_read | name | Fetches operational playbooks (e.g. ux-triage, setup-clarity-token, frustration-audit). |
check_for_updates | (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.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.