Microsoft Clarity MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
This is a Model Context Protocol (MCP) server for the Microsoft Clarity.
It allows you to access your session recordings, project analytics, and documentation from Clarity using Claude for Desktop or other MCP-compatible clients.
Key Features
- **Analytics Data Access**: Query your Microsoft Clarity analytics data including traffic metrics, user behavior insights, and performance statistics
- **Session Recording Retrieval**: Access and analyze session recordings to understand user interactions and identify optimization opportunities
- **Natural Language Querying**: Ask questions in plain English to get insights from your data - no need to learn complex query syntax or API endpoints
- **Flexible Data Filtering**: Filter results by various dimensions such as browser, device, country, and many more
- **Real-Time Data Access**: Fetch the latest analytics data and insights from your Clarity projects on-demand
- **Documentation Integration**: Get quick answers and guidance from Microsoft Clarity documentation directly within your workflow
- **Seamless MCP Integration**: Works natively with Claude for Desktop, Visual Studio Code, and other Model Context Protocol (MCP) compatible 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
1. Clone or download this repository
2. Install dependencies:
3. Build the TypeScript code:
4. Run the server:
Extension/Plugin Installation
Visual Studio Code Extension
Click the button above to install the Microsoft Clarity MCP server directly in Visual Studio Code.
Claude Desktop Plugin
Install from Claude's extension gallery:
1. Open **Claude Desktop**
2. Navigate to **File → Settings → Extensions**
3. Search for **Microsoft Clarity**
4. Click **Install** to add the extension
5. Configure your **API Token**:
Follow the instructions in the API Token section to retrieve and set it up correctly.
Configuration
You can provide the Clarity data export API token in two ways:
1. **Command Line Arguments**:
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:
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