Sponsored by Deepsite.site

Microsoft Clarity

Created By
Microsoft9 months ago
Get your behavioral analytics powered by Microsoft Clarity for your websites and mobile apps
Content

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

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

Option 2: Run with npx without installing

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

Option 3: Manual Installation

  1. Clone or download this repository
  2. Install dependencies:
    npm install
    
  3. Build the TypeScript code:
    npm run build
    
  4. Run the server:
    npm start
    

Configuration

You can provide the Clarity data export API token in two ways:

  1. Command Line Arguments:

    npx @microsoft/clarity-mcp-server --clarity_api_token=your-token
    
  2. Tool Parameters:

    • Provide token as a parameter when calling the get-clarity-data tool

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:

{
  "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.

Claude for Desktop Configuration

To configure Claude for Desktop to use this server:

  1. Open your Claude for Desktop configuration file:

    • Windows: %AppData%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add the configuration shown in the generic example above

  3. 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:

  1. Go to your Clarity project
  2. Select Settings -> Data Export -> Generate new API token
  3. Provide a descriptive name for the token
  4. 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

Server Config

{
  "mcpServers": {
    "@microsoft/clarity-mcp-server": {
      "command": "npx",
      "args": [
        "@microsoft/clarity-mcp-server",
        "--clarity_api_token=your-api-token-here"
      ]
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Playwright McpPlaywright MCP server
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"