MCP serversAnalytics & researchLeer en español
Set up the Google Analytics 4 MCP server
Run GA4 traffic, channel attribution, funnel and real-time reports locally using Google's official MCP.
Before you start
Install Python 3.8+, pipx and the Google Cloud CLI (gcloud).
Enable Google Analytics Data API and Admin API in your Google Cloud project, then run gcloud auth application-default login.
Add it to your client
This server runs locally over stdio, so use Claude Desktop rather than Claude web.
Open Settings › Developer › Edit Config (claude_desktop_config.json).
Add the block below, restart Claude Desktop and test a read-only prompt.
{
"mcpServers": {
"google-analytics": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
]
}
}
}Browser-only clients like Claude web and ChatGPT require a remote HTTPS endpoint; local stdio servers run in desktop apps and terminal clients.
Register the local stdio command in Claude Code using the command below.
Sign in to your Google Analytics 4 account when the OAuth browser prompt opens and review the requested scopes.
Confirm the tools load by running /mcp inside Claude Code.
claude mcp add google-analytics -- pipx run analytics-mcpOpen .cursor/mcp.json in your project or go to Cursor Settings › Tools & MCP.
Paste the local configuration below and replace placeholder environment variables with your credentials.
Sign in to your Google Analytics 4 account when the OAuth browser prompt opens and review the requested scopes.
{
"mcpServers": {
"google-analytics": {
"command": "pipx",
"args": [
"run",
"analytics-mcp"
]
}
}
}Add the stdio configuration below to .vscode/mcp.json.
Sign in to your Google Analytics 4 account when the OAuth browser prompt opens and review the requested scopes.
Start the server from the VS Code MCP panel.
{
"servers": {
"google-analytics": {
"type": "stdio",
"command": "pipx",
"args": [
"run",
"analytics-mcp"
]
}
}
}Register the local server in Codex CLI with the command below.
Sign in to your Google Analytics 4 account when the OAuth browser prompt opens and review the requested scopes.
Verify the connection with codex mcp list.
codex mcp add google-analytics -- pipx run analytics-mcpChatGPT only connects to remote HTTPS MCP servers, not local stdio processes.
To use Google Analytics 4 from ChatGPT, deploy a remote HTTPS bridge or check the official documentation.
Reference documentation: https://github.com/googleanalytics/google-analytics-mcp
What you can do
- Run standard GA4 reports by source, medium, campaign UTM and landing page.
- Inspect real-time traffic spikes after a social post goes live.
- List GA4 properties, custom dimensions and conversion events.
“Show which social UTM campaigns drove the most engaged sessions and signups in GA4 over the last 30 days.”
What it can change
Strictly read-only by default; reads GA4 properties and reports without altering your analytics configuration.
Pair Google Analytics 4 MCP + Spica Post MCP
Ask GA4 MCP which social posts and UTM campaigns actually drove site traffic this month, then ask Spica Post MCP to write follow-up variations of your winning topics.
“Check our top social landing pages in GA4 over the last 30 days, then ask Spica Post to draft three follow-up posts for LinkedIn and X.”
Questions
Is analytics-mcp officially maintained by Google?
Yes. It is published by the googleanalytics organization at github.com/googleanalytics/google-analytics-mcp.
Can Google Analytics MCP modify my GA4 settings?
No. It runs read-only by default for reporting and property inspection.
Pair your stack with one remote OAuth MCP for social publishing.
Works with the assistant you already use: Claude, ChatGPT, Gemini, Grok and more.


