MCP Ecommerce
M

Analytics

Microsoft Clarity MCP Server

Open-source MIT-licensed local MCP server from Microsoft built on the Clarity Data Export API, so AI clients can query dashboard metrics, list session recordings and search Clarity documentation with a Data Export token.

Microsoft Clarity MCP Server setup guide: Microsoft's MCP documentation page on github.com, shown in a browser frame (analytics MCP server for e-commerce)
Microsoft Clarity MCP Server setup guide preview: Microsoft’s documentation on github.com, captured Nov 9, 2026. The page may have changed since; the link opens the live version.

What it is and why it matters

The Microsoft Clarity MCP Server is an open-source, MIT-licensed server from Microsoft that connects an AI client, such as Claude for Desktop or Visual Studio Code, to your Microsoft Clarity project. It uses the Clarity Data Export API, so you can ask plain-English questions about traffic, browsers, devices and countries, list session recordings that match filters, and look up answers from Clarity documentation. It runs on your own computer, not on a hosted service.

It suits merchants who already use Clarity heatmaps and recordings and want quick behavioural summaries without clicking through dashboards. It also suits agencies that check several stores. Results depend on the quality of the data in your Clarity project and on how focused each question is. The documentation recommends keeping each request to one thing. You need Node.js and a Data Export API token, and the setup is done in a config file, so a technical colleague may need to help the first time.

What it does

  • Query dashboard analytics with natural language filters
  • List session recordings by URL, device, browser, OS or country
  • Retrieve metrics such as scroll depth and engagement time
  • Search Clarity documentation snippets

Best for

Merchants using Clarity heatmaps and recordings who want quick behavioural summaries.

How to connect it

  1. Check the prerequisites listed in the documentation: Node.js v16 or higher, a Microsoft Clarity account, and an MCP-compatible client such as Claude for Desktop.
  2. Generate a token in your Clarity project as described in the documentation: go to Settings, then Data Export, then Generate new API token. Give it a descriptive name and store it securely.
  3. Choose an install method. The documentation recommends npm (npm install -g @microsoft/clarity-mcp-server, then run clarity-mcp-server). You can also run it with npx @microsoft/clarity-mcp-server, or install manually by cloning the repository, running npm install, npm run build and npm run start.
  4. Add the server to your client configuration. For Claude for Desktop, edit claude_desktop_config.json (on macOS under ~/Library/Application Support/Claude/, on Windows under %AppData%\Claude\). Add an entry under mcpServers that uses the command npx with the arguments @microsoft/clarity-mcp-server and --clarity_api_token=your-api-token-here.
  5. Save the file and restart the client. The documentation also mentions a Visual Studio Code install button and a Claude Desktop extension gallery listing as alternatives.
  6. Test with a simple question, such as asking for traffic metrics from your Clarity project for the last week.

Exact commands and addresses change. Use the official documentation for the current steps.

Installation guide for Microsoft Clarity MCP Server

Client-by-client steps, what to prepare, the first prompts to run and fixes for common errors.

ClaudeChatGPTGeminiMicrosoft CopilotPerplexityCursorClaude Code
→

Questions you can ask it

  • Show me traffic metrics from my Clarity project for the last week.
  • What are the most used browsers in my Clarity project?
  • List the most recent Clarity sessions from mobile devices.
  • Get Clarity recordings where users encountered JavaScript errors.

What it cannot do

  • It cannot change anything in Clarity. It only reads data through the Data Export API, so it cannot edit settings or delete recordings.
  • It does not run as a hosted service. You must run it locally and keep Node.js and your client configuration working yourself.
  • It does not document its own rate limits. Only the limits of the Clarity Data Export API apply, so heavy or repeated queries may be restricted.

Staying safe

  • The API token is placed in your client config file as plain text. Keep that file private, never share it or commit it to shared storage, and give the token a descriptive name so you can recognise it later.
  • Recordings and analytics can contain visitor behaviour data. Check your privacy obligations and the Clarity Privacy Policy before sharing outputs with third parties or pasting them into other tools.
  • The server is read-only, which is a good starting point. If a token is exposed, generate a new one in Clarity's Data Export settings and update your configuration.

Watch out for: Documentation is slightly inconsistent about tool names and no rate limits are documented beyond the Data Export API's own.

Frequently asked questions

+

Does the Microsoft Clarity MCP server cost anything?

The server is open source under the MIT license. The documentation does not state any pricing for the Data Export API or Clarity itself, so check the vendor documentation and your Clarity account. You still need a Clarity account and a generated Data Export API token to use it.

+

How do I get the Clarity API token?

As described in the documentation, open your Clarity project, go to Settings, then Data Export, then choose Generate new API token. Give it a descriptive name and save it securely. You then pass it to the server with the `--clarity_api_token` argument in your client configuration.

+

Can the server change my Clarity settings or recordings?

No. The listing describes it as read-only. The documented tools are query-analytics-dashboard, list-session-recordings and query-documentation-resources, which retrieve data and documentation. Tool names may differ slightly in some documentation, so check what your client actually shows after connecting.

Questions and answers

Questions readers and searchers ask about Microsoft Clarity MCP Server, answered by the site editor from the vendor documentation, plus reader experience. Every comment is reviewed before it appears.

Ask a question or share what worked

Reviewed before publishing. One link max, no HTML.

Related guides

Other servers to compare