
Google Analytics 4 MCP
io.scalably由 scalably.io 发布v1.0.1更新于 Oct 24, 2026
Google Analytics 4 MCP: reports, realtime, funnels, pivots, metadata, admin lists. 17 tools.
概览
只读的 MCP 服务器,让助手查询 Google Analytics 4 报表,并列出服务账号可访问的媒体资源的 Admin API 配置。
- 可以做什么
- 在 GA4 媒体资源上运行标准、批量、透视、实时和漏斗报表,支持维度与指标筛选,并可对照元数据目录检查兼容性。列出账号与媒体资源、资源详情、数据流、自定义维度和指标、关键事件、受众群体、Google Ads 关联和注释。审计过去 12 个月内谁读取了该资源的哪些数据。返回带状态、配额和数据质量提示的结构化 JSON,部分结果附带分页偏移量。
- 适用场景
- 适合让助手获取 GA4 的流量、事件或漏斗数据,查看媒体资源配置,或在不打开 GA4 界面的情况下审计访问情况。适用于已有 Google Cloud 项目和服务账号的分析师与开发者。
- 运行要求
- 以 Python 包通过 uvx 本地运行,或作为 Claude Desktop 安装包使用。需要启用 Analytics Data API 和 Admin API 的 Google Cloud 项目、服务账号 JSON 密钥,以及指向该文件的 GOOGLE_APPLICATION_CREDENTIALS 环境变量。服务账号须在每个 GA4 媒体资源上被添加为查看者。可选 GA4_LOG_LEVEL。
安装
在 SourceWeft 中
- 打开 控制台中的 Google Analytics 4 MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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:
Codex:
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)
Configuration
Filter expression shape
Every tool accepting dimension_filter / metric_filter takes a dict:
Compose with boolean groups:
A raw {"field_name": ..., "string_filter": ...} is auto-wrapped into {"filter": {...}}.
Reply shape
Every tool returns JSON with status (succeeded, partial, no_op), operation, summary, target, result, proof, warnings, recovery. Failures surface as a tool error whose text is ga4_request_failed: <message> <hint>. 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: [email protected]. Canonical copy: https://scalably.io/connector-privacy.html
License
MIT. Copyright Scalably.
来源:README.md,提交 90b8c28
工具
0版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分