Google Analytics 4 MCP
Read-only MCP server for Google Analytics 4. Seventeen tools cover the read surface of both the Data API and the Admin API: standard, batch, pivot, realtime and funnel reports; the metadata catalog and compatibility check; and admin lists for properties, streams, custom dimensions and metrics, key events, audiences, Google Ads links, annotations and access reports. We run this server in production for every analytics client.
Install
Claude Code:
claude mcp add ga4 -e GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json -- uvx scalably-ga4-mcp
Codex:
codex mcp add ga4 --env GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json -- uvx scalably-ga4-mcp
Claude Desktop: download ga4-mcp.mcpb from the latest GitHub release and open it.
Setup
- In Google Cloud, create or pick a project and enable the Google Analytics Data API and the Google Analytics Admin API on it (APIs and Services, Library).
- Create a service account in that project and download its JSON key.
- Add the service account's email as a Viewer on each GA4 property you want to query (Admin, Property access management).
No OAuth consent screen is needed; the server authenticates as the service account with the analytics.readonly scope. One service account can read any property that grants it access, so there is no per-client configuration beyond step 3 above.
Call ga4_list_account_summaries first to discover which property_id values the service account can see, then pass one into the reporting or admin tools.
Tools (17)
| Tool | What it does |
|---|---|
ga4_list_account_summaries |
List every GA4 account and its child properties accessible to this service account |
ga4_get_property_details |
Full metadata for a single GA4 property |
ga4_list_data_streams |
List all data streams (web, iOS, Android) on a GA4 property |
ga4_list_custom_dimensions |
List custom dimensions configured on a GA4 property |
ga4_list_custom_metrics |
List custom metrics configured on a GA4 property |
ga4_list_key_events |
List key events (formerly conversions) on a GA4 property |
ga4_list_audiences |
List audiences defined on a GA4 property |
ga4_list_google_ads_links |
List Google Ads links attached to a GA4 property |
ga4_list_property_annotations |
List reporting annotations on a GA4 property |
ga4_run_access_report |
Audit log of who read what on a GA4 property, last 12 months |
ga4_get_metadata |
Fetch the full GA4 dimension and metric catalog for a property |
ga4_run_report |
Run a GA4 standard report, the workhorse tool |
ga4_batch_run_reports |
Run up to 5 GA4 reports in a single round trip |
ga4_run_pivot_report |
Run a GA4 pivot report |
ga4_run_realtime_report |
Run a GA4 real-time report covering the last 30 minutes |
ga4_check_compatibility |
Validate whether a dimension and metric combo can be queried together |
ga4_run_funnel_report |
Run a GA4 funnel report (v1alpha, drop-off analysis) |
Configuration
| Variable | Required | Purpose |
|---|---|---|
GOOGLE_APPLICATION_CREDENTIALS |
yes | Path to a Google service-account JSON file with the analytics.readonly scope; share each property with the service account email |
GA4_LOG_LEVEL |
no | INFO (default) or DEBUG |
Filter expression shape
Every tool accepting dimension_filter / metric_filter takes a dict:
{"filter": {"field_name": "country", "string_filter": {"value": "US"}}}
Compose with boolean groups:
{"and_group": {"expressions": [
{"filter": {"field_name": "country", "string_filter": {"value": "US"}}},
{"filter": {"field_name": "deviceCategory", "string_filter": {"value": "mobile"}}}
]}}
A raw {"field_name": ..., "string_filter": ...} is auto-wrapped into {"filter": {...}}.
Reply shape
Every tool returns JSON with status (succeeded, partial, no_op), summary, result, proof, warnings, recovery. proof.nextOffset on a partial status means: continue from that offset. proof.propertyQuota carries the property's remaining Data API quota so the caller can self-throttle. proof.dataQualityLimited is true when the response was sampled, thresholded, or collapsed high-cardinality rows into (other); treat such a result as directionally useful, not exact.
Limits
250,000 rows per Data API response (the server caps any higher client-supplied limit). Batch reports: up to 5 per call. Funnel reports: up to 10 steps. Realtime reports use a separate, smaller dimension and metric catalog covering only the last 30 minutes; non-realtime data typically lags 24 to 48 hours. Funnel reporting is v1alpha and its shape can change upstream. Every quota bucket (core reports, realtime, funnel) allows roughly 14,000 quota tokens per project per property per hour (a complex query can cost more than one token); 360 properties get a 10x multiplier. Re-check Google's current quota page before relying on an exact number.
Verify
Each release lists the package version, the .mcpb sha256 and the production commit it was derived from in CHANGELOG.md. CI runs the tests and a clean install of the built wheel on every push.
Privacy Policy
This server runs locally, on your machine, under your own credentials. It collects no personal data, contains no telemetry, stores nothing persistently, and talks only to the vendor API it wraps. No third party, including Scalably, receives your data. Contact: hello@scalably.io. Canonical copy: https://scalably.io/connector-privacy.html
License
MIT. Copyright Scalably.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scalably_ga4_mcp-1.0.0.tar.gz.
File metadata
- Download URL: scalably_ga4_mcp-1.0.0.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06da01162fbae4e76847f3bd98a2ab4e1f07e01367476a5aaa7c6d689132c527
|
|
| MD5 |
38d27e4a531af218115fb593d398b4b4
|
|
| BLAKE2b-256 |
8f56d5a23df500cc5c579f398143f688ab0535ee74e52215fe2ecb1c782f6f14
|
Provenance
The following attestation bundles were made for scalably_ga4_mcp-1.0.0.tar.gz:
Publisher:
release.yml on scalably-io/ga4-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scalably_ga4_mcp-1.0.0.tar.gz -
Subject digest:
06da01162fbae4e76847f3bd98a2ab4e1f07e01367476a5aaa7c6d689132c527 - Sigstore transparency entry: 2765457117
- Sigstore integration time:
-
Permalink:
scalably-io/ga4-mcp@57a3eef6ef1532513fb586c208fcc96da95cf9e4 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/scalably-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@57a3eef6ef1532513fb586c208fcc96da95cf9e4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scalably_ga4_mcp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: scalably_ga4_mcp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73fed630c87a79e2dea26157891777174a37511d3302964e3b87f046d6bdeab4
|
|
| MD5 |
1f8b9b555128deb462bbcd9cafa0fc3b
|
|
| BLAKE2b-256 |
c94f82239d99c940c5f606331d5b2d1a56536033dd7c7911e4269760f2f2dfaf
|
Provenance
The following attestation bundles were made for scalably_ga4_mcp-1.0.0-py3-none-any.whl:
Publisher:
release.yml on scalably-io/ga4-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scalably_ga4_mcp-1.0.0-py3-none-any.whl -
Subject digest:
73fed630c87a79e2dea26157891777174a37511d3302964e3b87f046d6bdeab4 - Sigstore transparency entry: 2765457192
- Sigstore integration time:
-
Permalink:
scalably-io/ga4-mcp@57a3eef6ef1532513fb586c208fcc96da95cf9e4 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/scalably-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@57a3eef6ef1532513fb586c208fcc96da95cf9e4 -
Trigger Event:
push
-
Statement type: