Google Analytics 4 · get-mcp-ads — Claude Code MCP server: features and setup
This MCP server lets an agent read GA4 reports, funnels, and property settings. Use it to explore analytics from Claude Code without write access.
claude mcp add --env GA4_CLIENT_ID=<GA4_CLIENT_ID> --env GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> --env GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --env GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> --transport stdio get-mcp-ads-google-analytics-4 -- npx -y @getmcpads/google-analytics-mcp-serverWhat Google Analytics 4 does
The server offers 27 tools for reading Google Analytics 4 data, including reports, funnels, realtime data, and property settings. It can check metric and dimension combinations before an API request, and show a property’s quota snapshot. There are no tools for changing data.
You need GA4 credentials set as GA4_CLIENT_ID, GA4_CLIENT_SECRET, and GA4_REFRESH_TOKEN. The server runs through npx and requires Node.js 22.23.4, 24.22.1, or 26.12.1 or newer within those release lines. An older Node.js version triggers a startup warning. Claude Code connects to it over MCP using stdio.
What it helps with
- inspect GA4 traffic and conversions
- check metric and dimension compatibility before querying
- review funnel reports and realtime data
- check a property’s GA4 quota
- read property and data stream settings
Example prompts for the agent
- Show the conversion report for my GA4 property.
- Check whether these GA4 metrics and dimensions work together.
- Check the remaining query quota for my GA4 property.
How to install Google Analytics 4
Platform CLI
claude mcp add --env GA4_CLIENT_ID=<GA4_CLIENT_ID> --env GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> --env GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --env GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> --transport stdio get-mcp-ads-google-analytics-4 -- npx -y @getmcpads/google-analytics-mcp-serverReplace <…> with your own values
Platform CLI
codex mcp add get-mcp-ads-google-analytics-4 --env GA4_CLIENT_ID=<GA4_CLIENT_ID> --env GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> --env GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --env GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> -- npx -y @getmcpads/google-analytics-mcp-serverReplace <…> with your own values
Config file
{
"mcpServers": {
"get-mcp-ads-google-analytics-4": {
"command": "npx",
"args": [
"-y",
"@getmcpads/google-analytics-mcp-server"
],
"env": {
"GA4_CLIENT_ID": "<GA4_CLIENT_ID>",
"GA4_CLIENT_SECRET": "<GA4_CLIENT_SECRET>",
"GA4_REFRESH_TOKEN": "<GA4_REFRESH_TOKEN>",
"GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
"GA4_PROPERTY_IDS": "<GA4_PROPERTY_IDS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"get-mcp-ads-google-analytics-4": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@getmcpads/google-analytics-mcp-server"
],
"env": {
"GA4_CLIENT_ID": "<GA4_CLIENT_ID>",
"GA4_CLIENT_SECRET": "<GA4_CLIENT_SECRET>",
"GA4_REFRESH_TOKEN": "<GA4_REFRESH_TOKEN>",
"GA4_PROPERTY_ID": "<GA4_PROPERTY_ID>",
"GA4_PROPERTY_IDS": "<GA4_PROPERTY_IDS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e GA4_CLIENT_ID=<GA4_CLIENT_ID> -e GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> -e GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> -e GA4_PROPERTY_ID=<GA4_PROPERTY_ID> -e GA4_PROPERTY_IDS=<GA4_PROPERTY_IDS> get-mcp-ads-google-analytics-4 npx -y @getmcpads/google-analytics-mcp-serverReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Google Analytics 4
How do I install Google Analytics 4 in Claude Code?
Run `claude mcp add google-analytics -e GA4_CLIENT_ID=<GA4_CLIENT_ID> -e GA4_CLIENT_SECRET=<GA4_CLIENT_SECRET> -e GA4_REFRESH_TOKEN=<GA4_REFRESH_TOKEN> -- npx -y @getmcpads/google-analytics-mcp-server`. Replace the placeholders with your GA4 credentials.
What does the Google Analytics 4 MCP server do?
It gives an agent 27 tools for reading GA4 reports, funnels, realtime data, and property settings. It cannot write data.
Which Node.js versions does the server require?
Use 22.23.4, 24.22.1, or 26.12.1 or newer in the matching release line. You also need GA4_CLIENT_ID, GA4_CLIENT_SECRET, and GA4_REFRESH_TOKEN.
Similar MCP servers
All MCP servers for Data and databases →Google Analytics 4 by other authors comes first.