Google Analytics MCP server
io.github.leonardosepulvedat/mcp-google-analytics·v1.3.0·2 starsGA4 MCP that reads AND writes: reports, funnels, audits, and server-side events. 26 tools.
2 stars1.6k downloads/wk
Reviews
Write oneNobody has reviewed Google Analytics yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Google Analytics tools (26, 14 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
ga_batch_run_reportswrite actionRun multiple reports in a single request. ⚠️ TOKEN OPTIMIZATION: Can return LARGE amounts of data. Limit to 2-5 reports per batch. Each report should have small limits.
ga_check_compatibilityCheck whether a combination of dimensions and metrics is valid for this property BEFORE running a report. Avoids wasted report requests and token-heavy error loops. Also lists which other fields remain compatible with the given combination.
ga_get_account_summariesGet a compact overview of all accessible GA accounts and their properties in a single call. The fastest way to discover account IDs, property IDs, and property names.
ga_get_metadataGet available dimensions and metrics metadata for your GA4 property. ⚠️ TOKEN OPTIMIZATION: This returns ALL available dimensions and metrics. Response can be large (~500+ items). Use sparingly and cache results when possible.
ga_get_propertyGet details about a GA4 property (the configured one, or any accessible property via propertyId).
ga_list_accountsList all Google Analytics accounts accessible to the service account. Use this to find account IDs for listing properties.
ga_list_custom_dimensionsList all custom dimensions defined for the configured GA4 property. Use this to discover custom dimension API names (e.g., "customEvent:plan_type") for reports.
ga_list_custom_metricsList all custom metrics defined for the configured GA4 property. Use this to discover custom metric API names for reports.
ga_list_data_streamsList data streams for the configured GA4 property. Use this to find measurement IDs for Measurement Protocol.
ga_list_google_ads_linksList Google Ads accounts linked to a GA4 property.
ga_list_key_eventsList the key events (conversions) configured for the GA4 property. Useful to know which event names count as conversions before building reports or sending events.
ga_list_propertiesList Google Analytics properties. Optionally filter by account ID. Without an account ID, properties from all accessible accounts are aggregated.
ga_run_funnel_reportwrite actionRun a funnel analysis report to track user progression through steps (Data API v1alpha). Each step matches an event: set 'eventName' per step (defaults to the step name). For advanced matching, pass a full 'filterExpression' instead.
ga_run_pivot_reportwrite actionRun a pivot table report with row and column dimensions. ⚠️ TOKEN OPTIMIZATION: Pivot reports can be VERY large. Limit dimensions and use small date ranges. Recommended for analysis, not raw data extraction.
ga_run_realtime_reportwrite actionGet real-time Google Analytics data (last 30 minutes). ⚠️ TOKEN OPTIMIZATION: Use 'limit' to control result size (default: 10). Common dimensions: city, country, deviceCategory, unifiedScreenName Common metrics: activeUsers, screenPageViews, conversions
ga_run_reportwrite actionRun a custom Google Analytics report with dimensions and metrics. ⚠️ TOKEN OPTIMIZATION: Use 'limit' to control result size (default: 10). This tool can consume significant tokens with large datasets. Common dimensions: date, city, country, deviceCategory, browser, pagePath, eventName Common metrics: activeUsers, sessions, screenPageViews, conversions, totalRevenue
ga_send_add_to_cartwrite actionSend an add to cart event to Google Analytics. Ecommerce event for tracking when items are added to shopping cart.
ga_send_begin_checkoutwrite actionSend a begin checkout event to Google Analytics. Ecommerce event for tracking when users start the checkout process.
ga_send_eventwrite actionSend a custom event to Google Analytics via Measurement Protocol. Use this for tracking custom user actions, conversions, or any GA4 event. Events are processed asynchronously and appear in reports within minutes. Common events: click, form_submit, video_play, file_download, custom_conversion
ga_send_loginwrite actionSend a login event to Google Analytics. Standard event for tracking user logins with authentication method.
ga_send_pageviewwrite actionSend a page view event to Google Analytics. Standard event for tracking page/screen views. Automatically uses 'page_view' event name.
ga_send_purchasewrite actionSend an ecommerce purchase event to Google Analytics. Standard event for tracking completed purchases with transaction details and items.
ga_send_refundwrite actionSend a refund event to Google Analytics. Ecommerce event for full or partial refunds. Omit 'items' for a full refund; include them (with quantities) for a partial refund. Use the same transaction_id as the original purchase.
ga_send_signupwrite actionSend a sign-up event to Google Analytics. Standard event for tracking new user registrations.
ga_send_view_itemwrite actionSend a view item event to Google Analytics. Ecommerce event for tracking product/item detail views. Completes the standard funnel: view_item → add_to_cart → begin_checkout → purchase.
ga_validate_eventValidate an event before sending it to Google Analytics. Uses GA4's debug endpoint to check for errors without recording the event. Returns validation messages and errors if any.
Public scan report
scanner v0.1.10 · 2026-11-01 · same rubric, same numbers if you re-run it
- Code scan9 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitystatic API keys via environment variables6/15
- Maintenancelast push 72 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
How Google Analytics compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 78/100
- higher than 57% of 48,273 servers
- Tools
- 26
- the typical server has 7
- Tools that change things
- 54%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 75% of 28,534 servers
- Downloads a week
- 1,591
- more than 95% of 11,915 servers with a package
What its tools let an agent do: 12 read · 14 change
Install Google Analytics in Claude Code, Cursor or VS Code
Runs npx -y mcp-google-analytics on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add mcp-google-analytics -- npx -y mcp-google-analytics
What the publisher says
From the Google Analytics repository's README, as published. We do not edit it. Read it on GitHub
MCP Google Analytics Server
A Model Context Protocol (MCP) server for Google Analytics 4, providing comprehensive integration with both the Google Analytics Data API (for reading reports) and Measurement Protocol v2 (for sending events).
The GA4 MCP that reads AND writes. Most GA4 MCP servers (including Google's official one) are read-only. This one gives your AI agent the full loop: run reports and funnels, audit your setup (custom dimensions, key events, compatibility checks), send ecommerce and conversion events server-side, and verify them in the realtime report — 26 tools in one npx command.
Built for agencies too: every read tool accepts an optional propertyId, so one conversation can query all your clients' properties — no reconfiguration between clients. See Multi-Property Mode.
⚡ One-Click Install
You only need two values to start (same as any other GA4 MCP): the service account JSON and your property ID. Sending events is an optional extra.
Click Install in Cursor, then paste:
- GASERVICEACCOUNTJSON** — path to the downloaded key file, or the JSON itself
- GAPROPERTYID — the numeric ID in GA4 Admin → Property Settings (e.g. 123456789)
That is enough to ask “users by country this week”. To also send events, add two more keys later (see Send events (optional)).
💡 Keep reports small
Reports can get large. This server is designed with token optimization in mind:
- All read tools default to 10 results - Adjust the limit parameter as needed
- Use specific date ranges - Avoid querying years of data at once
- Select only needed dimensions/metrics - Don't request everything
- Check TOKENOPTIMIZATION.md** for detailed best practices
See the dedicated Token Optimization Guide for strategies to minimize token usage.
🚀 Quick Start
See QUICKSTART.md for a 5-minute setup guide, or follow the installation steps below.
📦 Installation
Option 1: Install globally via npm
npm install -g mcp-google-analyticsOption 2: Use with npx (no installation needed)
npx mcp-google-analytics🔧 Configuration
Start with two values. That unlocks reports, funnels, realtime, and property audits — everything most people need, and the same setup every other GA4 MCP asks for.
1. Service account key
- In Google Cloud Console, enable Google Analytics Data API.
- IAM & Admin → Service Accounts → Create. Download a JSON key.
- In GA4: Admin → Property Access Management → add the service account email as Viewer.
Use the file path or paste the JSON into GASERVICEACCOUNT_JSON.
2. Property ID
GA4 Admin → Property Settings → Property ID (numbers only, e.g. 123456789).
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Google Analytics: common questions
- Is Google Analytics MCP server safe?
- Mostly: it is graded B (78/100). Read the Google Analytics safety report
- How do I install Google Analytics?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Google Analytics need an API key?
- Yes. The registry entry asks for
GA_SERVICE_ACCOUNT_JSON,GA_API_SECRET. - Is Google Analytics maintained?
- The last commit was 73 days ago (2026-08-21). The latest release is v1.3.0.
- What can I use instead of Google Analytics?
- Servers from other publishers that do the same job: AdLoop MCP server.
- How does Google Analytics compare with other MCP servers?
- safety score 78/100 (higher than 57% of 48,273 servers); tools 26 (the typical server has 7); tools that change things 54% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Google Analytics
Same job from other publishers: the closest match first, then the best rated.
- AdLoopGoogle Ads, Reddit Ads, GA4 and Tag Manager in your AI client, with a preview before every change.not reviewedEstablishedA