Microsoft Clarity MCP

io.github.surendranb由 GitHub 帳號 surendranb 發布v0.1.3更新於 Nov 3, 2026

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

發布方自己的服務:Microsoft Learn MCP

已驗證STDIO僅桌面開發者工具資料與分析

概覽

AI 產生的概覽

本機 MCP 伺服器,把 Microsoft Clarity 的行為 UX 資料(暴怒點擊、無效點擊、快速返回、JS 錯誤)提供給 AI 助理分析。

可以做什麼
  • 取得 Clarity 專案的高階 UX 洞察:工作階段數、挫折率、過度捲動與技術健康狀況
  • 依 URL、裝置、瀏覽器、作業系統或國家/地區拆分挫折指標(暴怒點擊、無效點擊、快速返回)
  • 分析各瀏覽器與作業系統下的 JavaScript 錯誤與未捕捉例外
  • 診斷憑證、專案設定、本機快取與當日剩餘配額
  • 列出並載入內建技能手冊,並檢查 PyPI 上的新版本
適用情境
適合讓助理根據 Microsoft Clarity 資料排查網頁 UX 摩擦與前端錯誤,例如排序問題頁面或調查 JavaScript 例外,而不必開啟 Clarity 後台。
執行需求
透過 stdio 在本機執行,以 uvx 或 npx 啟動(需 Python 或 Node.js)。需要 Microsoft Clarity 資料匯出 API 權杖(環境變數 CLARITY_API_TOKEN)與專案 ID(CLARITY_PROJECT_ID),兩者都在 Clarity 專案設定的 Data Export 中產生。需要連線 Clarity API 的網路;僅支援桌面用戶端。
安裝前請注意
需要 Clarity API 權杖,該憑證可存取專案分析資料,請勿寫入共用設定。Clarity 每個專案每天僅允許 10 次請求,因此回應會快取在本機 ~/.clarity_mcp/cache.json,配額用盡時可能回傳附警告的過期資料。此套件預設傳送匿名使用遙測,可透過 DO_NOT_TRACK、DISABLE_TELEMETRY 或 CLARITY_TELEMETRY 關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Microsoft Clarity MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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.

來源:README.md,提交 4b5e001

工具

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.

輸入參數tokenproject_id必填num_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.

輸入參數tokendimensionproject_id必填num_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.

輸入參數tokenproject_id必填num_of_days

doctor

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

輸入參數tokenproject_id

skills_list

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

無需輸入參數。

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

輸入參數name必填

check_for_updates

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

無需輸入參數。

版本歷史

1
  1. v0.1.3最新Oct 29, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Microsoft 整合