Add Sprites to Claude Code
Available on Any Claude Code install, on Pro, Max, Team, Enterprise or an API key. You need a Sprites account with Google Analytics 4 already connected — the connector acts on that connection, so Claude Code never handles a GA4 credential.
Add the server in one line
Run the command once. --scope user makes Sprites available in every project; leave it off and the server is saved for the current project only, in ~/.claude.json.
Terminalclaude mcp add --transport http --scope user sprites https://mcp.sprites.ai/mcpOr share it with the repo
To give the whole team the server, add it to .mcp.json at the repository root. Each person still signs in as themselves, and Claude Code asks before it trusts a project server.
.mcp.json{ "mcpServers": { "sprites": { "type": "http", "url": "https://mcp.sprites.ai/mcp" } } }Sign in with /mcp
Start Claude Code, type /mcp, pick sprites and authenticate. The Sprites consent screen opens in your browser; sign in and approve, and the tools load into the session.
Spriteswants access on behalf of Claude Code- Read your connected ad accounts and site data
- Draft campaigns, creatives and pages for your approval
- Apply only the changes you approve
AllowCancel
What permissions this needs
Connecting Google Analytics to Claude Code yourself means a Google Analytics Data and Admin APIs integration, and these are the permissions and gates it runs into. Through Sprites you sign in with OAuth instead, with no developer token or app review of your own.
analytics.readonly
Read reports and configuration through the Data and Admin APIs.
analytics.edit
Change configuration, such as audiences or a Google Ads link setting.
Property ID
Every report runs against one numeric GA4 property.
Cloud project and credentials
The self-hosted route needs both APIs enabled on your own Google Cloud project and application-default credentials from the gcloud consent flow.
What Sprites asks for when you connect
Google sign-in for analytics.readonly and analytics.edit on the Sprites Google Cloud project.
What you skip
You enable no APIs, create no service account and run no gcloud consent flow. Claude Code signs in to Sprites with OAuth and never holds a GA4 credential.
Run the first prompt
Ask Claude Code this. It routes to a Sprites door, which reads your Google Analytics 4 account and answers — no account to name, no confirmation to give first.
- With Sprites, what happened to conversions last week and which channel caused it?
- Ask Sprites for our top 10 landing pages by conversion rate this month.
- Use Sprites to compare organic and paid revenue quarter over quarter in GA4.
- Have Sprites break down ecommerce revenue by product for the last 30 days.
- With Sprites, set up a Monday brief on traffic, conversions and the biggest change.
Run claude mcp list, or type /mcp in a session. Sprites shows as connected, and asking "what can Sprites do?" lists the doors.
What Claude Code can do with Google Analytics 4
The same doors, whichever client you are in. The ad account and the code that tracks it in one terminal: Claude Code can read a conversion drop through Sprites, then open the tag or the event that explains it.
Ask in English, get the report run
No explorations, no dimension picker. The question becomes a GA4 query and the answer comes back with the numbers attached.
Channel attribution that names a cause
The channel that accounts for the change, with its share of it stated, not a chart of everything that moved.
Item-scoped ecommerce
Revenue and units per product, not just per session — the breakdown GA4 buries.
Landing pages that earn and landing pages that leak
Entry page performance against conversions, ranked, with the drop-off stated.
Join it to the ad accounts
Because the same connector reads Google Ads and Meta, a GA4 answer can be checked against what the platforms claim.
A standing weekly read
A scheduled brief that runs against GA4 and messages you only when a number breaks trend.
How approvals work here
Claude Code renders tool results as text, so a GA4 change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.
What it reads
- Sessions, users, engagement and conversions by any GA4 dimension
- Channel, source, medium and campaign attribution
- Landing pages, events and funnels
- Item-scoped ecommerce: revenue and units per product
What it can change
- Nothing. GA4 is read-only through this connector by design
- Changes it recommends land on the ad or SEO channel they belong to, each with its own approval
When it does not work in Claude Code
Three things go wrong in this client specifically, and each has a one-line fix.
The .mcp.json entry is ignored.
It has a url but no "type": "http", so Claude Code reads it as a local command server. Add the type.
claude -p or a script fails with an auth error.
A headless run cannot open the browser sign-in. Authenticate once in an interactive session with /mcp; the stored grant then works headless.
A long report comes back cut off.
Claude Code caps MCP output at 25,000 tokens by default. Raise MAX_MCP_OUTPUT_TOKENS, or ask Sprites for a shorter summary.
Google Analytics 4 and Claude Code: questions
Which URL do I paste into Claude Code?
https://mcp.sprites.ai/mcp. There is one endpoint and every client uses it — every OAuth grant is bound to exactly that address, so a variant of it will not be honoured.
Can Claude Code change my Google Analytics 4 account without asking?
Claude Code renders tool results as text, so a GA4 change comes back written out rather than as a card. The approval waits for you in Sprites — open it there and the same run continues. Nothing is applied until you approve it.
Do I need a Google Analytics 4 API key or developer token?
No. Google Analytics 4 is connected once inside Sprites through Google Analytics 4, and the connector acts on that connection. You enable no APIs, create no service account and run no gcloud consent flow. Claude Code never sees a credential for it.
Why Claude Code for Google Analytics 4 specifically?
The ad account and the code that tracks it in one terminal: Claude Code can read a conversion drop through Sprites, then open the tag or the event that explains it.
Can it change anything in GA4?
No. GA4 is read-only through this connector on purpose. If the answer implies a change, it is proposed on the channel that owns it — an ad account, a page — with its own approval.
Do I need to know GA4 dimensions and metrics?
No. You ask the question; Sprites picks the dimensions, runs the report and states what it queried so you can check the working.
Keep going
The same Claude Code connector reaches every other channel — nothing else to add.
Google Analytics 4, from Claude Code
Paste one URL, sign in once, and the next GA4 question you ask Claude Code gets answered from the live account.