/install google-analytics-mcp
Google Analytics
Query GA4 properties using the Google Analytics MCP server via MCPorter. Each workspace supplies its own service account credentials — no shared or global auth.
Prerequisites
uvx(fromuv) — runsanalytics-mcpephemerally, no install neededmcporter—npm i -g mcporter- Service account JSON with GA read access in the workspace (see Setup)
Per-workspace credentials
Each workspace stores its own credentials:
{workspace}/
credentials/
ga-service-account.json ← Google service account key file
ga-config.json ← optional: default project/property
ga-config.json shape (optional):
{
"projectId": "my-gcp-project",
"defaultProperty": "properties/123456789"
}
If ga-config.json is absent, pass property explicitly in every query.
Workflow
- Locate credentials — read
{workspace}/credentials/ga-service-account.json(fail clearly if missing). - Load config — read
{workspace}/credentials/ga-config.jsonif present; extractprojectIdanddefaultProperty. - Run query via the helper script or direct mcporter call:
bash {skill_dir}/scripts/ga.sh \x3Cworkspace> \x3Ctool> [args...]
Or directly:
CREDS="{workspace}/credentials/ga-service-account.json"
PROJECT_ID="$(cat {workspace}/credentials/ga-config.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("projectId",""))')"
mcporter call \
--stdio uvx \
--stdio-arg analytics-mcp \
--env "GOOGLE_APPLICATION_CREDENTIALS=$CREDS" \
--env "GOOGLE_CLOUD_PROJECT=$PROJECT_ID" \
"analytics-mcp.\x3Ctool>" \
[key=value ...]
Available tools
| Tool | Purpose |
|---|---|
get_account_summaries |
List all GA accounts + properties the SA has access to |
get_property_details |
Details for a specific property |
run_report |
Standard GA4 data report (dimensions, metrics, date ranges) |
run_funnel_report |
Funnel analysis |
run_realtime_report |
Realtime data |
get_custom_dimensions_and_metrics |
Custom dimensions/metrics for a property |
list_google_ads_links |
Google Ads links for a property |
Common queries
List all accessible properties:
mcporter call --stdio uvx --stdio-arg analytics-mcp \
--env "GOOGLE_APPLICATION_CREDENTIALS=$CREDS" \
analytics-mcp.get_account_summaries
Run a report (sessions last 30 days):
mcporter call --stdio uvx --stdio-arg analytics-mcp \
--env "GOOGLE_APPLICATION_CREDENTIALS=$CREDS" \
--env "GOOGLE_CLOUD_PROJECT=$PROJECT_ID" \
analytics-mcp.run_report \
property=properties/123456789 \
'dimensions=[{"name":"date"}]' \
'metrics=[{"name":"sessions"}]' \
'dateRanges=[{"startDate":"30daysAgo","endDate":"today"}]'
Setup (one-time per workspace)
See references/setup.md for full instructions. Short version:
- Create a GCP service account
- Enable Google Analytics Admin API and Google Analytics Data API
- Download the JSON key → save to
{workspace}/credentials/ga-service-account.json - In GA4: Admin → Property Access Management → add the service account email as Viewer
- Test:
bash {skill_dir}/scripts/ga.sh {workspace} get_account_summaries
Error notes
PERMISSION_DENIED— SA email not added to GA property accesscredentials not found— checkga-service-account.jsonpathAPI not enabled— enable Admin + Data APIs in GCP console
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install google-analytics-mcp - After installation, invoke the skill by name or use
/google-analytics-mcp - Provide required inputs per the skill's parameter spec and get structured output
What is Google Analytics MCP?
Query Google Analytics 4 data — reports, funnels, realtime, property details — via the GA MCP server. Uses per-workspace service account credentials; no Gemi... It is an AI Agent Skill for Claude Code / OpenClaw, with 68 downloads so far.
How do I install Google Analytics MCP?
Run "/install google-analytics-mcp" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Google Analytics MCP free?
Yes, Google Analytics MCP is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Google Analytics MCP support?
Google Analytics MCP is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Google Analytics MCP?
It is built and maintained by vittor1o (@vittor1o); the current version is v1.0.0.