GA4 MCP that reads AND writes: reports, funnels, audits, and server-side events. 26 tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
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:
GA_SERVICE_ACCOUNT_JSON β path to the downloaded key file, or the JSON itselfGA_PROPERTY_ID β 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)).
Reports can get large. This server is designed with token optimization in mind:
limit parameter as neededSee the dedicated Token Optimization Guide for strategies to minimize token usage.
See QUICKSTART.md for a 5-minute setup guide, or follow the installation steps below.
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.
Use the file path or paste the JSON into GA_SERVICE_ACCOUNT_JSON.
GA4 Admin β Property Settings β Property ID (numbers only, e.g. 123456789).
You can now ask: βShow me active users by country this week.β
Only if you want the agent to record events (purchases, signups, custom events). Most GA4 MCPs cannot do this; it is extra, not required.
G-XXXXXXXXXX).Add them next to the two values you already have:
Every read tool accepts an optional propertyId argument that overrides the configured GA_PROPERTY_ID β so a single conversation can query any property the service account can access, with no reconfiguration between clients.
GA_SERVICE_ACCOUNT_JSON (GA_PROPERTY_ID becomes optional β if set, it acts as the default).propertyId accepts both 123456789 and properties/123456789. Event sending (Measurement Protocol) remains tied to the configured GA_MEASUREMENT_ID/GA_API_SECRET, since each data stream has its own secret.
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Or if installed globally:
Restart Claude Desktop after updating the configuration.
Add to your Cursor MCP settings file:
macOS/Linux: ~/.cursor/mcp.json
Windows: %USERPROFILE%\.cursor\mcp.json
Restart Cursor after updating the configuration.
Reading data (Google Analytics Data API) β all read tools default to 10 rows to save tokens:
| Tool | Purpose | Notes |
|---|---|---|
ga_run_report | Custom reports with dimensions and metrics | Adjust limit as needed |
ga_run_realtime_report | Real-time data (last 30 minutes) | Great for verifying sent events |
ga_get_metadata | All available dimensions and metrics | Large response (500+ items), use sparingly |
ga_list_accounts | List accessible GA accounts | |
ga_list_properties | List GA4 properties | Aggregates all accounts if no accountId |
ga_get_property | Details of the configured property | |
ga_list_data_streams | Data streams of the property | Useful to find measurement IDs |
ga_run_pivot_report | Pivot table reports | Responses can be very large |
ga_run_funnel_report | Funnel analysis across event steps | Uses Data API v1alpha |
ga_batch_run_reports | Multiple reports in one request | 2β5 reports per batch recommended |
ga_get_account_summaries | All accounts and properties in one call | Fastest way to discover IDs |
ga_list_custom_dimensions | Custom dimensions of the property | Discover API names for reports |
ga_list_custom_metrics | Custom metrics of the property | Discover API names for reports |
ga_list_key_events | Key events (conversions) of the property | Know what counts as a conversion |
ga_list_google_ads_links | Google Ads accounts linked to the property | |
ga_check_compatibility | Validate dimension/metric combos before reporting | Avoids wasted requests and error loops |
Sending events (Measurement Protocol):
| Tool | Purpose |
|---|---|
ga_send_event | Any custom GA4 event with parameters |
ga_validate_event | Test an event against the debug endpoint without recording it |
ga_send_pageview | Page/screen views |
ga_send_purchase | Ecommerce purchases with transaction and items |
ga_send_login | User logins |
ga_send_signup | User registrations |
ga_send_view_item | Product/item detail views |
ga_send_add_to_cart | Add-to-cart events |
ga_send_begin_checkout | Checkout initiations |
ga_send_refund | Full or partial refunds |
ga_run_reportRun custom reports with dimensions and metrics.
Common Dimensions: date, city, country, deviceCategory, browser, pagePath, eventName, sessionSource, sessionMedium, sessionCampaignName
Common Metrics: activeUsers, sessions, screenPageViews, conversions, totalRevenue, engagementRate, averageSessionDuration
Example:
ga_run_realtime_reportGet real-time data (last 30 minutes).
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-google-analytics)<a href="https://allmcps.com/mcp/mcp-google-analytics"><img src="https://allmcps.com/api/badge/mcp-google-analytics?style=directory" alt="MCP Google Analytics on AllMCPs" /></a>