Provider REST API
AnalyticsConnect Claude to Microsoft Clarity Sessions
Read individual Clarity session recordings and uncapped dashboard aggregates for one project, with full control over the window and the page size. Toolspoke puts 2 of its actions behind one MCP endpoint that Claude, Cursor, and Codex all speak.
- Connection
- Provider REST API
- Authentication
- Data Export API token
- Actions exposed
- 2
- Cost per call (typical)
- 1 credit
- Adapter
- Maintained by Toolspoke
Connected in three steps
- 1
Install Microsoft Clarity Sessions
Open the marketplace in your workspace, add Microsoft Clarity Sessions to the project your agents work in, and it appears on the gateway immediately.
- 2
Connect the credential
Authenticate with data export api token. Where to get one, and what it has to be able to reach, is the next section.
- 3
Point your agent at the gateway
Give your client one address, https://toolspoke.com/mcp. Claude Code takes it as a command, Claude and Claude Desktop add it as a custom connector, and Cursor, Codex and VS Code each read it from a config file of their own.
.mcp.json{
"mcpServers": {
"toolspoke": {
"type": "http",
"url": "https://toolspoke.com/mcp"
}
}
}One block covers every tool you have installed. Microsoft Clarity Sessions shows up in the client as soon as your policy allows it, and so does everything else you install later.
Where the address goes, per client
- Claude Code
Run it in your project, then /mcp to sign in
claude mcp add --transport http toolspoke https://toolspoke.com/mcp- Claude and Claude Desktop
Settings, then Connectors, then Add custom connector
https://toolspoke.com/mcp- Cursor
~/.cursor/mcp.json, or .cursor/mcp.json for one project
{ "mcpServers": { "toolspoke": { "url": "https://toolspoke.com/mcp" } } }- Codex
~/.codex/config.toml
[mcp_servers.toolspoke] url = "https://toolspoke.com/mcp"- VS Code
.vscode/mcp.json, or the MCP: Add Server command
{ "servers": { "toolspoke": { "type": "http", "url": "https://toolspoke.com/mcp" } } }
What Microsoft Clarity Sessions asks for
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 tokenRequired
- 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.
- eyJhbGciOi…
What Claude can do in Microsoft Clarity Sessions
2 actions, each one declared and named by the connector rather than discovered at runtime. A workspace policy grants a person all of them, a hand-picked selection, everything on the read side, everything on the write side, or none.
- Reads
- 2Reads
- Writes
- 0Writes
- Destructive
- 0Destructive
Reads
2Fetches data and changes nothing.
sample_recordingsList 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_dashboardAsk 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.
What it will not do
Enforced by the gateway rather than left to convention, which is why each of these can be stated flatly.
- It cannot call anything else
- The 2 actions above are the whole of it. A call to any other name is refused before it reaches Microsoft Clarity Sessions rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time.
- It only reads
- Every action here reads. Nothing this connector can do changes anything in Microsoft Clarity Sessions.
- It reaches no further than your credential
- Toolspoke holds no access to Microsoft Clarity Sessions of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either.
- It never hears from Microsoft Clarity Sessions
- Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Microsoft Clarity Sessions. An agent has to ask.
- It does not smooth over provider limits
- Toolspoke does not retry, queue or back off around Microsoft Clarity Sessions's own rate limits. A call that Microsoft Clarity Sessions refuses comes back to the agent as a failed call.
Using Microsoft Clarity Sessions with an agent
Written by whoever built this connector. Agents read the same text on demand through read_guide, so what is below is what they see.
Three things about these endpoints decide whether an answer is true, and no schema can enforce any of them.
A full page is a truncated page. Clarity honours count and never reports a total, so a response holding exactly the count you asked for is the one case you must not trust. Halve the window, query both halves, and keep halving until every response comes back under the cap. Reporting such a window as fully reviewed is the single easiest way to miss the sessions that mattered.
`timestamp` is when the session ENDED; the window filters on when it STARTED. Subtract totalDuration to get the start. Two consequences: an empty result means "nothing started in this window", not "nothing happened in it"; and consecutive windows tile correctly only if you overlap them by more than your longest expected session - an hour or two - because a session in progress at the previous boundary is returned by the window it started in, not the one it ended in. Rows are also not strictly ordered by implied start even when sortBy says they should be.
`sample_recordings` returns only NON-BOT sessions. Microsoft does not document this. It means the recordings stream cannot measure bot or CI pollution - it has already removed it, and a project that is 99% headless-browser traffic looks clean here. Use query_dashboard for that, grouping by host and asking for bot and non-bot counts as separate columns; it is the only one of the two that sees bot traffic at all. The flip side is useful: a recording that came back was not bot-classified, which is real evidence when a finding turns on whether a human saw something.
Beyond that: query_dashboard answers a "top N by sessions" reading of your question, defaults to 10 rows, and echoes the SQL it chose back in the query field - read that echo to see what it cut. Name the hosts or the row count you want when the volumes are lopsided, or a top-10 can be entirely development traffic with every production URL below the fold. Always state the date range inside the question text.
Core Web Vitals arrive per page in the recordings response. CLS: 0 paired with LCP: "0s" means the vitals were never captured, not that the page is stable - count only page views where LCP is a real value. CLS also accumulates across a session, so rising values on successive page views of one visit are one shifting load, not three observations.
Before you connect it
What can Claude do in Microsoft Clarity Sessions?
2 named actions: 2 that only read. They include sample_recordings and query_dashboard. Nothing outside that list is reachable: the connector declares each operation by name rather than proxying whatever an agent asks for.
What credentials does the Microsoft Clarity Sessions connector need?
Data Export API token. The connector asks for data export api token. Values are encrypted at rest and attached to the outbound request by the gateway, so they are never part of the arguments an agent sends and never reach the audit log.
Does the Microsoft Clarity Sessions connector work with Cursor and Codex, or only Claude?
Any client that speaks MCP, and every one of them gets the same 2 actions. There is a single address, https://toolspoke.com/mcp. Claude Code adds it with claude mcp add --transport http, Claude and Claude Desktop take it as a custom connector in settings, Cursor reads it from .cursor/mcp.json, Codex from ~/.codex/config.toml, and VS Code from .vscode/mcp.json. Each of them signs in to the gateway itself, so there is no key to paste.
What does the Microsoft Clarity Sessions connector not do?
The 2 actions above are the whole of it. A call to any other name is refused before it reaches Microsoft Clarity Sessions rather than forwarded on, and connecting your account does not add to the list: it is fixed by the connector, not discovered at run time. Every action here reads. Nothing this connector can do changes anything in Microsoft Clarity Sessions. Toolspoke holds no access to Microsoft Clarity Sessions of its own. Every call carries the credential you stored and nothing besides, so whatever that credential cannot reach, this connector cannot reach either. Nothing is pushed to it. There is no webhook, no subscription and no polling, so this connector cannot notice by itself that something changed in Microsoft Clarity Sessions. An agent has to ask. Toolspoke does not retry, queue or back off around Microsoft Clarity Sessions's own rate limits. A call that Microsoft Clarity Sessions refuses comes back to the agent as a failed call.
Can I limit which actions an agent can call?
Yes, in two places. The project switches Microsoft Clarity Sessions's actions on and off one at a time, for everyone in the project at once, and the screen groups them by read, write and destructive so turning off everything that deletes is one click. An individual agent key can then be narrowed further, to particular toolkits in a project and to particular actions in a toolkit. Whatever it was granted, a key never reaches a project its owner cannot.
What gets recorded when an agent calls Microsoft Clarity Sessions?
Every attempt, with the agent that made it and the person that agent belongs to, the full request payload, the response payload, the status, the duration, and the credits spent. Values whose key names a secret are masked out before the record is shown to anyone. An operation the connector marks as not retained never has its response body written at all, so the gateway keeps no second copy of what was read.