MCP Server · Remote · GA4 analytics data
Google Analytics MCP Server
NotFair's Google Analytics MCP exposes your GA4 properties as a typed tool surface for AI agents. Built on the Model Context Protocol. Connect Claude, Codex, or any compliant client at https://notfair.co/api/mcp/google_analytics and ask questions over live GA4 data — traffic sources, conversions, landing pages, and realtime activity.
OAuth 2.0 with PKCE · No Client ID or Secret · Read tools plus approval-gated custom-dimension and key-event writes.
Tool surface
What Claude can do with Google Analytics
Read tools scoped to the GA4 properties you connect, plus approval-gated configuration management. Every write is proposed in chat and confirmed before it reaches Google.
| Tool | What it does |
|---|---|
listProperties | List the GA4 properties the connected Google account can access, grouped by account — each with its numeric resource name (properties/123456789) and display name. |
runReport | The core GA4 Data API reporting primitive: pick dimensions to break down by and metrics to measure over any date range, with filters, ordering, and up to 4 comparison date ranges. |
runRealtimeReport | Events and active users from the present moment back to ~30 minutes ago — what's happening on your site right now. |
getMetadata | Every dimension and metric available for a property — API name, UI name, description, and whether it's a custom definition. The map for building valid reports. |
createCustomDimension | Register an event, user, or item parameter as a reportable custom dimension. Approval-gated; returns the before/after state. |
archiveCustomDimension | Archive a custom dimension (GA4 has no delete). Approval-gated, and flagged loudly as irreversible — an archived dimension cannot be un-archived. |
createKeyEvent | Mark an event as a key event (conversion). Approval-gated and reversible with deleteKeyEvent. |
deleteKeyEvent | Stop treating an event as a key event. Approval-gated and reversible — recreate it with the same event name. |
runScript | Sandboxed JS with parallel report fan-out — run many GA4 reports in one pass and rank, filter, and correlate in-script for audits and dashboards. |
Connector name in Claude / Codex configs: NotFair-GoogleAnalytics
Connect Google Analytics and try it in Claude
Authorize NotFair to access your GA4 properties, then add the MCP server to Claude. The first prompt to try: “Which traffic sources drove the most conversions in the last 28 days?”
FAQ — Google Analytics MCP Server
Everything you need to know about the NotFair Google Analytics MCP server, its auth model, and the tool surface.
What is the NotFair Google Analytics MCP server?
It's a remote MCP (Model Context Protocol) server at https://notfair.co/api/mcp/google_analytics that exposes your GA4 properties as a typed tool surface for AI agents. Claude Desktop, Claude.ai Web, Claude Cowork, Claude Code, and Codex can all connect to it and answer questions over live Google Analytics data — traffic sources, conversions, landing pages, and realtime activity.
How does authentication work?
Claude.ai's Add custom connector flow and Codex both use OAuth 2.0 with PKCE — there's no Client ID or Secret to copy. You authorize NotFair with Google once, pick which GA4 properties to expose, and the connection is scoped to those properties and revocable at any time.
What Google Analytics data is exposed?
The GA4 properties your Google account can access, Data API reports over any dimensions and metrics (sessions, users, conversions, revenue, traffic sources, pages, and more), realtime reports covering roughly the last 30 minutes, and the dimension/metric metadata for each property. Tokens are encrypted at rest and refreshed server-side.
Can the AI change anything, or is it read-only?
Reporting is read-only and unrestricted. The only writes are configuration management — creating or archiving custom dimensions and creating or removing key events — and every write is approval-gated: the change is proposed in chat and you confirm before it reaches Google. The AI never touches your tracking code or your data.
Why does NotFair request both the analytics.readonly and analytics.edit scopes?
Google splits the GA4 API in two: the Data API (reports, realtime, metadata) authorizes on analytics.readonly, while the Admin API writes NotFair exposes — custom dimensions and key events — require analytics.edit, which does not itself cover Data API reads. One grant requests both so reporting and the approval-gated configuration tools work from a single connection.
How fresh is the reporting data?
runRealtimeReport covers the present moment back to about 30 minutes. runReport reflects standard GA4 processing — today's rows are intraday and still changing, and high-cardinality or wide-range reports may be sampled (the response says so when they are). Dates are interpreted in the property's timezone.
How do I disconnect?
From /connect/google_analytics you can revoke access at any time. That removes the stored credential and invalidates the Claude and Codex OAuth tokens issued for the connection. You can also revoke NotFair from your Google account permissions page.
Related guides
Explore the rest of the NotFair MCP ecosystem.
Connect a Google Analytics property
Authorize NotFair to access your GA4 properties and wire the MCP server into Claude, Claude Code, or Codex.
Google Search Console MCP Server
Pair Analytics with organic-search data — top queries, page CTR, index coverage, and sitemaps.
Google Ads MCP Server
The full Google Ads tool surface: audits, keywords, budgets, and approval-gated campaign changes.