Connect Microsoft Clarity Sessions to Claude Code
Read individual Clarity session recordings and uncapped dashboard aggregates for one project, with full control over the window and the page size. Add Toolspoke to Claude Code once and it can use 2 Microsoft Clarity Sessions actions. Your Microsoft Clarity Sessions credential stays in Toolspoke, and you choose which actions Claude Code may call.
Set it up in Claude Code
Three steps, the first one once for every toolkit you will ever add.
Add Toolspoke to Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcpThe sign-in opens in your browser, and Toolspoke asks you to approve it.
Install Microsoft Clarity Sessions and connect it
Add Microsoft Clarity Sessions to a project in your Toolspoke workspace.
Data Export API token. You provide it once, when you install the connector. Toolspoke encrypts it at rest and decrypts it only for the length of a single call, and the gateway attaches it to the outbound request itself, so it is never part of the arguments an agent sends.
- Data Export API token
- Clarity → Settings → Data Export → Generate new API token. Requires project admin. A token reaches only the project that issued it and neither operation takes a project argument, so install this once per Clarity project, each in its own Toolspoke project, which is what keeps one credential per install.
Choose what Claude Code may do
All 2 actions only read, and any of them can be switched off for a project.
What Claude Code can do in Microsoft Clarity Sessions
2 actions read.
Reads
Sample recordings
List individual session recordings with playback links, Core Web Vitals and per-page timelines, for one window of the project the installed credential belongs to. Use it when you need to see what a user actually did, dead clicks, rage clicks and quickbacks are only diagnosable from a recording. Roughly three weeks of recordings are retained; older windows come back empty rather than erroring. Returns only non-bot sessions, and a response holding exactly `count` rows has been truncated, read the guide before trusting a full page or the `timestamp` field.
Query dashboard
Ask for Clarity dashboard metrics in plain English and get the matching rows back, for the project the installed credential belongs to. Handles traffic, popular pages, dead and rage clicks, script errors, scroll depth, engagement time, and breakdowns by browser, device, OS, country, source or URL. Unlike the documented export endpoint this is not capped at three days. Ask one thing per call, always name the time range inside the question, and read the SQL echoed back in the response's `query` field to see what it truncated, it defaults to ten rows. This is the only Clarity endpoint that sees bot traffic, so it is the only one that can answer whether a project is polluted.
Microsoft Clarity Sessions in Claude Code: questions
Does Claude Code see my Microsoft Clarity Sessions credential?
No. The credential is stored encrypted in Toolspoke, and the gateway adds it to each call. Claude Code only ever talks to Toolspoke, and the dashboard shows the last four characters of the credential and nothing more.
Will 2 actions crowd Claude Code's context?
No. Toolspoke shows Claude Code five bridge tools, plus a guide where a toolkit has one, and Claude Code searches for the Microsoft Clarity Sessions action it needs when it needs it. Adding more toolkits does not add more tools to its list.
Can I add it once for every project?
Yes. Add --scope user to the command and Claude Code keeps Toolspoke in every project on this machine. Without it, the server is added to the project you ran the command in.
What does it cost?
Tool calls are free on every plan, and a Microsoft Clarity Sessions call does not run in a sandbox, so it bills nothing.
Microsoft Clarity Sessions in your other apps
More analytics toolkits for Claude Code
Try Microsoft Clarity Sessions in Claude Code
Free to start, and tool calls cost nothing on any plan.