Connect Amplitude to Claude Code
Query Amplitude event segmentation, funnels, retention, active users and annotations. Add Toolspoke to Claude Code once and it can use 9 Amplitude actions. Your Amplitude 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 Amplitude and connect it
Add Amplitude to a project in your Toolspoke workspace.
API key and secret. 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.
- API key and secret key
- Your project's API key, a colon, then its secret key. Amplitude → Settings → Projects → your project → General. Sent as HTTP Basic, key as username and secret as password. The secret key reads project data, so scope this to the one project this connection should reach.
Choose what Claude Code may do
All 9 actions only read, and any of them can be switched off for a project.
What you can ask Claude Code for
A few of the Amplitude actions that only read, so they are safe to try first.
- List the event types visible in the project, each with a weekly total
- Run a conversion funnel over an ad-hoc list of steps
- Measure how many users who did a starting action came back to do a returning action
- Count active or new users per day, week or month over a date range, optionally segmented and grouped
What Claude Code can do in Amplitude
9 actions read.
Reads
List event types
List the event types visible in the project, each with a weekly total. Call this first to learn the exact event names the segmentation, funnel and retention actions need. Amplitude matches event_type literally, and a near-miss returns an empty series rather than an error. Hidden events are excluded.
Event segmentation
The general-purpose reporting action: count an event over a date range, optionally against a second event, segmented and grouped. `metric` picks what is counted, uniques (distinct users), totals (all occurrences), pct_dau, average, or formula for a ratio such as UNIQUES(A)/UNIQUES(B), which needs the formula argument and a second event. Dates are YYYYMMDD, both required. `interval` is Amplitude's own coding: 1 daily, 7 weekly, 30 monthly, -3600000 hourly, -300000 real-time, and the shorter the interval the shorter the window Amplitude will serve, real-time reaches back two days, hourly seven, daily a year.
Funnel analysis
Run a conversion funnel over an ad-hoc list of steps. Give the steps in order as step_1 through step_5; only the first two are required and the rest are sent only when supplied. `mode` decides how strictly the order is read: ordered means the steps happened in that order, sequential means with nothing else in between, unordered means in any order. `conversion_window_seconds` is how long a user has to finish, defaulting to 30 days. Dates are YYYYMMDD.
Retention analysis
Measure how many users who did a starting action came back to do a returning action. start_event takes the literal _new for new users or _active for all users, as well as a real event type; returning_event takes _all for any event or _active for any active event. `retention_type` defaults to n-day; choose bracket to group days together, which then requires brackets, e.g. [[0,5]] for a Day 0 to Day 4 window. Dates are YYYYMMDD. Note the interval here has no hourly or real-time value, only 1, 7 or 30.
Active user counts
Count active or new users per day, week or month over a date range, optionally segmented and grouped. Use this for the plain "how many users" question, where event_segmentation would need an event to count. Dates are YYYYMMDD.
Realtime active users
How many users are active right now, in five-minute buckets over the last two days, with yesterday alongside today for comparison. Takes no arguments. Amplitude fixes the window and the granularity.
Get user activity
Fetch one user's profile and their event stream, newest first. This returns a real person: their user ID, device IDs, country, region, city, last known coordinates and every user property on their profile, followed by the events they fired. Use it to explain one specific user's path, not to gather users. Amplitude rate-limits this endpoint and its sibling get_user_search separately from the rest, at ten concurrent queries and 360 an hour.
Get user search
Find a user's Amplitude ID from an Amplitude ID, a device ID, a user ID or a user ID prefix. This is how you turn an identifier you already have into the amplitude_id that get_user_activity needs. Note that no match is not an error: Amplitude answers 200 with type "nomatch" and an empty matches array.
List annotations
List the chart annotations on the project, the dated notes a team leaves on a release, an outage or a campaign launch. Read these before explaining a jump or a drop in any of the reporting actions above; the explanation is often already written down here. Filter by chart_id or by category, but not by both, and by a date window. Dates here are ISO 8601 with an offset, not the YYYYMMDD the query endpoints use.
Amplitude in Claude Code: questions
Does Claude Code see my Amplitude 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 9 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 Amplitude 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 Amplitude call does not run in a sandbox, so it bills nothing.
Amplitude in your other apps
More analytics toolkits for Claude Code
Try Amplitude in Claude Code
Free to start, and tool calls cost nothing on any plan.