Clarity Analytics

v2.0.1Analyticsstable

A Model Context Protocol server that lets you fetch Microsoft Clarity analytics data through Claude for Desktop or other MCP-compatible clients, with support for filtering by dimensions and retrieving various metrics.

analyticsmcpclaritybehavior-analytics-toolsheatmaps
Share:
84
Stars
0
Downloads
0
Weekly
0/5

What is Clarity Analytics?

Clarity Analytics is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that lets you fetch microsoft clarity analytics data through claude for desktop or other mcp-compatible clients, with support for filtering by dimensions and retrieving v...

A Model Context Protocol server that lets you fetch Microsoft Clarity analytics data through Claude for Desktop or other MCP-compatible clients, with support for filtering by dimensions and retrieving various metrics.

This server falls under the Analytics category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol server that lets you fetch Microsof

Use Cases

Fetch Microsoft Clarity analytics data and heatmaps from Claude.
Retrieve session recordings and behavior insights.
Analyze user engagement with filtered metrics.
microsoft

Maintainer

LicenseMIT License
Languagetypescript
Versionv2.0.1
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @microsoft/clarity-mcp-server

Manual Installation

npx -y @microsoft/clarity-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Clarity Analytics

The Microsoft Clarity MCP Server is an official Microsoft integration that gives AI assistants direct access to Microsoft Clarity behavioral analytics data, including session recordings, heatmap metrics, click patterns, and traffic statistics. It exposes three purpose-built tools allowing users to query the analytics dashboard with natural language, filter session recordings by device, country, or error state, and retrieve Clarity documentation snippets. Product managers, developers, and UX researchers use it to get immediate answers about user behavior without navigating the Clarity dashboard.

Prerequisites

  • A Microsoft Clarity account with at least one active project at clarity.microsoft.com
  • A Clarity API token — generated in Clarity project Settings > API Access
  • Node.js 18 or later
  • An MCP-compatible client such as Claude Desktop or Claude Code
1

Generate a Clarity API token

Log in to Microsoft Clarity at clarity.microsoft.com, select your project, go to Settings > API Access, and generate a new API token. Copy the token — you will use it in the env configuration.

2

Install the server globally or use npx

You can run the server directly with npx or install it globally for faster startup.

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

Add the server to Claude Desktop

Open your claude_desktop_config.json and add the Clarity server entry, passing your API token as the clarity_api_token argument.

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

Restart Claude Desktop

Quit and reopen Claude Desktop. The Clarity server exposes three tools: query-analytics-dashboard, list-session-recordings, and query-documentation-resources.

5

Query your Clarity data

Ask Claude natural language questions about your website's user behavior, traffic sources, or session recordings. The server translates your questions into Clarity API calls and returns the results.

Clarity Analytics Examples

Client configuration

Claude Desktop configuration for the Microsoft Clarity MCP server with API token authentication.

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

Prompts to try

Example prompts that demonstrate the dashboard queries, session recording filters, and documentation retrieval tools.

- "How many Clarity sessions did we get from the United States in the past 7 days?"
- "Show the top 5 session recordings with the highest number of user clicks."
- "Get Clarity recordings where users encountered JavaScript errors on mobile devices."
- "What browser and OS combinations are most common among my users this month?"
- "How do I track custom events using Microsoft Clarity? Check the documentation."
- "Compare session counts from Egypt vs. Germany over the last 3 days."

Troubleshooting Clarity Analytics

Authentication fails with 'Invalid API token'

Verify that the token passed as --clarity_api_token matches the one generated in your Clarity project's Settings > API Access. Tokens are project-scoped, so ensure you are using the token from the correct Clarity project.

Query returns no data despite the project having traffic

Clarity analytics data has a processing delay of up to 2 hours. Ensure you are querying dates at least a few hours in the past rather than the current hour. Also confirm the project ID associated with your API token matches the project with traffic.

Server fails to start with 'command not found: npx'

Ensure Node.js 18 or later is installed and that npx is available in the PATH used by your MCP client. On macOS, if you installed Node via nvm, add the nvm initialization to your ~/.zshenv (not just ~/.zshrc) so non-login shells can find npx.

Frequently Asked Questions about Clarity Analytics

What is Clarity Analytics?

Clarity Analytics is a Model Context Protocol (MCP) server that model context protocol server that lets you fetch microsoft clarity analytics data through claude for desktop or other mcp-compatible clients, with support for filtering by dimensions and retrieving various metrics. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Clarity Analytics?

Install via npm with the command: npx -y @microsoft/clarity-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Clarity Analytics?

Clarity Analytics works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Clarity Analytics free to use?

Yes, Clarity Analytics is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Analytics MCP Servers

Explore all analytics servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "clarity-data-export-mcp-server": { "command": "npx", "args": ["-y", "@microsoft/clarity-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Clarity Analytics?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides