
Microsoft Clarity Data Export
STDIOOfficialMCP server for accessing Microsoft Clarity analytics data through client applications
MCP server for accessing Microsoft Clarity analytics data through client applications
This is a Model Context Protocol (MCP) server for the Microsoft Clarity data export API. It allows you to fetch analytics data 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 start
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:
token
as a parameter when calling the get-clarity-data
toolMCP 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:
Open your Claude for Desktop configuration file:
%AppData%\Claude\claude_desktop_config.json
~/Library/Application Support/Claude/claude_desktop_config.json
Add the configuration shown in the generic example above
Save the configuration file and restart Claude for Desktop
When using an MCP client with this server configured, you can ask it to fetch Clarity data. For example:
"Can you fetch my Clarity data for the last day, filtered by Browser and showing Traffic metrics?"
The MCP client will then prompt you to run the get-clarity-data
tool, which requires:
numOfDays
: Number of days to retrieve (1-3)dimensions
: Array of dimensions to filter by (optional)metrics
: Array of metrics to retrieve (optional)If you haven't configured your credentials via command-line arguments, you'll also need to provide:
token
: Your Clarity API tokenTo generate an API token:
MIT