by microsoft
Fetch Microsoft Clarity analytics data via a Model Context Protocol server, enabling MCP‑compatible clients such as Claude for Desktop to query metrics and dimensions.
Provides a lightweight MCP server that connects to the Microsoft Clarity Data Export API, allowing developers and AI assistants to retrieve recent analytics (1‑3 days) with selectable dimensions and metrics.
npm install -g @microsoft/clarity-mcp-server) or run directly with npx:
npx @microsoft/clarity-mcp-server --clarity_api_token=YOUR_TOKEN
get-clarity-data tool from the client, supplying:
numOfDays (1‑3)dimensions (up to 3, e.g., Browser, Device, Country)metrics (e.g., Traffic, Scroll Depth)token if not passed via CLI.--clarity_api_token flag.Q: How far back can I retrieve data? A: Only the most recent 1‑3 days are supported by the Clarity export API.
Q: How many dimensions can I use? A: Up to three dimensions per request.
Q: What are the request limits? A: A maximum of 10 API calls per project per day.
Q: Can I paginate results? A: No. The server returns at most 1,000 rows per request.
Q: Do I need to set environment variables?
A: The token can be supplied via the --clarity_api_token CLI argument or as the token tool parameter.
This is a Model Context Protocol (MCP) server for the Microsoft Clarity. It allows you to access your session recordings, project analytics, and documentation from Clarity using Claude for Desktop or other MCP-compatible clients.
You can install and run this package directly using npm:
# Install globally
npm install -g @microsoft/clarity-mcp-server
# Run the server
clarity-mcp-server
You can run the server directly using npx without installing:
npx @microsoft/clarity-mcp-server
With either option, you can provide your Clarity API token using the --clarity_api_token parameter:
npx @microsoft/clarity-mcp-server --clarity_api_token=your-token-here
npm install
npm run build
npm run start
Click the button above to install the Microsoft Clarity MCP server directly in Visual Studio Code.
Install from Claude's extension gallery:
You can provide the Clarity data export API token in two ways:
Command Line Arguments:
npx @microsoft/clarity-mcp-server --clarity_api_token=your-token
Tool Parameters:
Provide token as a parameter when calling the get-clarity-data tool
MCP clients typically require configuration to connect to the server. Here's a general example of how to configure an MCP client:
{
"mcpServers": {
"@microsoft/clarity-mcp-server": {
"command": "npx",
"args": [
"@microsoft/clarity-mcp-server",
"--clarity_api_token=your-api-token-here"
]
}
}
}
The specifics of where and how to add this configuration will depend on your specific MCP client.
To configure Claude for Desktop to use this server:
%AppData%\Claude\claude_desktop_config.json~/Library/Application Support/Claude/claude_desktop_config.jsonThe server exposes various tools that you can call from any MCP client. Just ask naturally and keep each request focused on one thing.
query-analytics-dashboardlist-session-recordingsquery-documentation-resourcesTo generate an API token:
For information about data privacy and usage, please refer to the Microsoft Clarity Privacy Policy.
This project is licensed under the MIT License.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by mindsdb
Enables humans, AI agents, and applications to retrieve highly accurate answers across large‑scale data sources, unifying heterogeneous databases, warehouses, and SaaS platforms.
by mckinsey
Build high-quality data visualization apps quickly using a low-code toolkit that leverages Plotly, Dash, and Pydantic.
by antvis
Offers over 25 AntV chart types for automated chart generation and data analysis, callable via MCP tools, CLI, HTTP, SSE, or streamable transports.
by reading-plus-ai
A versatile tool that enables interactive data exploration through prompts, CSV loading, and script execution.
by Canner
Provides a semantic engine that lets MCP clients and AI agents query enterprise data with contextual understanding, precise calculations, and built‑in governance.
by surendranb
Provides natural‑language access to Google Analytics 4 data via MCP, exposing over 200 dimensions and metrics for Claude, Cursor and other compatible clients.
by ergut
Provides secure, read‑only access to BigQuery datasets, allowing large language models to query and analyze data through a standardized interface.
by isaacwasserman
Provides an interface for LLMs to visualize data using Vega‑Lite syntax, supporting saving of data tables and rendering visualizations as either a full Vega‑Lite specification (text) or a base64‑encoded PNG image.
by gomarble-ai
Provides seamless integration of the Google Ads API with Model Context Protocol clients, handling OAuth 2.0 authentication, automatic token refresh, GAQL query execution, account management, and keyword‑research capabilities.
{
"mcpServers": {
"@microsoft/clarity-mcp-server": {
"command": "npx",
"args": [
"@microsoft/clarity-mcp-server",
"--clarity_api_token=<YOUR_API_TOKEN>"
],
"env": {
"CLARITY_API_TOKEN": "<YOUR_API_TOKEN>"
}
}
}
}claude mcp add @microsoft/clarity-mcp-server npx @microsoft/clarity-mcp-server --clarity_api_token=<YOUR_API_TOKEN>