Clarity Analytics
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.
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
Maintainer
Works with
Installation
NPM
npx -y @microsoft/clarity-mcp-serverManual Installation
npx -y @microsoft/clarity-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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.
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-serverAdd 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"]
}
}
}Restart Claude Desktop
Quit and reopen Claude Desktop. The Clarity server exposes three tools: query-analytics-dashboard, list-session-recordings, and query-documentation-resources.
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.
Clarity Analytics Alternatives — Similar Analytics Servers
Looking for alternatives to Clarity Analytics? Here are other popular analytics servers you can use with Claude, Cursor, and VS Code.
OpenMetadata
★ 14.0kOpenMetadata is a unified metadata platform for data discovery, data observability, and data governance powered by a central metadata repository, in-depth column level lineage, and seamless team collaboration.
Superset
★ 10.9kAn MCP server that provides AI assistants with full access to Apache Superset instances, enabling interaction with dashboards, charts, datasets, databases, and SQL execution capabilities.
Horizon
★ 4.4k📡 Your own AI-powered news radar. Generates daily briefings in English & Chinese. | 用 AI 构建你专属的新闻雷达
MCP Server Chart
★ 4.1kEnables generation of 25+ types of charts and data visualizations using AntV, including bar charts, line charts, maps, mind maps, and specialized diagrams like fishbone and sankey charts. Supports both statistical charts and geographic visualizations
Muapi CLI
★ 997Official CLI for muapi.ai — generate images, videos & audio from the terminal. MCP server, 14 AI models, npm + pip installable.
Weather MCP Server
★ 907Weather Data Fetcher MCP server built with Node.js, MCP SDK, and Zod. Provides weather details like temperature and forecast for cities such as Noida and Delhi via a registered tool. Simplifies API integration, enabling structured responses for clien
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.
Set Up Clarity Analytics in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.