Model Context Protocol · GA4 Admin API + Data API v1
An MCP server that connects Claude to your GA4 properties — audit key events and retention, run core and realtime reports, mark conversions, register custom dimensions and link Google Ads without opening the Analytics UI. Embedded Google login. Status: LIVE.
MCP GA4 B2 TECH is a Model Context Protocol server that gives Claude real access to your properties — not a chatbot that guesses, but typed calls against both official Google Analytics 4 APIs.
Audit the account → property → stream hierarchy, key events, custom definitions and retention through the Admin API; run core and realtime reports through the Data API. "Who's on the site right now?" becomes a call, not a guess.
The sibling MCPs (Meta Ads, Google Ads, GTM, Cloudflare, Instagram) create the campaign, the tag and the tracking; GA4 audits the property, creates what's missing, links Google Ads and reads the result. All in one conversation.
Multi-tenant deploy at mcp-ga4-one.vercel.app — embedded OAuth 2.1 Authorization Server with Google-native login, tokens encrypted in a dedicated Supabase, cache in Upstash. Same stack as the sibling MCPs.
36 tools grouped by function — from property audits to realtime reports, from key events to the Google Ads link. Everything below is implemented and live.
G- measurement id.last_28d), with filtering, ordering and limits. Rows come back flat and coerced.G- id.once_per_event / once_per_session).2m/14m) — shrinking the window permanently deletes older data.confirm) — conversion import stops.confirm) — also the rotation path.From X-ray to results in one conversation: audit the property → create what's missing → create_google_ads_link → run_report.
Retention, conversions and custom definitions touch data that doesn't come back — so every write goes through explicit barriers, carried over from the sibling MCPs.
preview=true by default
Every write returns the exact payload it would send without calling the API. It only executes when you pass preview=false.
Irreversible tools require confirm=true
delete_key_event, the archive_* tools and update_data_retention — which warns that shrinking the window deletes older data. Without confirm, they return a warning and execute nothing.
Local validation before any call
Ids must be numeric resource names (path-injection defense); enums accept friendly aliases (web, 2m) and reject anything else with the allowed list; GA4 naming rules are enforced with clear messages.
Tenant is never an argument
The tenant is derived from your Google account and resolved per request. No tool accepts "which client" — operating the wrong property is impossible.
Encrypted tokens, clean logs
Refresh tokens AES-256-GCM-encrypted in a dedicated Supabase, default-deny RLS on every table; JSON logs carry no PII (email only as SHA-256) and errors are sanitized — raw Google payloads never leak.
Least-privilege scopes
Only analytics.readonly and analytics.edit (+ openid/email/profile). User-management scopes are not requested — the MCP cannot touch who has access to your account.
Hosted, multi-tenant, zero setup: add the connector, log in with your Google account and Claude is operating your properties. Then just ask.
Add the MCP server as a connector in Claude and log in to Google. Nothing to install; one login does everything.
https://mcp-ga4-one.vercel.app/api/mcp. In Claude Code, use the command below.# Claude Code claude mcp add --transport http \ ga4 https://mcp-ga4-one.vercel.app/api/mcp
/mcp. B2Tech student with the same email as your purchase? Access links automatically — otherwise run connect_hotmart.ga4_token_status to validate the credential and list_accounts to see your GA4 accounts. Ready to operate.Real requests the server handles end to end — writes always preview first.
# you, in the chat: "Audit property 123: which key events exist and what's the data retention?" # → full X-ray via the Admin API
"Sessions and active users by day for
the last 28 days" · "Who's on the site now?"
# → run_report + run_realtime_report"Mark generate_lead as a conversion and
link Google Ads account 123-456-7890"
# → preview first; runs with preview=falseStill unsure about something? Write to bruno@b2tech.io.
connect_hotmart emails a 6-digit code to the purchase address and confirm_hotmart completes the link.preview=true — the tool returns the exact payload without calling the API and only executes with preview=false. Irreversible tools (delete_key_event, archiving custom dimensions/metrics, update_data_retention) require confirm=true and carry destructiveHint; shrinking the retention window explicitly warns that older data is permanently deleted.mcp-ga4-one.vercel.app) and the source code is private — there is no version to run on your own machine. You just add the connector in Claude and log in with your Google account; we handle the rest.analytics.readonly, analytics.edit, openid, email and profile. User-management scopes (analytics.manage.users) are not requested — the MCP cannot touch who has access to your account.run_report crosses metrics × dimensions over a date range (presets like last_28d or explicit dates), with filtering, ordering and limits; run_realtime_report shows the last 30 minutes. get_metadata lists every valid dimension/metric for the property (including custom ones) and check_compatibility tells you whether a combination works — without burning report quota._truncated row — not an error, just the tail trimmed to fit the context.Properties, streams, key events, custom definitions, the Google Ads link and core + realtime reports — from X-ray to results in one conversation, with writes in preview and irreversible tools locked behind confirm=true.
36 tools · Google login · multi-tenant on Vercel