# Directory Structure
```
├── .gitignore
├── .mcpbignore
├── .npmignore
├── .vscode
│ └── settings.json
├── CODE_OF_CONDUCT.md
├── icon.png
├── LICENSE
├── manifest.json
├── package.json
├── README.md
├── SECURITY.md
├── src
│ ├── cli.ts
│ ├── constants.ts
│ ├── index.ts
│ ├── instructions.ts
│ ├── tools.ts
│ ├── types.ts
│ └── utils.ts
├── SUPPORT.md
└── tsconfig.json
```
# Files
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
```
# Source files (as they'll be compiled)
src/
# Development files
node_modules/
.vscode/
.git/
.gitignore
# Test files
test/
*.test.ts
*.spec.ts
# Configuration files
tsconfig.json
.eslintrc*
.prettierrc*
# Miscellaneous
.DS_Store
*.log
npm-debug.log*
```
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
```
# Dependency directories
node_modules/
# Build output
build/
dist/
*.dxt
*.mcpb
# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# IDE specific files
.idea/
!.vscode/
# Environment variables
.env
# OS specific files
.DS_Store
Thumbs.db
```
--------------------------------------------------------------------------------
/.mcpbignore:
--------------------------------------------------------------------------------
```
# Development files
src/
types/
tests/
# Configuration files
.npmrc
tsconfig.json
# Documentation files
docs/
*.md
# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# IDE specific files
.idea/
.vscode/
# Environment variables
.env
# OS specific files
.DS_Store
Thumbs.db
```
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
```markdown
# Microsoft Clarity MCP Server
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:
```bash
# 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:
```bash
npx @microsoft/clarity-mcp-server
```
With either option, you can provide your Clarity API token using the `--clarity_api_token` parameter:
```bash
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 run start
```
### Extension/Plugin Installation
#### Visual Studio Code Extension
[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install+Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522clarity-server%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540microsoft%252Fclarity-mcp-server%2522%255D%257D)
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**:
<br>
Follow the instructions in the [API Token section](#api-token) to retrieve and set it up correctly.
## Configuration
You can provide the [Clarity data export API](https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-data-export-api) token in two ways:
1. **Command Line Arguments**:
```bash
npx @microsoft/clarity-mcp-server --clarity_api_token=your-token
```
2. **Tool Parameters**:
<br>
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:
```json
{
"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
## Server Usage
The server exposes various tools that you can call from any MCP client.
Just ask naturally and keep each request focused on one thing.
### Query Analytics Dashboard
- <b>Name:</b> `query-analytics-dashboard`
- <b>Description:</b> Retrieves analytics data and metrics from your project's dashboard using a simplified natural language search query.
- <b>Examples:</b>
- How many Clarity sessions did we get from Egypt in the past 3 days?
- What are the most used browsers in my Clarity project?
- Show me traffic metrics from my Clarity project for the last week
### List Session Recordings
- <b>Name:</b> `list-session-recordings`
- <b>Description:</b> Lists your project's session recordings based on a specified filtering criteria. The filters allow you to narrow down the recordings by various fields such as URLs, device types, browser, OS, country, city, and more.
- <b>Examples:</b>
- List the most recent Clarity sessions from mobile devices
- Show the top 5 Clarity sessions with the highest number of user clicks
- Get Clarity recordings where users encountered JavaScript errors
### Query Documentation Resources
- <b>Name:</b> `query-documentation-resources`
- <b>Description:</b> Retrieves snippets from Microsoft Clarity documentation to find answers to user questions including step-by-step screenshots for setup guides, features, usage, troubleshooting, and integration instructions.
- <b>Examples:</b>
- How to track custom events using Microsoft Clarity?
- How many labels can I add to a recording in Microsoft Clarity?
## 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
## Privacy Policy
For information about data privacy and usage, please refer to the [Microsoft Clarity Privacy Policy](https://clarity.microsoft.com/privacy).
## License
This project is licensed under the <b>MIT</b> License.
```
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
```markdown
# Microsoft Open Source Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
Resources:
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [[email protected]](mailto:[email protected]) with questions or concerns
```
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
```markdown
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
If you prefer to submit without logging in, send email to [[email protected]](mailto:[email protected]). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->
```
--------------------------------------------------------------------------------
/src/cli.ts:
--------------------------------------------------------------------------------
```typescript
#!/usr/bin/env node
// This is the CLI entry point for the npx executable
import './index.js';
```
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
```json
{
"name": "@microsoft/clarity-mcp-server",
"version": "2.0.1",
"description": "MCP Server for Microsoft Clarity based on data export API",
"author": "Microsoft",
"license": "MIT",
"type": "module",
"main": "dist/index.js",
"homepage": "https://clarity.microsoft.com/",
"repository": {
"type": "git",
"url": "https://github.com/microsoft/clarity-mcp-server"
},
"keywords": [
"clarity",
"behavior-analytics-tools",
"heatmaps",
"session-recordings",
"insights",
"analytics",
"mcp",
"model-context-protocol",
"ai",
"agents"
],
"bin": {
"clarity-mcp-server": "./dist/cli.js"
},
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "tsc && node dist/index.js",
"prepublishOnly": "npm run build"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.20.2",
"zod": "^3.25.76"
},
"devDependencies": {
"@types/node": "^20.19.23",
"typescript": "^5.9.3"
}
}
```
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
```markdown
# TODO: The maintainer of this repo has not yet edited this file
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
# Support
## How to file issues and get help
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
## Microsoft Support Policy
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
```
--------------------------------------------------------------------------------
/src/tools.ts:
--------------------------------------------------------------------------------
```typescript
import {
ANALYTICS_DASHBOARD_URL,
CLARITY_API_TOKEN,
DOCUMENTATION_URL,
SESSION_RECORDINGS_URL
} from "./constants.js";
import {
type FiltersType,
type SortOptionsType,
SortOptionsEnum
} from "./types.js";
import { tryAsync } from "./utils.js";
export async function queryAnalyticsDashboardAsync(
query: string,
timezone: string,
): Promise<any> {
return await tryAsync(ANALYTICS_DASHBOARD_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
...(CLARITY_API_TOKEN ? { 'Authorization': `Bearer ${CLARITY_API_TOKEN}` } : {}),
},
body: JSON.stringify({
query: query,
timezone: timezone,
})
});
}
export async function queryDocumentationAsync(query: string): Promise<any> {
return await tryAsync(DOCUMENTATION_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
...(CLARITY_API_TOKEN ? { 'Authorization': `Bearer ${CLARITY_API_TOKEN}` } : {})
},
body: JSON.stringify({
query: query,
})
});
}
export async function listSessionRecordingsAsync(
startDate: Date,
endDate: Date,
filters: FiltersType,
sortBy: SortOptionsType,
count: number
): Promise<any> {
return await tryAsync(SESSION_RECORDINGS_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
...(CLARITY_API_TOKEN ? { 'Authorization': `Bearer ${CLARITY_API_TOKEN}` } : {})
},
body: JSON.stringify({
sortBy: SortOptionsEnum[sortBy],
start: startDate.toISOString(),
end: endDate.toISOString(),
filters: filters,
count: count
})
});
}
```
--------------------------------------------------------------------------------
/src/constants.ts:
--------------------------------------------------------------------------------
```typescript
import { getConfigValue } from "./utils.js";
export const CLARITY_API_TOKEN = getConfigValue('clarity_api_token');
// Endpoint URLs.
export const API_BASE_URL = `https://clarity.microsoft.com/mcp`;
export const SESSION_RECORDINGS_URL = `${API_BASE_URL}/recordings/sample`;
export const ANALYTICS_DASHBOARD_URL = `${API_BASE_URL}/dashboard/query`;
export const DOCUMENTATION_URL = `${API_BASE_URL}/documentation/query`;
// Tool names.
export const ANALYTICS_DASHBOARD_TOOL = "query-analytics-dashboard";
export const DOCUMENTATION_TOOL = "query-documentation-resources";
export const SESSION_RECORDINGS_TOOL = "list-session-recordings";
// Tool descriptions.
export const ANALYTICS_DASHBOARD_DESCRIPTION = "Fetch Microsoft Clarity analytics data using a simplified natural language search query. The query should be focused on one specific data retrieval or aggregation task. Avoid complex multi-purpose queries. Time ranges should be explicitly specified when possible. If no time range is provided, prompt the user to specify one.";
export const DOCUMENTATION_DESCRIPTION = "Retrieve Microsoft Clarity documentation snippets for finding answers to user questions including step-by-step screenshots for setup guides, features, usage, troubleshooting, and integration instructions. The query should be focused on one specific documentation topic or question. Avoid complex multi-purpose queries.";
export const SESSION_RECORDINGS_DESCRIPTION = "List Microsoft Clarity session recordings based on specified filters. The filters allow you to narrow down the recordings by various criteria such as URLs, device types, browser, OS, country, city, and more. The date filter is required and must be in UTC ISO 8601 format.";
```
--------------------------------------------------------------------------------
/src/utils.ts:
--------------------------------------------------------------------------------
```typescript
import { CLARITY_API_TOKEN } from "./constants.js";
// Get configuration from environment variables or command-line arguments
export const getConfigValue = (name: string, fallback?: string): string | undefined => {
// Check command line args first (format: --name=value)
const commandArg = process.argv.find(arg => arg.startsWith(`--${name}=`));
if (commandArg) {
return commandArg.split('=')[1];
}
// Then check environment variables
if (process.env[name] || process.env[name.toUpperCase()]) {
return process.env[name] || process.env[name.toUpperCase()];
}
return fallback;
};
export const tryAsync = async (input: string | URL | Request, init?: RequestInit | undefined): Promise<any> => {
// Use provided token or fallback to environment/command-line variables
// Check if we have the necessary credentials
if (!CLARITY_API_TOKEN) {
return {
content: [
{
type: "text",
text: "No Clarity API token provided. Please provide a token via the 'token' parameter, CLARITY_API_TOKEN environment variable, or --clarity_api_token command-line argument.",
},
],
};
}
try {
const response = await fetch(input, init);
if (!response.ok) {
throw new Error(`Endpoint request failed with status: ${input} ${response.status}`);
}
const data = await response.json();
return {
content: [
{
type: "text",
text: JSON.stringify(data, null, 2),
},
],
};
} catch (error) {
console.error("Error during fetch:", error);
return {
content: [
{
type: "text",
text: "An error occurred while fetching the data.",
},
],
};
}
};
```
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
```json
{
//
// File Settings
//
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"files.eol": "\r\n",
//
// Editor Settings
//
// Indentation.
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
// Wrapping.
"editor.rulers": [220],
"editor.wordWrap": "wordWrapColumn",
"editor.wordWrapColumn": 220,
"editor.wrappingIndent": "indent",
// Formatting.
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
// Code actions.
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit"
},
//
// Typescript Settings
//
// Preferences.
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.organizeImports": {
"enabled": true,
"sortImports": true,
"sortAndCombineImports": true
},
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.preferences.quoteStyle": "double",
// Formatting.
"typescript.format.enable": true,
"typescript.format.indentSwitchCase": true,
"typescript.format.insertSpaceAfterCommaDelimiter": true,
"typescript.format.insertSpaceAfterConstructor": false,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"typescript.format.insertSpaceAfterSemicolonInForStatements": true,
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": true,
"typescript.format.insertSpaceBeforeFunctionParenthesis": false,
"typescript.format.placeOpenBraceOnNewLineForControlBlocks": false,
"typescript.format.placeOpenBraceOnNewLineForFunctions": false,
"typescript.format.semicolons": "insert",
// Code actions.
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnPaste.enabled": true,
}
```
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
```json
{
"manifest_version": "0.2",
"name": "@microsoft/clarity-mcp-server",
"display_name": "Microsoft Clarity",
"version": "2.0.1",
"description": "MCP Server for Microsoft Clarity",
"long_description": "This extension enables integration between AI systems and Microsoft Clarity, providing access to project analytics, documentation, and session recordings.",
"author": {
"name": "Microsoft",
"url": "https://clarity.microsoft.com",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/microsoft/clarity-mcp-server"
},
"homepage": "https://clarity.microsoft.com",
"documentation": "https://github.com/microsoft/clarity-mcp-server",
"support": "https://github.com/microsoft/clarity-mcp-server/issues",
"icon": "icon.png",
"server": {
"type": "node",
"entry_point": "dist/index.js",
"mcp_config": {
"command": "node",
"args": [
"${__dirname}/dist/index.js"
],
"env": {
"CLARITY_API_TOKEN": "${user_config.api_token}"
}
}
},
"tools": [
{
"name": "list-session-recordings",
"description": "List Microsoft Clarity session recordings timeline information. Returns metadata including session link, duration, and a timeline of relevant user interactions."
},
{
"name": "query-documentation-data",
"description": "Fetch Microsoft Clarity documentation snippets for finding answers to user questions including step-by-step screenshots for setup guides, features, usage, troubleshooting, and integration instructions. The query should be focused on one specific documentation topic or question. Avoid complex multi-purpose queries."
},
{
"name": "query-analytics-data",
"description": "Fetch Microsoft Clarity analytics data using a simplified natural language search query. The query should be focused on one specific data retrieval or aggregation task. Avoid complex multi-purpose queries. Time ranges should be explicitly specified when possible. If no time range is provided, prompt the user to specify one."
}
],
"tools_generated": false,
"keywords": [
"clarity",
"api",
"analytics",
"behavior-analytics-tools",
"heatmaps",
"session-recordings",
"mcp",
"data insights",
"insights",
"model-context-protocol",
"ai",
"agent"
],
"license": "MIT",
"privacy_policies": [
"https://clarity.microsoft.com/privacy"
],
"compatibility": {
"claude_desktop": ">=0.10.0",
"platforms": [
"darwin",
"win32",
"linux"
],
"runtimes": {
"node": ">=16.0.0"
}
},
"user_config": {
"api_token": {
"type": "string",
"title": "Clarity API Token",
"description": "Provide your Clarity data export API token",
"required": true,
"sensitive": true
}
}
}
```
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
```typescript
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import pkg from "../package.json" with { type: "json" };
import {
ANALYTICS_DASHBOARD_DESCRIPTION,
ANALYTICS_DASHBOARD_TOOL,
CLARITY_API_TOKEN,
DOCUMENTATION_DESCRIPTION,
DOCUMENTATION_TOOL,
SESSION_RECORDINGS_DESCRIPTION,
SESSION_RECORDINGS_TOOL
} from "./constants.js";
import {
SYSTEM_INSTRUCTIONS_PROMPT
} from "./instructions.js";
import {
listSessionRecordingsAsync,
queryAnalyticsDashboardAsync,
queryDocumentationAsync
} from "./tools.js";
import {
ListRequest,
SearchRequest,
} from "./types.js";
// Create server instance
const server = new McpServer(
{
name: pkg.name,
version: pkg.version,
capabilities: {
resources: {},
tools: {}
},
},
{
instructions: SYSTEM_INSTRUCTIONS_PROMPT,
}
);
// Register the query-analytics-data tool
server.tool(
ANALYTICS_DASHBOARD_TOOL, /* Name */
ANALYTICS_DASHBOARD_DESCRIPTION, /* Description */
SearchRequest, /* Parameter Schema */
{ /* Metadata & Annotations */
title: "Query Analytics Dashboard",
readOnlyHint: true,
destructiveHint: false,
openWorldHint: false
},
async ({ query }) => {
return await queryAnalyticsDashboardAsync(query, Intl.DateTimeFormat().resolvedOptions().timeZone);
}
);
// Register the session-recordings tool
server.tool(
SESSION_RECORDINGS_TOOL, /* Name */
SESSION_RECORDINGS_DESCRIPTION, /* Description */
ListRequest, /* Parameter Schema */
{ /* Metadata & Annotations */
title: "List Session Recordings",
readOnlyHint: true,
destructiveHint: false,
openWorldHint: false
},
async ({ filters, sortBy, count }) => {
const now = new Date().toISOString();
// Calculate end as now, start as now - numOfDays
const endDate = new Date(filters?.date?.end || now);
const startDate = new Date(filters?.date?.start || now);
if (!filters?.date?.start) {
startDate.setDate(endDate.getDate() - 2);
}
return await listSessionRecordingsAsync(startDate, endDate, filters, sortBy, count);
}
);
// Register the query-documentation-resources tool
server.tool(
DOCUMENTATION_TOOL, /* Name */
DOCUMENTATION_DESCRIPTION, /* Description */
SearchRequest, /* Parameter Schema */
{ /* Metadata & Annotations */
title: "Query Documentation Resources",
readOnlyHint: true,
destructiveHint: false,
openWorldHint: false
},
async ({ query }) => {
return await queryDocumentationAsync(query);
}
);
// Main function
async function main() {
// Log configuration status
if (CLARITY_API_TOKEN) {
console.error("Clarity API token configured via environment/command-line");
} else {
console.error("No Clarity API token configured, it must be provided with each request");
}
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Microsoft Clarity Data Export MCP Server running on stdio...");
}
// Run the server
main().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});
```
--------------------------------------------------------------------------------
/src/instructions.ts:
--------------------------------------------------------------------------------
```typescript
import {
ANALYTICS_DASHBOARD_TOOL,
DOCUMENTATION_TOOL,
SESSION_RECORDINGS_TOOL
} from "./constants.js";
export const SYSTEM_INSTRUCTIONS_PROMPT = `
This MCP server provides access to Microsoft Clarity analytics dashboard data, documentation resources and session recordings.
## Available Tools
### 1. Session Recordings Tool: \`${SESSION_RECORDINGS_TOOL}\`
Lists Microsoft Clarity session recordings with metadata including session links, duration, and user interaction timelines.
**Parameters:**
- filters: Optional filters for sessions (date range, device type, etc.)
- sortBy: Sort option using SortOptions enum (default: SessionStart_DESC)
- count: Number of sessions to retrieve (1-250, default: 100)
**Sort Options:**
- SessionStart_DESC (newest first - default)
- SessionStart_ASC (oldest first)
- SessionDuration_ASC (shortest duration first)
- SessionDuration_DESC (longest duration first)
- SessionClickCount_ASC (fewest clicks first)
- SessionClickCount_DESC (most clicks first)
- PageCount_ASC (fewest pages first)
- PageCount_DESC (most pages first)
**Example Usage:**
- Get 10 newest sessions: { "count": 10, "sortBy": "SessionStart_DESC" }
- Get 20 longest sessions from date range: { "filters": { "date": { "start": "2024-01-01T00:00:00.000Z", "end": "2024-01-31T23:59:59.999Z" } }, "sortBy": "SessionDuration_DESC", "count": 20 }
- Get 15 mobile sessions with most clicks: { "filters": { "deviceType": ["Mobile"] }, "sortBy": "SessionClickCount_DESC", "count": 15 }
- Get oldest sessions first: { "sortBy": "SessionStart_ASC", "count": 100 }
- Get sessions with most page views: { "sortBy": "PageCount_DESC", "count": 100 }
### 2. Analytics Dashboard Tool: \`${ANALYTICS_DASHBOARD_TOOL}\`
This tool is your **primary and authoritative data source** for all dashboard-related insights and must be used to retrieve accurate, real-time data from the Microsoft Clarity dashboard.
#### Capabilities & Output
Microsoft Clarity dashboard provides comprehensive insights into the behavior and performance of the website, including:
- **User Analytics**: Unique and returning users, sessions, device types, browsers, operating systems
- **Geographic Data**: Countries, regions, traffic sources
- **Content Performance**: Popular pages, referrers, channels, campaigns, sources
- **User Behavior**: Smart events (Contact Us, Submit, etc.), scroll depth, click patterns
- **Technical Metrics**: JavaScript errors, URL performance
- **Performance Indicators**: Core Web Vitals (largest contentful paint, first input delay, cumulative layout shift)
- **User Experience**: Quick backs, dead clicks, rage clicks, session duration
The dashboard helps website owners understand their audience, traffic sources, content preferences, user engagement patterns, and identify potential technical issues.
**IMPORTANT GUIDELINES:**
- Use SIMPLE, SINGLE-PURPOSE queries only
- Always specify time ranges, full URLs and parameters explicitly; prompt the user if not provided
- Break complex requests into multiple separate queries
- Focus on ONE trend or aggregated metric per query
**Good Examples:**
- "Page views count for the last 7 days"
- "Top javascript errors for PC in January 2024"
- "Top pages for mobile in the last 3 days"
- "Distinct users visited https://www.example.com page last month?"
- "Average session duration for desktop users this week?"
**Bad Examples (DON'T DO THIS):**
- "Show me page views, average session duration, and conversion data for all devices across multiple pages with user demographics" (too complex, multiple purposes)
- "Analyze user behavior" (too vague, no time range)
- "Get all metrics" (too broad)
**Best Practices:**
✅ Be specific about time ranges
✅ Focus on one metric per query
✅ Specify device type, page, or user segment when relevant
✅ Use clear, actionable language
❌ Don't combine multiple unrelated metrics
❌ Don't use vague or overly broad queries
❌ Don't omit time ranges
❌ Don't ask for "everything" or "all data"
### 3. Documentation Tool: \`${DOCUMENTATION_TOOL}\`
This tool is your **primary and authoritative data source** for all documentation-related questions and must be used to retrieve accurate, real-time data from the Microsoft Clarity documentation.
#### Capabilities & Output
Microsoft Clarity documentation provides comprehensive, authoritative answers to every aspect of Clarity including step-by-step screenshots for setup guides, features, usage, troubleshooting, and integration instructions. The tool covers all topics and headlines from the official documentation, including:
- **Getting Started & Installation**
- About Clarity
- Sign up for Clarity
- Setup and install Clarity code
- Verify your installation
- Setup via third-party platforms (WordPress, Wix, Shopify, etc.)
- Setup for Vibe Coding Platforms
- Privacy disclosure wording
- Data retention
- Cookies and consent management (including Consent Mode)
- troubleshooting installation
- **Clarity for Mobile Apps**
- Android SDK
- iOS SDK
- React Native SDK
- Flutter SDK
- Cordova and Ionic SDK
- **Dashboard & Insights**
- Insights overview
- Dashboard features
- E-commerce features
- Blog features
- Recipe features
- **Session Recordings**
- What is a session recording?
- Session list
- Inline player
- Live recordings
- Visitor profile
- **Heatmaps**
- What is a heatmap?
- Heatmap features
- Click maps
- Scroll maps
- Area maps
- **Filters & Segments**
- Filters overview
- Exclusion filters
- Segments
- Regular expressions
- **Settings & Management**
- Account management
- Team management
- Masking
- IP blocking
- Funnels
- Smart events
- **Copilot in Clarity**
- Copilot overview
- Copilot chat
- Session insights
- Grouped session insights
- Heatmaps insights
- **Reference**
- API Reference
- Identify API
- Export API
- Custom tags
- Troubleshooting (installation, settings, recordings, heatmaps, dashboard, live extension)
- FAQ
- Glossary of terms
- Share Clarity
- Download Clarity
- **Additional Links & Resources**
- Blog
- Case studies
- Demo
- Previous versions
- Contribute
- Privacy, Terms of Use, Trademarks
The documentation plugin helps users answer frequently asked questions for every headline and topic listed in the official Microsoft Clarity documentation, supporting all use cases, troubleshooting, integrations, and advanced features.
`;
```
--------------------------------------------------------------------------------
/src/types.ts:
--------------------------------------------------------------------------------
```typescript
import { z } from "zod";
export enum SortOptionsEnum {
SessionStart_DESC = 0,
SessionStart_ASC = 1,
SessionDuration_ASC = 2,
SessionDuration_DESC = 3,
SessionClickCount_ASC = 4,
SessionClickCount_DESC = 5,
PageCount_ASC = 6,
PageCount_DESC = 7,
}
export type FiltersType = z.infer<typeof Filters>;
export type SortOptionsType = z.infer<typeof SortOptions>;
const UrlFilter = z.object({
url: z.string(),
operator: z.enum(["contains", "startsWith", "endsWith", "excludes", "isExactly", "isExactlyNot", "matchesRegex", "excludesRegex"]),
});
const createRangeFilter = (min: number, max: number) => z.object({
min: z.number().min(min).max(max).nullable(),
max: z.number().min(min).max(max).nullable(),
});
const NullableRangeFilter = z.object({
min: z.number().nullable(),
max: z.number().nullable(),
});
const Filters = z.object({
referringUrl: z.string().optional().describe("Filter by the referring URL that brought users to the site"),
userType: z.enum(["NewUser", "ReturningUser"]).optional().describe("Filter by user type. Accepted values: NewUser, ReturningUser"),
sessionIntent: z.enum(["Low Intention", "Medium Intention", "High Intention"]).optional().describe("Filter by session intention level/user behavior classification."),
visitedUrls: z.array(UrlFilter).optional().describe("Filter by URLs visited during the session with pattern matching."),
entryUrls: z.array(UrlFilter).optional().describe("Filter by entry/landing page URLs with pattern matching."),
exitUrls: z.array(UrlFilter).optional().describe("Filter by exit page URLs with pattern matching."),
country: z.array(z.string()).optional().describe("Filter by country names (e.g., ['United States', 'Canada', 'United Kingdom'])"),
city: z.array(z.string()).optional().describe("Filter by city names (e.g., ['New York', 'London', 'Tokyo'])"),
state: z.array(z.string()).optional().describe("Filter by state/province names (e.g., ['California', 'Ontario', 'Bavaria'])"),
deviceType: z.array(z.enum(["Mobile", "Tablet", "PC", "Email", "Other"])).optional().describe("Filter by device types."),
browser: z.array(z.enum(["Bot", "MiuiBrowser", "Chrome", "CoralWebView", "Edge", "Other", "Firefox", "IE", "Unknown", "Headless", "MobileApp", "Opera", "OperaMini", "Safari", "Samsung", "SamsungInternet", "Sogou", "UCBrowser", "YandexBrowser", "QQBrowser"])).optional().describe("Filter by browser types."),
os: z.array(z.enum(["BlackBerry", "Android", "ChromeOS", "iOS", "Linux", "MacOS", "Other", "Windows", "WindowsMobile"])).optional().describe("Filter by operating systems."),
source: z.array(z.string()).optional().describe("Filter by UTM source parameter values (e.g., ['google', 'facebook', 'direct'])"),
medium: z.array(z.string()).optional().describe("Filter by UTM medium parameter values. Common values: ['organic', 'cpc', 'email', 'social', 'referral']"),
campaign: z.array(z.string()).optional().describe("Filter by UTM campaign parameter values (e.g., ['summer_sale', 'product_launch'])"),
channel: z.array(z.enum(["OrganicSearch", "Direct", "Email", "Display", "Social", "PaidSearch", "Other", "Affiliate", "Referral", "Video", "Audio", "SMS", "AITools", "PaidAITools"])).optional().describe("Filter by marketing channel classifications."),
smartEvents: z.array(z.string()).optional().describe("Filter by smart event names/IDs. Can be user-defined events or Clarity auto events: 'Purchase', 'ContactUs', 'SubmitForm', 'AddToCart', 'RequestQuote', 'SignUp', 'BeginCheckout', 'Download', 'Login', 'Search', 'Play', 'Deposit', 'Schedule', 'Subscribe', 'FindLocation', 'OutboundClick', 'ShowMore', 'Book', 'RetryRefresh', 'Pay', 'Pause', 'Upload', 'CheckAvailability', 'Withdraw', 'Export', 'SeeReviews', 'AddPaymentMethod', 'AddToWishlist', 'NotifyMe', 'CheckIn', 'TransferMoney', 'Upgrade', 'ContinueAsGuest', 'Mute', 'Exchange', 'ApplyCoupon', 'Unsubscribe', 'AddToCalendar', 'Unmute', 'EnterFullScreen', 'DeleteAccount', 'AppInstall', 'Checkout', 'OrderSuccess'"),
javascriptErrors: z.array(z.string()).optional().describe("Filter by JavaScript error messages or patterns. Use empty string '' to match any JavaScript error"),
clickErrors: z.array(z.string()).optional().describe("Filter by click error patterns or messages. Use empty string '' to match any click error"),
clickedText: z.string().optional().describe("Filter by specific text content that was clicked (partial match supported)"),
enteredTextPresent: z.boolean().optional().describe("Filter sessions where text input events occurred. Set to true to include only sessions with text input"),
selectedTextPresent: z.boolean().optional().describe("Filter sessions where text selection events occurred. Set to true to include only sessions with text selection"),
resizeEventPresent: z.boolean().optional().describe("Filter sessions where page resize events occurred. Set to true to include only sessions with resize events"),
cursorMovement: z.boolean().optional().describe("Filter sessions with cursor/pointer movement activity. Set to true to include only sessions with cursor movement"),
deadClickPresent: z.boolean().optional().describe("Filter sessions containing dead clicks (clicks with no response). Set to true to include only sessions with dead clicks"),
rageClickPresent: z.boolean().optional().describe("Filter sessions containing rage clicks (rapid repeated clicks). Set to true to include only sessions with rage clicks"),
excessiveScrollPresent: z.boolean().optional().describe("Filter sessions with excessive scrolling behavior. Set to true to include only sessions with excessive scrolling"),
quickbackClickPresent: z.boolean().optional().describe("Filter sessions with quick back navigation clicks. Set to true to include only sessions with quick back clicks"),
visiblePageDuration: NullableRangeFilter.optional().describe("Filter by time spent on visible pages in minutes. Set to null to ignore this filter."),
hiddenPageDuration: NullableRangeFilter.optional().describe("Filter by time spent on hidden/background pages in minutes. Set to null to ignore this filter."),
pageDuration: NullableRangeFilter.optional().describe("Filter by total page duration in minutes. Set to null to ignore this filter."),
sessionDuration: NullableRangeFilter.optional().describe("Filter by total session duration in minutes. Set to null to ignore this filter."),
scrollDepth: createRangeFilter(0, 100).optional().describe("Filter by maximum scroll depth percentage. Set to null to ignore this filter."),
pagesCount: NullableRangeFilter.optional().describe("Filter by number of pages visited in session. Set to null to ignore this filter."),
pageClickEventCount: NullableRangeFilter.optional().describe("Filter by number of clicks per page. Set to null to ignore this filter."),
sessionClickEventCount: NullableRangeFilter.optional().describe("Filter by total clicks per session. Set to null to ignore this filter."),
performanceScore: createRangeFilter(0, 100).optional().describe("Filter by overall performance score. Set to null to ignore this filter."),
largestContentfulPaint: NullableRangeFilter.optional().describe("Filter by Largest Contentful Paint web vital in seconds. Set to null to ignore this filter."),
cumulativeLayoutShift: NullableRangeFilter.optional().describe("Filter by Cumulative Layout Shift web vital in seconds. Set to null to ignore this filter."),
firstInputDelay: NullableRangeFilter.optional().describe("Filter by First Input Delay web vital in milliseconds. Set to null to ignore this filter."),
productRating: NullableRangeFilter.optional().describe("Filter by product ratings (e.g., 1-5 stars). Set to null to ignore this filter."),
productRatingsCount: NullableRangeFilter.optional().describe("Filter by number of product ratings. Set to null to ignore this filter."),
productPrice: NullableRangeFilter.optional().describe("Filter by product price range. Set to null to ignore this filter."),
productName: z.string().optional().describe("Filter by product name (partial match supported using contains operator)"),
productPurchases: z.boolean().optional().describe("Filter sessions with checkout conversion/purchases. Set to true to include only sessions with purchases"),
productAvailability: z.boolean().optional().describe("Filter by product availability status. Set to true to include only sessions with available products"),
productBrand: z.array(z.string()).optional().describe("Filter by product brand names (e.g., ['Nike', 'Apple', 'Samsung'])"),
checkoutAbandonmentStep: z.array(z.string()).optional().describe("Filter by checkout abandonment steps/stages (e.g., ['cart', 'shipping', 'payment'])"),
date: z.object({
start: z.string().describe("The start date of the time interval in UTC ISO 8601 with milliseconds format (yyyy-MM-ddTHH:mm:ss.fffZ)."),
end: z.string().describe("The end date of the time interval in UTC ISO 8601 with milliseconds format (yyyy-MM-ddTHH:mm:ss.fffZ)."),
}),
})
.describe("A set of filters that can be applied to the Microsoft Clarity to session recordings. This allows you to filter recordings based on various criteria such as URLs, device types, browser, OS, country, city, and more. The date filter is required and must be in UTC ISO 8601 format.");
const SampleCount = z.number().lte(250, "Maximum sample count is 250").default(100).describe("The number of sample session recordings to return. Default is 100. Maximum is 250.");
const SortOptions = z.enum([
"SessionStart_DESC",
"SessionStart_ASC",
"SessionDuration_ASC",
"SessionDuration_DESC",
"SessionClickCount_ASC",
"SessionClickCount_DESC",
"PageCount_ASC",
"PageCount_DESC",
]).default("SessionStart_DESC").describe("Sort option for session recordings. Default is SessionStart_DESC (newest first).");
const SearchQuery = z.string().describe("A natural language search query string for filtering and shaping analytics data. The query should be specific and include temporal constraints when available. (e.g., 'Top browsers last 3 days', 'The active time duration for mobile devices in United States last week'). Time ranges should be explicitly specified when possible. If no time range is provided, prompt the user to specify one.");
export const ListRequest = {
filters: Filters,
sortBy: SortOptions,
count: SampleCount
};
export const SearchRequest = {
query: SearchQuery,
};
```
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
```json
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "ES2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
// "libReplacement": true, /* Enable lib replacement. */
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "NodeNext", /* Specify what module code is generated. */
"moduleResolution": "Node16", /* Specify how TypeScript looks up a file from a given module specifier. */
"rootDir": "./src", /* Specify the root folder within your source files. */
"outDir": "./dist", /* Specify an output folder for all emitted files. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
"resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
// "removeComments": true, /* Disable emitting comments. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
// "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
// "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
"noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"include": ["src/**/*"]
}
```