Microsoft Clarity MCP Server – Analytics Access
Microsoft Clarity MCP Server is Microsoft’s local Model Context Protocol server for querying Clarity website analytics, session recordings, and Clarity documentation from MCP-compatible clients. It is useful when an AI agent needs live product analytics, behavioral insights, and filtered dashboard metrics from a Clarity project.
Overview
Microsoft Clarity MCP Server connects MCP-compatible AI clients to Microsoft Clarity, Microsoft’s behavioral analytics product for understanding how people use websites. The server is maintained under Microsoft’s GitHub organization and is documented in Microsoft Learn. It gives an AI agent a structured way to query Clarity analytics data, inspect session-recording lists, and retrieve Clarity documentation snippets without manually navigating the Clarity dashboard.
What the MCP server enables
The server exposes tools for Clarity analytics and support context. query-analytics-dashboard retrieves analytics metrics from a Clarity project using a simplified natural-language-style query. It can be used for questions about traffic metrics, user behavior, engagement, browsers, devices, countries, and similar dashboard dimensions. list-session-recordings lists session recordings with filters such as URL, device type, browser, operating system, country, city, and related criteria. query-documentation-resources retrieves snippets from Microsoft Clarity documentation for setup, features, usage, troubleshooting, and integrations.
When to use it
Use this MCP server when an AI agent needs current behavioral analytics from a Microsoft Clarity project. Practical workflows include asking for scroll depth over the last few days, comparing traffic and engagement by browser, finding recent mobile sessions, or retrieving session recordings that match diagnostic filters such as JavaScript errors. It is also useful for product, marketing, and UX teams that want conversational access to Clarity project data while staying inside an MCP-capable client such as Claude Desktop or another supported client.
Connection and authentication
Microsoft documents the server as a local stdio MCP server run with Node.js and npx. The server requires Node.js v16 or later, a Microsoft Clarity project, and a Clarity Data Export API token. The token can be passed as a command-line argument using --clarity_api_token, or supplied as a tool parameter when invoking the relevant tool. Store the token securely and avoid committing MCP client configuration files that contain real tokens.
Key considerations
The server depends on the Microsoft Clarity Data Export API, so API limits and project permissions apply. Microsoft Learn documents that each project permits up to 10 API requests per day, with a maximum of 3 days of data and up to 3 dimensions per request. The current documented transport is local stdio through npx; do not assume a hosted Streamable HTTP or SSE endpoint unless Microsoft documents one. Agents should make focused requests, avoid unnecessary repeated queries, and treat Clarity data as potentially sensitive behavioral analytics.
Supported Transports
stdio
Command: npx
Args:
@microsoft/clarity-mcp-server--clarity_api_token=${MICROSOFT_CLARITY_API_TOKEN}
Frequently Asked Questions
- When should an AI agent use the Microsoft Clarity MCP Server?
- Use it when an agent needs live Microsoft Clarity website analytics, such as traffic, engagement time, scroll depth, device breakdowns, browser usage, or session-recording lists for a Clarity project.
- What does this MCP server add to an AI agent's capabilities?
- It adds MCP tools for querying Clarity analytics, listing session recordings with filters, and retrieving Microsoft Clarity documentation snippets, so the agent can work with current project data rather than relying on static model knowledge.
- What can the AI agent access or manage through this server?
- The documented tools support analytics dashboard queries, filtered session-recording retrieval, and documentation lookup. The server is intended for querying Clarity data; it is not documented as a general Clarity project administration or settings-management server.
- How is authentication configured for this MCP server?
- Authentication uses a Microsoft Clarity Data Export API token from a Clarity project. The token can be passed with the `--clarity_api_token` command-line parameter or supplied as a tool parameter when invoking commands. Use a secret reference such as `${MICROSOFT_CLARITY_API_TOKEN}` rather than storing the token in plaintext.
- Which transport should be used for this MCP server?
- Use the documented local stdio transport by running the npm package with `npx @microsoft/clarity-mcp-server`. Microsoft’s documentation and repository describe local MCP client configuration; no hosted Streamable HTTP or SSE endpoint is included in this YAML.