Skip to main content
MCP server CX Codex

Google Analytics 4 · mindstone — Claude Code MCP server: setup

This MCP server lets an AI agent inspect GA4 properties and schemas, then run reports. Use it to explore analytics data from your coding environment.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --transport stdio google-analytics -- npx -y @mindstone/mcp-server-google-analytics
Open on GitHub

What Google Analytics 4 does

The server can list GA4 accounts and properties, inspect available dimensions and metrics, check whether they work together, and run reports. Large exports can run as asynchronous tasks, with results retrieved in pages. Standard reports include safeguards for high row volumes.

You need Node.js 20+, npm, and Google credentials with the analytics.readonly scope, or a service-account JSON file that has access to the GA4 property. Set GOOGLE_APPLICATION_CREDENTIALS to an absolute file path; Node.js will not expand ~ or %APPDATA%. That path requirement matters: an unresolved shortcut prevents the server from reading the credentials. GA4_PROPERTY_ID can provide a default property.

What it helps with

  • list available GA4 accounts and properties
  • inspect a property's dimensions and metrics
  • check dimension and metric compatibility before reporting
  • run a report against GA4 data
  • retrieve a large report through an asynchronous export

Example prompts for the agent

  • List the GA4 accounts and properties I can access.
  • Check whether these dimensions and metrics can be used together in a report.
  • Run a report for this GA4 property and retrieve the large export in pages.

How to install Google Analytics 4

Platform CLI

claude mcp add --env GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> --env GA4_PROPERTY_ID=<GA4_PROPERTY_ID> --transport stdio google-analytics -- npx -y @mindstone/mcp-server-google-analytics

Replace <…> 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 mcp-server-google-analytics -e GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> -- npx -y @mindstone/mcp-server-google-analytics`. Set the credential variable to an absolute path.

What does the Google Analytics 4 MCP server do?

It lets an agent inspect GA4 accounts, properties, schemas, and reporting data. Large exports can be handled as background tasks and read in pages.

What credentials does the server require?

Use Google ADC with the analytics.readonly scope, or a service-account JSON file that can access the GA4 property. Set its absolute path in GOOGLE_APPLICATION_CREDENTIALS.

Similar MCP servers

All MCP servers for Data and databases →

Google Analytics 4 by other authors comes first.

From the same set40

Kling Connects Kling AI video generation and lip-sync directly to your AI agent. It handles rendering tasks, checks queue status, and downloads assets to the workspace. CX Codex +1 ★ 13repo stars Humaans Connects Humaans to an MCP host so an agent can work with people, roles, time away, offices, and company records. It requires an API key. CX Codex +1 ★ 13repo stars HubSpot A local MCP server that exposes HubSpot CRM to your coding agent: contacts, deals, tickets, tasks and files. Handy when you juggle more than one HubSpot account. CX Codex +1 ★ 13repo stars Google Workspace Connects AI agents to Gmail, Drive, Docs, and Calendar. Gives coding assistants access to emails, files, and scheduling via 124 tools. CX Codex +1 ★ 13repo stars Gamma Turns a prompt into a Gamma deck, document or webpage and hands back a link or a PPTX/PDF file inside your host. CX Codex +1 ★ 13repo stars Freshdesk Connects Freshdesk to your AI assistant to handle support tickets, reply to users, and query help articles. Useful when managing helpdesk queues directly from your coding setup. CX Codex +1 ★ 13repo stars Fathom Connect an AI host to Fathom meeting data to find calls, read transcripts, and retrieve action items. Setup requires a Fathom API key. CX Codex +1 ★ 13repo stars Email (IMAP/SMTP) Wires a mailbox into your coding agent so it can read, search, draft and send mail over IMAP and SMTP. Handy when triaging an inbox or writing a reply without leaving the chat. CX Codex +1 ★ 13repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor