MCP Ecommerce
M

Installation guide

How to install Microsoft Clarity MCP Server

In Claude, ChatGPT, Gemini, Microsoft Copilot, Perplexity, Cursor and Claude Code, with what to check before you start and the first prompts to run.

This is a local MCP server. It runs on your machine through Node.js, either with `npx @microsoft/clarity-mcp-server` or after a global npm install. It authenticates with a Clarity Data Export API token, passed as the `--clarity_api_token` argument. There is no remote URL or browser sign-in. The server is read-only: it queries dashboard metrics, lists session recordings and searches Clarity documentation.

Have a Clarity project admin, or someone with access to the project's Settings, generate the token under `Settings > Data Export`. Use a token named for the client or agency that will use it, and store it in a password manager. A developer or analyst comfortable with a terminal and client config files should do the install. Start with narrow read-only questions before wider use.

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.

Before you start

  • Node.js v16 or higher installed, with npx available in your terminal
  • A Microsoft Clarity account with access to the project you want to query
  • A Clarity Data Export API token, generated in your project under Settings > Data Export > Generate new API token
  • An MCP-compatible client such as Claude for Desktop, Cursor or VS Code
  • A safe place to store the token, since it sits in plain text in the client config
How it runs
Local, runs on your machine
Access
Read-only
Server address
Copy it from the vendor documentation

Microsoft Clarity MCP Server in Claude

  1. Generate a Data Export token in Clarity: open your project, then Settings > Data Export > Generate new API token. Give it a descriptive name and copy it.
  2. Open the config file. On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows: %AppData%\Claude\claude_desktop_config.json.
  3. Add the mcpServers entry shown below, replacing your-api-token-here with your token.
  4. Save the file and fully restart Claude Desktop.
  5. Alternatively, the documentation says you can use File > Settings > Extensions, search for Microsoft Clarity, click Install, then set the API token as described in the docs. This applies to the Claude Desktop app only, not Claude.ai on the web.
  6. Run a verification prompt from the list below.
claude_desktop_config.json
{
  "mcpServers": {
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}

Microsoft Clarity MCP Server in ChatGPT

  1. The documentation does not cover ChatGPT. This server is local (stdio via npx) and has no remote URL, so ChatGPT connectors, which take a remote MCP URL in Developer mode, cannot reach it directly.
  2. To use it you would need to host the server behind a remote MCP endpoint yourself. That setup is not described in the vendor documentation, so check the vendor docs and OpenAI's current connector requirements first.
  3. If you only need Clarity data in a chat, use a client with local MCP support, such as Claude Desktop, Cursor or Claude Code.
  4. Keep the Clarity token out of shared or public endpoints.

Microsoft Clarity MCP Server in Gemini

  1. The documentation does not cover Gemini. Gemini CLI supports local servers through mcpServers in its settings file, so the generic entry from the docs should apply.
  2. Open your Gemini CLI settings JSON file. Take its exact location from the Gemini CLI documentation.
  3. Add the mcpServers entry below with your Clarity token in place of the placeholder.
  4. Save the file and restart Gemini CLI.
  5. Run a verification prompt. The Gemini app extensions are not covered by the docs for this server.
Gemini CLI settings (mcpServers)
{
  "mcpServers": {
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}

Microsoft Clarity MCP Server in Microsoft Copilot

  1. The documentation mentions a Visual Studio Code install button in the README. Use it if you want the vendor's default VS Code install, then enter your token as prompted.
  2. For a manual setup, create .vscode/mcp.json in your workspace. VS Code uses a top-level servers object.
  3. Add the entry below with your Clarity token in place of the placeholder. Avoid committing this file with a real token.
  4. Start the server from the MCP controls in VS Code and use it in Copilot Chat agent mode.
  5. Microsoft Copilot Studio is not covered by the docs. It would need a remote MCP endpoint, which this local server does not provide.
.vscode/mcp.json
{
  "servers": {
    "clarity": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}

Microsoft Clarity MCP Server in Perplexity

  1. The documentation does not cover Perplexity.
  2. Perplexity desktop app connectors generally expect a supported connector setup. Check the Perplexity documentation for whether local command-based MCP servers are supported in your version.
  3. If local servers are supported, add a server with the command npx and the arguments @microsoft/clarity-mcp-server and --clarity_api_token=your-api-token-here.
  4. If not, use a client documented for local servers, such as Claude Desktop, Cursor or Claude Code.

Microsoft Clarity MCP Server in Cursor

  1. Generate your Clarity Data Export token as described in the prerequisites.
  2. Open Cursor's MCP settings and edit the MCP config JSON. The docs do not cover Cursor, so confirm the file location in Cursor's documentation.
  3. Add the generic mcpServers entry below with your token.
  4. Save the file and confirm the server shows as enabled in the MCP settings, restarting Cursor if it does not appear.
  5. Run a verification prompt.
Cursor MCP config (mcpServers)
{
  "mcpServers": {
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}

Microsoft Clarity MCP Server in Claude Code

  1. Generate your Clarity Data Export token in Settings > Data Export.
  2. Run the claude mcp add command below in your terminal, with your token in place of the placeholder. The docs do not show this command, but it follows the standard Claude Code format for local servers using the documented npx invocation.
  3. Run claude mcp list to confirm the server is registered.
  4. Start claude and ask a narrow read-only question about your Clarity project.
Terminal
claude mcp add clarity -- npx @microsoft/clarity-mcp-server --clarity_api_token=your-api-token-here

Check that it works

Start with questions that only read data. If these answer from your real account, the connection is good.

  • What are the most used browsers in my Clarity project?
  • Show me traffic metrics from my Clarity project for the last week.
  • List the most recent Clarity sessions from mobile devices.

Troubleshooting

+

The server does not appear in my client after editing the config. What should I check?

Confirm the JSON is valid and the file is in the right location for your client. For Claude Desktop, fully quit and restart the app. Check that `node` and `npx` run in a terminal and that Node.js is v16 or higher. Then run `npx @microsoft/clarity-mcp-server` by hand to see errors.

+

Queries return authentication or empty-data errors. Is the token wrong?

Check that the token was generated under `Settings > Data Export` in the correct Clarity project and was copied in full with no extra spaces. The documentation also allows passing the token as a parameter to the `get-clarity-data` tool. If the problem persists, generate a new token and update the config.

+

The tool names in my client differ from the documentation. Is something broken?

Probably not. The documentation is slightly inconsistent about tool names. The README lists `query-analytics-dashboard`, `list-session-recordings` and `query-documentation-resources`, but also mentions `get-clarity-data`. Use plain-language prompts, keep each request to one topic, and check the tool list your client shows. No rate limits are documented beyond the Data Export API's own.

Written Nov 9, 2026 from the vendor documentation. Exact menus, addresses and commands change; the official documentation is the source of truth.

Questions and answers

Questions readers and searchers ask about installing 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.