Microsoft Clarity MCP

io.github.surendranbPublished by GitHub account surendranbv0.1.3Updated Nov 3, 2026

Microsoft Clarity MCP: behavioral UX analytics, rage clicks, dead clicks, scroll, and JS errors.

The publisher's own server: Microsoft Learn MCP

VerifiedSTDIODesktop onlyDeveloper ToolsData & Analytics

Overview

AI-generated overview

Local MCP server that pulls Microsoft Clarity behavioral UX data — rage clicks, dead clicks, quick backs and JS errors — into an AI assistant.

What you can do
  • Retrieve high-level UX insights for a Clarity project: sessions, frustration rates, excessive scroll and technical health
  • Break frustration metrics (rage clicks, dead clicks, quick backs) down by URL, device, browser, OS or country
  • Analyze JavaScript errors and unhandled exceptions across browsers and operating systems
  • Run a diagnostic check of credentials, project configuration, cache and remaining daily quota
  • List and load bundled skill playbooks, and check PyPI for newer versions
When to use it
Useful when you want an assistant to triage web UX friction and front-end errors from Microsoft Clarity data, for example ranking problem pages or investigating JavaScript exceptions, without opening the Clarity dashboard.
Requirements
Runs locally over stdio, launched with uvx or npx (Python or Node.js). Needs a Microsoft Clarity Data Export API token in CLARITY_API_TOKEN and a project ID in CLARITY_PROJECT_ID, both generated in the Clarity project's Settings under Data Export. Network access to the Clarity API; desktop client only.
Before you install
Requires a Clarity API token, a credential that grants access to your project's analytics data; keep it out of shared configs. Clarity allows only 10 requests per project per day, so responses are cached on disk at ~/.clarity_mcp/cache.json and stale data may be served with a warning. The package sends anonymous usage telemetry unless disabled via DO_NOT_TRACK, DISABLE_TELEMETRY or CLARITY_TELEMETRY.

Installation

In SourceWeft

  1. Open Microsoft Clarity MCP in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

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)

bash
uvx microsoft-clarity-mcp

Via Node (npx)

bash
npx microsoft-clarity-mcp

2. MCP Client Configuration

Add to your MCP client config (claude_desktop_config.json, cursor.json, or Antigravity/OpenCode):

json
{  "mcpServers": {    "microsoft-clarity": {      "command": "uvx",      "args": ["microsoft-clarity-mcp"],      "env": {        "CLARITY_API_TOKEN": "your_clarity_api_token_here"      }    }  }}

Or using npx:

json
{  "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:

  1. Log in to Microsoft Clarity.
  2. Open your project dashboard.
  3. Navigate to Settings -> Data Export.
  4. Click Generate new API token (provide a name between 4 and 32 alphanumeric characters, e.g. clarity-agent).
  5. 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.json with a 1-hour TTL (configurable via CLARITY_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, and daily_limit.

5. Tools

ToolParametersDescription
get_ux_insightsproject_id, num_of_days=3, tokenHigh-level behavioral friction metrics: session counts, rage clicks, dead clicks, quick backs, excessive scroll, and JS errors.
get_frustration_breakdownproject_id, dimension="URL", num_of_days=3, tokenRanks friction severity broken down across URL paths, devices, browsers, operating systems, or countries.
get_js_errorsproject_id, num_of_days=3, tokenJavaScript runtime exceptions and error clicks grouped across browsers and operating systems.
doctorproject_id, tokenDiagnostic utility checking token format, cache integrity, and remaining daily API quotas.
skills_list(none)Lists dynamic skill playbooks bundled with the server.
skill_readnameFetches 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, or CLARITY_TELEMETRY=false.
  • Zero PII: No user URLs, personal identifiers, or authentication tokens are ever captured.

License

MIT License. Copyright (c) 2026 Surendran B.

Source: README.md at commit 4b5e001

Tools

7

get_ux_insights

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.

Parameterstokenproject_idrequirednum_of_days

get_frustration_breakdown

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.

Parameterstokendimensionproject_idrequirednum_of_days

get_js_errors

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.

Parameterstokenproject_idrequirednum_of_days

doctor

Validate Microsoft Clarity credentials, project configurations, on-disk cache, and remaining daily request quota.

Parameterstokenproject_id

skills_list

List available dynamic skill playbooks bundled with microsoft-clarity-mcp.

Takes no parameters.

skill_read

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').

Parametersnamerequired

check_for_updates

Check PyPI for newer versions of microsoft-clarity-mcp and get upgrade instructions.

Takes no parameters.

Version history

1
  1. v0.1.3LatestOct 29, 2026

Score

90% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts
  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listedRequired15 pts
  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

Other Microsoft integrations