Microsoft Clarity MCP

السجل الرسمي التسويق والمبيعات

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

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package microsoft-clarity-mcp
Claude Code
claude mcp add microsoft-clarity-mcp -e 'CLARITY_API_TOKEN=<CLARITY_API_TOKEN>' -e 'CLARITY_PROJECT_ID=<CLARITY_PROJECT_ID>' -- uvx microsoft-clarity-mcp==0.1.3
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "microsoft-clarity-mcp": {
            "command": "uvx",
            "args": [
                "microsoft-clarity-mcp==0.1.3"
            ],
            "env": {
                "CLARITY_API_TOKEN": "<CLARITY_API_TOKEN>",
                "CLARITY_PROJECT_ID": "<CLARITY_PROJECT_ID>"
            }
        }
    }
}

متغيرات البيئة

  • CLARITY_API_TOKEN Microsoft Clarity Data Export API token
  • CLARITY_PROJECT_ID Microsoft Clarity Project ID

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. Microsoft Clarity MCP Server (microsoft-clarity-mcp)
  2. 1. Quickstart
  3. 2. MCP Client Configuration
  4. 3. Authentication & API Tokens
  5. 4. Rate-Limit Defense & Persistent Caching
  6. 5. Tools
  7. 6. Telemetry & Privacy
  8. License

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-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:

  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.

الأسئلة الشائعة

ما هو Microsoft Clarity MCP؟

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

كيف أثبّت Microsoft Clarity MCP؟

يعمل على جهازك. في Claude Code: claude mcp add microsoft-clarity-mcp -e 'CLARITY_API_TOKEN=<CLARITY_API_TOKEN>' -e 'CLARITY_PROJECT_ID=<CLARITY_PROJECT_ID>' -- uvx microsoft-clarity-mcp==0.1.3. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج Microsoft Clarity MCP إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل Microsoft Clarity MCP مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون Microsoft Clarity MCP؟

ينشره surendranb. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.