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 server. You run it on your own machine with Node.js, and your MCP client starts it with `npx @microsoft/clarity-mcp-server`. It authenticates with a Clarity Data Export API token passed as `--clarity_api_token=<YOUR_CLARITY_API_TOKEN>`. 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 the analytics owner generate the token under their own Clarity account, and name it descriptively so it can be revoked later. Because the server runs locally, the person who installs it should be the one who holds the token. Remote-only clients (ChatGPT, Perplexity, and the web version of Claude.ai) cannot start a local command, and the docs do not cover them.

Before you start
Node.jsv16 or higher installed, so thatnpxis 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 the project under
Settings > Data Export > Generate new API token - An MCP-compatible client that can run local commands, such as Claude for Desktop, Cursor, Claude Code or VS Code
- A secure place to store the token (for example a password manager), since it is shown when generated
- 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
- Generate your token in Clarity: open the project, go to
Settings > Data Export, selectGenerate new API token, give it a descriptive name and store it securely. - Open the Claude for Desktop config file. On macOS it is
~/Library/Application Support/Claude/claude_desktop_config.json. On Windows it is%AppData%\Claude\claude_desktop_config.json. - Add the
mcpServersentry from the snippet below and replaceyour-api-token-herewith your token. - Save the file and fully restart Claude for Desktop.
- Alternative from the docs: open
File > Settings > Extensions, search forMicrosoft Clarity, clickInstall, then set the API token as the docs describe. - The docs cover only Claude for Desktop. Claude.ai on the web cannot run a local command like this one.
{
"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
- The documentation does not cover ChatGPT. This server runs locally over a command, not a hosted URL.
- ChatGPT connectors in Developer mode expect a remote MCP server URL, and the docs give none for this server.
- Unless you host the server behind your own remote endpoint (not described in the docs), use a client that can run local commands instead.
- If you need this data in ChatGPT, check the vendor documentation at
https://github.com/microsoft/clarity-mcp-serverfor any newer remote option.
Microsoft Clarity MCP Server in Gemini
- The documentation does not cover Gemini. Use Gemini CLI's standard way of adding a local server: an
mcpServersentry in its settings file. - Open the Gemini CLI settings
JSONfile. Take its exact location from the Gemini CLI documentation. - Add the entry from the snippet below, replacing
your-api-token-herewith your Clarity token. - Save the file and restart Gemini CLI.
- Check that the server is listed and that its tools appear before you run any queries.
{
"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
- The docs mention Visual Studio Code: they describe a VS Code extension install button for this server. Use it for the quickest setup.
- For manual setup in VS Code, create or edit
.vscode/mcp.json. This is the standard GitHub Copilot format, and the docs do not show it for this server. - Add a
serversentry that runsnpxwith the args@microsoft/clarity-mcp-serverand--clarity_api_token=your-api-token-here, as in the snippet below. - Start the server from the MCP controls in VS Code and enter or confirm your token.
- Microsoft Copilot Studio is not covered by the docs, and a local command server is not a fit for it without your own hosting.
{
"servers": {
"clarity": {
"command": "npx",
"args": [
"@microsoft/clarity-mcp-server",
"--clarity_api_token=your-api-token-here"
]
}
}
}
Microsoft Clarity MCP Server in Perplexity
- The documentation does not cover Perplexity.
- Perplexity desktop app connectors are added through the app's connector settings. Take the exact steps from Perplexity's own documentation.
- Only use this server there if the app supports local command servers. If it does, use the command
npxwith the args@microsoft/clarity-mcp-serverand--clarity_api_token=<YOUR_CLARITY_API_TOKEN>. - If the app accepts only a remote URL, this server cannot be added directly, because the docs give no hosted endpoint.
Microsoft Clarity MCP Server in Cursor
- The documentation does not cover Cursor. It uses the standard
mcpServersJSONformat described in the generic example in the docs. - Open Cursor's MCP settings and choose to add a new server. This opens the
mcp.jsonconfig. - Paste the entry from the snippet below and replace
your-api-token-herewith your Clarity token. - Save the file and check that the server shows as enabled with its tools listed.
- Start a new chat and ask a narrow read-only question.
{
"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
- The documentation does not cover Claude Code. Use its standard
claude mcp addcommand for a local server. - Run the command below in your terminal, replacing
your-api-token-herewith your Clarity token. - Run
claude mcp listto confirm thatclarityis registered. - Start
claudeand ask a narrow read-only question about your Clarity project. - The token ends up in your Claude Code config and shell history, so keep both private.
claude mcp add clarity -- npx @microsoft/clarity-mcp-server --clarity_api_token=your-api-token-hereCheck 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.
- How to track custom events using Microsoft Clarity?
Troubleshooting
+The server does not appear in my client after editing the config.
Check that the JSON is valid and that the file is the one your client reads. Claude for Desktop must be fully restarted after saving. Confirm that Node.js v16 or higher is installed and that `npx` works in a terminal. Some clients ignore a config entry with a misplaced comma or bracket.
+Tools load but queries return authentication or empty results.
The token is probably wrong, revoked or from a different project. Regenerate it under `Settings > Data Export > Generate new API token` in the Clarity project and update the `--clarity_api_token` argument. Then compare results against your Clarity dashboard. The docs do not state rate limits beyond those of the Data Export API itself.
+The tool names I see differ from the documentation.
The docs are slightly inconsistent about tool names. They list `query-analytics-dashboard`, `list-session-recordings` and `query-documentation-resources`, and also mention a `get-clarity-data` tool when passing the token as a parameter. Use the tool list your client shows, and keep each request focused on one thing.
Written Oct 13, 2026 from the vendor documentation. Exact menus, addresses and commands change; the official documentation is the source of truth.