Back to MCP Servers

Microsoft Clarity MCP Server

Official MCP server for Microsoft Clarity that exposes analytics dashboard metrics, session recording lookups, and Clarity documentation via natural language.

Analytics by Microsoft API Key active
Overview

The Microsoft Clarity MCP Server is an official Model Context Protocol server, maintained in the microsoft/clarity-mcp-server GitHub repository, that connects MCP-compatible clients (such as Claude for Desktop) to a Microsoft Clarity project. It wraps the Clarity Data Export API so an AI agent can pull behavioral analytics, scroll depth, engagement time, and traffic insights, plus inspect session recordings, all through natural language.

The server exposes three tools: query-analytics-dashboard for retrieving traffic and behavior metrics from a project's dashboard, list-session-recordings for filtering recordings by URL, device, browser, OS, country, and performance attributes, and query-documentation-resources for pulling snippets from the official Clarity docs. Authentication is handled by a Clarity Data Export API token passed as a command-line argument.

Because it is published under the @microsoft npm scope and lives in the Microsoft GitHub org, this is the canonical integration for Clarity. It is distributed as an npm package and can be installed globally, executed via npx, or built from source.

Tools

Tool Description
query-analytics-dashboard Retrieves analytics data and metrics from your project's dashboard using a simplified natural language search query.
list-session-recordings Lists your project's session recordings based on specified filtering criteria.
query-documentation-resources Retrieves snippets from Microsoft Clarity documentation to find answers to user questions.
Setup Guide

Prerequisites

  • Node.js v16 or higher
  • A Microsoft Clarity account and a Data Export API token (generate from Settings → Data Export in the Clarity dashboard)
  • An MCP-compatible client (e.g. Claude for Desktop)

Installation

Install globally via npm:

npm install -g @microsoft/clarity-mcp-server
clarity-mcp-server

Or run directly with npx:

npx @microsoft/clarity-mcp-server --clarity_api_token=your-token-here

Or build from source:

npm install
npm run build
npm run start

Claude for Desktop config

Add the following to claude_desktop_config.json:

{
  "mcpServers": {
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}

Config file locations:

  • Windows: %AppData%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Use Cases
  • Pull dashboard metrics like sessions, engagement time, scroll depth, and dead clicks for a Clarity project without leaving an AI chat.
  • Triage user friction by listing session recordings filtered to specific URLs, devices, browsers, or countries and summarizing what happened.
  • Compare traffic and behavior across device types or geographies in plain English instead of hand-building filters in the Clarity UI.
  • Investigate performance regressions by querying recordings that match slow page-load or rage-click criteria.
  • Self-serve Clarity setup and troubleshooting by querying the official documentation through the MCP server.
Example Prompts
  • "Show me the top traffic sources and engagement time for my Clarity project over the last 7 days."
  • "List session recordings from mobile users in Germany that visited the /checkout page."
  • "Find recordings with rage clicks on the pricing page this week and summarize the common drop-off points."
  • "Break down sessions by browser and OS for the last 30 days."
  • "How do I set up custom tags in Microsoft Clarity?"
Pros
  • Official Microsoft-maintained server published under the @microsoft npm scope.
  • Covers the two highest-value Clarity surfaces in one server: dashboard analytics and session recordings.
  • Simple setup via npx with a single API token argument, no extra infrastructure needed.
  • Includes a documentation lookup tool so agents can answer Clarity how-to questions inline.
Limitations
  • Only three tools; advanced or programmatic queries beyond what the dashboard API exposes are not available.
  • Read-only: cannot configure projects, set up tags, or modify Clarity settings from the agent.
  • Requires the Clarity Data Export API token, which is subject to Clarity's rate limits and project-level access.
Alternatives