ga4-mcp
Enables listing Google Ads links for GA4 properties.
Provides tools to run GA4 reports, list accounts and properties, get custom dimensions and metrics, and manage GA4 admin tasks.
Allows querying search analytics, inspecting URLs, listing/submitting sitemaps, and managing GSC sites.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ga4-mcp run a report on last week's page views"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ga4-mcp
GA4 + Google Search Console MCP server. Works with Claude, Copilot, Cursor, Codex, Gemini, and any MCP-compatible AI agent.
16 tools for Google Analytics 4, Search Console, and the Indexing API — run reports, inspect URLs, submit sitemaps, manage properties, and request indexing, all from your AI agent.
Quick Start
npx -y ga4-mcpOr install globally for faster startup:
npm install -g ga4-mcp
ga4-mcpPrerequisites
Authenticate with Google (includes all required scopes):
gcloud auth application-default login \
--scopes="https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/webmasters,https://www.googleapis.com/auth/indexing"Or set GOOGLE_APPLICATION_CREDENTIALS to a service account JSON key file.
Related MCP server: Google MCP Server
Agent Configuration
Claude Code
{
"mcpServers": {
"ga4-analytics": {
"command": "npx",
"args": ["-y", "ga4-mcp"]
}
}
}Cursor / Windsurf / Continue
Add to .cursor/mcp.json or equivalent:
{
"mcpServers": {
"ga4-analytics": {
"command": "npx",
"args": ["-y", "ga4-mcp"]
}
}
}Load only specific tool groups
{
"mcpServers": {
"ga4-analytics": {
"command": "npx",
"args": ["-y", "ga4-mcp", "--tools", "ga4,gsc"]
}
}
}CLI Options
ga4-mcp [options]
--tools <groups> Tool groups to enable: ga4, gsc, indexing, admin, all (default: all)
"ga4" = read-only analytics. "admin" = write/delete mega-tool.
--transport <type> Transport: stdio (default) or http (Streamable HTTP)
--port <number> HTTP port (default: 3000)
--version Show version
--help Show helpEnvironment variables: GA4_MCP_TOOLS, GA4_MCP_TRANSPORT, GA4_MCP_PORT
Tools (16 total)
Utility (1 tool)
Tool | Description |
| Health check — returns pong (always registered) |
GA4 Analytics (6 tools) — group: ga4
Tool | Description |
| List all GA4 accounts and properties |
| Property details (name, timezone, currency) |
| Run GA4 Data API reports |
| Run GA4 realtime reports |
| Custom dimensions and metrics |
| Google Ads links for a property |
GA4 Admin (1 mega-tool, 14 actions) — group: admin
Tool | Description |
| Create/update/delete properties, streams, key events, audiences |
Google Search Console (6 tools) — group: gsc
Tool | Description |
| List all GSC properties |
| Query search analytics (impressions, clicks, CTR, position) |
| URL inspection (index status, crawl info, mobile usability) |
| List submitted sitemaps |
| Add a site to GSC |
| Submit a sitemap |
Indexing API (2 tools) — group: indexing
Tool | Description |
| Notify Google to crawl/remove a URL |
| Check notification status for a URL |
License
MIT
Available Tools
16 toolsga4_adminA
GA4 property administration. Read: list_data_streams(property_id), list_key_events(property_id), list_audiences(property_id), list_firebase_links(property_id), get_measurement_protocol_secret(property_id, stream_id, secret_id). Write: create_property(account_id, display_name, time_zone?, currency_code?), update_property(property_id, display_name?, time_zone?, currency_code?), create_data_stream(property_id, type?, display_name, default_uri?), update_data_stream(property_id, stream_id, display_name), create_measurement_protocol_secret(property_id, stream_id, display_name?), create_key_event(property_id, event_name, counting_method?). Destructive (requires confirm:true): delete_property(property_id), delete_data_stream(property_id, stream_id), delete_key_event(property_id, key_event_id).
Inputs: action (required), params.
get_account_summariesA
Retrieves all Google Analytics accounts and properties accessible to the authenticated user.
Inputs: no named parameters.
get_custom_dimensions_and_metricsB
Retrieves custom dimensions and custom metrics for a GA4 property.
Inputs: property_id (required).
get_property_detailsA
Returns details about a GA4 property including display name, timezone, currency, and industry category.
Inputs: property_id (required).
gsc_add_siteA
Adds a site to Google Search Console. Use URL prefix (e.g. "https://example.com/") or domain property (e.g. "sc-domain:example.com").
Inputs: site_url (required).
gsc_inspect_urlA
Inspects a URL in Google Search Console — returns index status, crawl info, mobile usability, and rich results.
Inputs: site_url (required), inspection_url (required), language_code.
gsc_list_sitemapsB
Lists all sitemaps submitted for a site in Google Search Console.
Inputs: site_url (required).
gsc_list_sitesA
Lists all sites (properties) the authenticated user has access to in Google Search Console.
Inputs: no named parameters.
gsc_search_analyticsB
Queries Google Search Console search analytics data — impressions, clicks, CTR, and position for queries, pages, countries, and devices.
Inputs: site_url (required), start_date (required), end_date (required), dimensions, +6 more.
gsc_submit_sitemapB
Submits a sitemap URL for a site in Google Search Console.
Inputs: site_url (required), sitemap_url (required).
indexing_notifyA
Notifies Google to crawl or remove a URL via the Indexing API. Requires service account with indexing scope.
Inputs: url (required), type.
indexing_statusB
Checks the last crawl/notification status for a URL via the Indexing API.
Inputs: url (required).
list_google_ads_linksA
Returns a list of links to Google Ads accounts for a GA4 property.
Inputs: property_id (required).
pingA
Health check — returns pong if server is running
Inputs: no named parameters.
run_realtime_reportC
Runs a GA4 realtime report.
Inputs: property_id (required), dimensions (required), metrics (required), dimension_filter, +5 more.
run_reportC
Runs a Google Analytics 4 Data API report.
Inputs: property_id (required), date_ranges (required), dimensions (required), metrics (required), +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
There is some overlap between the ga4_admin tool's read capabilities (like listing data streams, audiences) and the separate get_property_details and get_custom_dimensions_and_metrics tools. However, the GSC and Indexing tools are clearly prefixed and distinct. Overall, an agent could confuse whether to use ga4_admin or the more specific get_* tools for property info.
Most tools follow a verb_noun pattern in snake_case (e.g., get_account_summaries, run_report), but ga4_admin is a noun-based tool name and ping is a simple noun. This mix of naming conventions could cause slight confusion.
With 16 tools covering GA4 administration, reporting, Google Search Console, and Indexing API, the count is reasonable for the scope. Not too few or too many, though the inclusion of ping as a separate tool is slightly unnecessary.
The tool set covers major CRUD operations for GA4 properties and includes reporting and GSC functionality. However, there are gaps: no tool to remove a site from GSC, no delete for audiences or Google Ads links, and no tool to delete sitemaps. The Indexing API also lacks a list/status bulk operation.
Maintenance
Related MCP Connectors
Read-only Google Search Console MCP server for AI assistants.
Google Search Console, GA4 and PageSpeed MCP server for Claude, ChatGPT and Cursor. Free, hosted.
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
Read-only Google Analytics 4 MCP server for AI assistants.
Related MCP Servers
- FlicenseBqualityDmaintenanceAn MCP server that integrates Google Search Console and Google Analytics 4 to provide unified SEO and web traffic analysis. It allows users to fetch search performance data, merge page metrics, and generate automated trend reports or actionable insights through tool calls.161-
- AlicenseNot gradedqualityDmaintenanceA unified MCP server that gives AI assistants direct access to Google Analytics 4, Google Search Console, Google Ads and Google Merchant Center data using OAuth2 user credentials.MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides Google Analytics and Search Console data as tools for AI assistants, enabling natural language queries for web analytics, SEO performance, and site insights.13MIT
- AlicenseCqualityBmaintenanceMCP server providing 32 tools for Google Search Console and Google Analytics 4, enabling search analytics, URL inspection, indexing, and cross-platform analysis via natural language.8159 PyPI24MIT