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
listProperties
runReport
runRealtimeReport
getMetadata
createCustomDimension
archiveCustomDimension
createKeyEvent
deleteKeyEvent
runScript

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.