Supports configuration with Claude for Desktop on macOS systems, using a specific configuration file path at ~/Library/Application Support/Claude/claude_desktop_config.json.
Runs as a Node.js application, using the Microsoft Clarity data export API to fetch analytics data with customizable filters and metrics.
Available as an npm package for easy installation and execution, with support for providing API credentials through command line arguments.
Built with TypeScript, providing type-safe interaction with the Microsoft Clarity analytics data export API.
Microsoft Clarity Data Export MCP Server
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.
Features
- Query Microsoft Clarity analytics data through a simple interface
- Filter by up to 3 dimensions (Browser, Device, Country/Region, OS, etc.)
- Retrieve various metrics (Scroll Depth, Engagement Time, Traffic, etc.)
- Seamlessly integrates with Claude for Desktop and other MCP clients
Setup and Installation
Prerequisites
- Node.js v16 or higher
- A Microsoft Clarity account and API token
- Any MCP-compatible client (Claude for Desktop, etc.)
Installation
Option 1: Install via npm (recommended)
You can install and run this package directly using npm:
Option 2: Run with npx without installing
You can run the server directly using npx without installing:
With either option, you can provide your Clarity API token using the --clarity_api_token
parameter:
Option 3: Manual Installation
- Clone or download this repository
- Install dependencies:
- Build the TypeScript code:
- Run the server:
Configuration
You can provide the Clarity data export API token in two ways:
- Command Line Arguments:
- Tool Parameters:
- Provide
token
as a parameter when calling theget-clarity-data
tool
- Provide
Configuring MCP Clients
Generic MCP Client Configuration
MCP clients typically require configuration to connect to the server. Here's a general example of how to configure an MCP client:
The specifics of where and how to add this configuration will depend on your specific MCP client.
Claude for Desktop Configuration
To configure Claude for Desktop to use this server:
- Open your Claude for Desktop configuration file:
- Windows:
%AppData%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- Add the configuration shown in the generic example above
- Save the configuration file and restart Claude for Desktop
Using the Server
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 token
API Token
Getting Your API Token
To generate an API token:
- Go to your Clarity project
- Select Settings -> Data Export -> Generate new API token
- Provide a descriptive name for the token
- Save the generated token securely
Limitations
- Maximum of 10 API requests are allowed per project per day
- Data retrieval is confined to the previous 1 to 3 days
- Maximum of three dimensions can be passed in a single request
- The response is limited to 1,000 rows and can't be paginated
License
MIT
This server cannot be installed
A Model Context Protocol server that lets you fetch Microsoft Clarity analytics data through Claude for Desktop or other MCP-compatible clients, with support for filtering by dimensions and retrieving various metrics.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server built with mcp-framework that allows users to create and manage custom tools for processing data, integrating with the Claude Desktop via CLI.Last updated -484TypeScript
- -securityFlicense-qualityA Model Context Protocol server that allows Claude Desktop to perform document operations on Microsoft Word, Excel, and PDF files including creation, editing, and format conversion.Last updated -9Python
- AsecurityAlicenseAqualityA Model Context Protocol server that enables interaction with Microsoft Dynamics 365 CRM from Claude Desktop, allowing users to retrieve, create, and update CRM data through natural language.Last updated -54TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables Claude Desktop to interact with Microsoft Dynamics 365, allowing users to retrieve information, create and update accounts, and manage opportunities through natural language.Last updated -54TypeScriptMIT License