clarity-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Superseded by seo-stack-mcp — the same tools plus GSC, GA4, Bing Webmaster and Microsoft Clarity unified in a single uvx-installable MCP server with local credentials. This repo remains as the remote-SSE variant.
MCP Clarity — Microsoft Clarity Data Export API
Server MCP per Microsoft Clarity ospitato su CT102, registrato come upstream clarity del mcp-gateway con tag analytics.
Architettura
Voce | Valore |
Stack | Python 3.12 + FastMCP ( |
Porta | 8091 |
Working dir |
|
Stato persistente |
|
Systemd |
|
Endpoint API |
|
Auth |
|
Quota | 10 chiamate/giorno/progetto, reset UTC (hard stop locale a 9) |
Tag gateway |
|
Related MCP server: Influencers Club MCP Server
Tool esposti
Tool | Cosa fa |
| Sessions / bot % / pages-per-session per dimensione |
| Top URL per visite |
| Engagement time + scroll depth |
| Top URL con click su elementi non interattivi |
| Top URL con click ripetuti veloci (frustrazione) |
| Top URL con scroll eccessivo |
| Top URL con bounce immediato |
| JS errors + error clicks per URL |
| Raw breakdown libero (power user) |
| Quota residua oggi (locale, niente API call) |
| Progetti configurati nel server |
Cache condivisa: tutti i tool URL-based (popular_pages, dead_clicks, rage_clicks, excessive_scroll, quickback_clicks, script_errors, engagement con dimension=URL) usano la stessa chiave cache → 1 chiamata API alimenta 7 tool.
Configurazione
1. Generare il token Clarity
Vai su clarity.microsoft.com, apri il progetto.
Settings → Data Export → Generate new API token.
Dai un nome (4-32 char, no spazi, no
@#$%&*!).Copia il token (mostrato una sola volta).
Solo gli admin del progetto possono generare token.
2. Variabili .env
Copia .env.example in .env e compila:
PORT=8091
CLARITY_TOKENS={"calcolatorigratis":"eyJhbG..."}
CLARITY_DEFAULT_PROJECT=calcolatorigratis
CLARITY_CACHE_DB_PATH=/var/lib/clarity-mcp/cache.db
CLARITY_QUOTA_PATH=/var/lib/clarity-mcp/quota.json
CLARITY_CACHE_TTL=21600
CLARITY_DAILY_LIMIT=9
CLARITY_WARNING_THRESHOLD=7Multi-progetto: aggiungi chiavi al JSON, es. {"calcolatorigratis":"...", "tuttoseo":"..."}. Le chiamate prendono project="alias" come primo parametro.
Deploy su CT102
./deploy/install.sh root@192.168.1.107Lo script: rsync della working dir, crea .venv, installa requirements, crea /var/lib/clarity-mcp, installa il systemd unit e fa restart. Se .env non esiste su CT102, lo copia dall'esempio (poi va compilato con il token).
Avvio manuale (debug locale)
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
PORT=8091 CLARITY_TOKENS='{"test":"<token>"}' python clarity_server.py
curl http://localhost:8091/Registrazione nel mcp-gateway
Su CT102, append in /etc/mcp-gateway/upstreams.yaml:
- name: clarity
url: http://127.0.0.1:8091/sse
tags:
- analyticsPoi:
systemctl restart mcp-gateway
curl -s https://mcp.calcolatorigratis.com/healthz | grep clarityVisibile in Claude Code come mcp__mcp-gateway__clarity__*.
Verifica end-to-end
# 1. Service attivo
ssh root@192.168.1.107 'systemctl status clarity-mcp'
# 2. Homepage / health
curl http://192.168.1.107:8091/
# 3. SSE endpoint
curl -H "Accept: text/event-stream" http://192.168.1.107:8091/sse
# 4. Gateway
curl -s https://mcp.calcolatorigratis.com/healthz
# 5. Da Claude Code (sessione con tag analytics caricato)
# → chiamare mcp__mcp-gateway__clarity__clarity_list_projects
# → chiamare mcp__mcp-gateway__clarity__clarity_quota_status
# → chiamare mcp__mcp-gateway__clarity__clarity_trafficTroubleshooting
Sintomo | Causa | Fix |
| Token scaduto o non valido | Rigenerare in clarity.microsoft.com → Data Export |
| Token non admin | Solo admin del progetto può generare token Data Export |
| Superato 10/giorno (lato API) | Reset mezzanotte UTC, riusa la cache ( |
| Superato | Stesso effetto del 429, aspetta reset UTC |
| Alias non in | Aggiungere |
Tool ritorna | Niente sessioni nel range | Normale su siti a basso traffico — controllare in dashboard Clarity |
Vincoli API ricordare
numOfDays∈ {1, 2, 3} (ultime 24/48/72h, niente date arbitrarie).Max 3 dimensioni per request.
Risposta max 1.000 righe, non paginabile.
10 chiamate/giorno/progetto, reset UTC.
Dimensioni valide:
Browser, Device, Country/Region, OS, Source, Medium, Campaign, Channel, URL.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted Microsoft Clarity MCP server, with each action switched on or off per account.
Hosted MCP server for DataLikers — Instagram & TikTok data API. 51 tools: Instagram user search by demographics (gender/age/race/country/city), profiles, bulk lookup, engagement, posts & reels, comments, hashtags, locations, stories, highlights, music, business accounts, top users; TikTok users, videos, comments, hashtags, playlists and top charts. Streamable HTTP, Bearer API key. Free tier: 100 requests on signup at https://datalikers.com/p/1by27bwg
Clamp Analytics MCP server: traffic, revenue, funnels, cohorts, errors, and search, for AI agents.
Hosted MCP server for GA4, Google Ads and Search Console. Google OAuth, nothing to install.
Related MCP Servers
- AlicenseAqualityDmaintenanceA 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.318,913 npm139MIT
- AlicenseAqualityBmaintenanceMCP server for the Influencers Club API — creator enrichment, discovery, audience analysis, content data, batch operations, and account management.22112 PyPI13MIT
- FlicenseNot gradedqualityDmaintenanceRead-only MCP server exposing Microsoft Clarity analytics data as tools for ChatGPT Agent Builder.-
- FlicenseAqualityBmaintenanceMCP server wrapping the Akamai mPulse Query API v2 to fetch RUM aggregate data (summaries, histograms, per-minute time series) with loss-free numbers for downstream statistical analysis.8-