← Back to directory
G

Google Analytics MCP Server

Official
Local, experimental MCP server for Google Analytics
Category
Other #57 of 230
Stars
★ 3.6k Very popular
Transport
stdio (local process)
Runtime
Python 3.10+ · Prebuilt binary
Credentials
API key / credential required
License
Apache-2.0
Last commit
Tools
7
62FMRS · C

This is the experimental local MCP server published by the Google Analytics repository. It wraps Admin API and Data API reporting capabilities into MCP tools so clients such as Gemini CLI, Gemini Code Assist, and Claude Code can answer natural-language questions about accounts, properties, core reports, funnel reports, and realtime reports. It suits analysts who already have a Google Cloud project and can configure read-only ADC credentials, and it is not intended for users who cannot set up credentials or who need write operations. The main risks are its experimental status and the handling of the local credentials file.

Strongest · Setup experience 14/20 Weakest · Reliability 9/20

Reliability
9/20
Security and permissions
13/20
Maintenance
13/20
Documentation
13/20
Setup experience
14/20
Why each score
Reliability 9/20
Static review from the supplied README only: it references CI check-run badges and requires enabling the Admin/Data APIs, implying some automation; however no committed tests, no cached manifest, no tool parameter schemas, and no error-handling description are provided, so whether declared tools match real behavior is unverifiable. The README also labels the server 'Experimental'. Under the static calibration rule (no execution evidence, reliability capped at 12), and treating missing manifest/test evidence as a deduction, the score is 9.
Security and permissions 13/20
Credential handling is reasonable: Application Default Credentials injected via the GOOGLE_APPLICATION_CREDENTIALS env var (no real tokens in the examples), with an explicit requirement for the read-only https://www.googleapis.com/auth/analytics.readonly scope, which is aligned with least privilege. All listed tools are read-oriented (account summaries, property details, reports, Google Ads links), with no destructive, write, pay, deploy, or remote-command defaults. Deductions: the sample gcloud commands also request the broad cloud-platform scope; no data-flow, logging, or env-var leakage disclosure; no mention of confirmation or network-boundary details. No red-line condition is triggered, hence 13.
Maintenance 13/20
Apache-2.0 license is present, the repo is not archived, 3229 stars and 25 open issues indicate real usage and a feedback channel (Discord, contributing guide, YouTube tutorials), and PyPI publication shows versioned artifacts. Deductions: the README alone cannot verify commit cadence, release discipline, dependency update policy, or a security-response process; ownership/governance details are absent. Score 13.
Documentation 13/20
Reasonably layered docs: install steps covering Python/pipx, enabling Google Cloud APIs, ADC credential setup with gcloud examples, and client configuration samples for Gemini CLI and Claude Code, plus runnable sample prompts and a YouTube walkthrough. Deductions: no per-tool parameter documentation, quota/cost limits, error codes, or troubleshooting section, and with no cached manifest the tool signatures cannot be cross-checked against the docs. Score 13.
Setup experience 14/20
The install path is clear and short: run analytics-mcp via pipx, pass two environment variables, and it plugs into mainstream clients (Gemini CLI, Gemini Code Assist, Claude Code) with copy-pasteable snippets. Deductions: it depends on a Google Cloud project, API enablement, and ADC/OAuth client configuration, which are error-prone manual prerequisites, with no version pinning or alternative path without gcloud. Under the static calibration cap (setup cannot exceed 15 without CI plus committed tests), the score is 14.

Static review · not runListed 2026-09-18

Read the FMRS scoring method →

Fit and risk

What it can accessUses the network

Best for

  • Users of Gemini CLI, Gemini Code Assist, or Claude Code who want to query Google Analytics data in natural language
  • Analysts with a Google Cloud project and Google Analytics access who can configure ADC credentials
  • Teams that prefer running the server locally and managing their own credentials

Not for

  • Users without Google Analytics access or the ability to configure Google Cloud credentials
  • Users looking for a fully managed, zero-configuration service
  • Scenarios that need to write to or modify Google Analytics configuration (the credential scope is read-only)
  • Production scenarios with strict stability requirements, given the experimental status

Required permissions

  • Application Default Credentials for a user with access to the target Google Analytics accounts or properties
  • Google Analytics read-only scope https://www.googleapis.com/auth/analytics.readonly
  • Google Analytics Admin API and Google Analytics Data API enabled in the Google Cloud project
  • Optional Google Cloud project ID (GOOGLE_PROJECT_ID) for quota and billing attribution

Risks and side effects

  • The server is experimental, so behavior and interfaces may change
  • Credentials are stored locally as a JSON file referenced by an environment variable; if exposed, Google Analytics data could be read
  • Queries are generated by an LLM and may produce inaccurate or unintended reporting requests
  • Network access to the Google Analytics APIs is required

Setup

Before you start

Runtime:Python 3.10+ · Prebuilt binary

GOOGLE_APPLICATION_CREDENTIALS requiredsecret Path to the Application Default Credentials JSON file generated via gcloud auth application-default login; credentials must include the analytics.readonly scope.
GOOGLE_PROJECT_ID required Your Google Cloud project ID with the Google Analytics Admin API and Data API enabled; find it in the Google Cloud console.
  1. Install pipx to run the Python package.
  2. Enable the Google Analytics Admin API and Google Analytics Data API in your Google Cloud project.
  3. Configure Application Default Credentials (ADC) for a user with access to your Google Analytics accounts or properties, including the read-only scope https://www.googleapis.com/auth/analytics.readonly. You can use gcloud auth application-default login (with --scopes plus --client-id-file, or with --impersonate-service-account); the command prints the path to the credentials JSON when it completes.
  4. Install Gemini CLI or Gemini Code Assist and edit ~/.gemini/settings.json to add an analytics-mcp entry under mcpServers, pointing GOOGLE_APPLICATION_CREDENTIALS at the credentials JSON path and, recommended, setting GOOGLE_PROJECT_ID to your Google Cloud project ID.
  5. Alternatively, in Claude Code run: claude mcp add analytics-mcp --scope user -e "GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON" -e "GOOGLE_PROJECT_ID=YOUR_PROJECT_ID" -- pipx run analytics-mcp
  6. Launch your client and type /mcp; analytics-mcp should appear in the results.
.mcp.json
{
  "mcpServers": {
    "analytics-mcp": {
      "command": "pipx",
      "args": ["run", "analytics-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
        "GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
      }
    }
  }
}

Shown for Claude Code. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "analytics-mcp": {
      "command": "pipx",
      "args": [
        "run",
        "analytics-mcp"
      ],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
        "GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add analytics-mcp -e GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_CREDENTIALS_JSON -e GOOGLE_PROJECT_ID=YOUR_PROJECT_ID -- pipx run analytics-mcp

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Launch Gemini CLI or Gemini Code Assist and type /mcp; confirm analytics-mcp and its tools (e.g. get_account_summaries, run_report) appear. Alternatively ask "what are the most popular events in my Google Analytics property in the last 180 days?" — a data-backed answer proves the connection.

Troubleshooting

  1. Type /mcp in the client and confirm analytics-mcp is listed
  2. Verify the Admin API and Data API are enabled in your Google Cloud project
  3. Check that GOOGLE_APPLICATION_CREDENTIALS points to the correct credentials JSON and that it includes the analytics.readonly scope
  4. Confirm the credential's user has access to the intended Google Analytics account or property
  5. Run pipx run analytics-mcp to check the command executes
  6. If reports fail, retry with a more explicit property name or date range

Things to try

Once connected, you can ask your AI assistant things like:

  • what can the analytics-mcp server do?
  • Give me details about my Google Analytics property with 'xyz' in the name
  • what are the most popular events in my Google Analytics property in the last 180 days?
  • what are the custom dimensions and custom metrics in my property?

Tools 7

get_account_summaries read-only
Retrieves information about the user's Google Analytics accounts and properties.
get_property_details read-only
Returns details about a property.
list_google_ads_links read-only
Returns a list of links to Google Ads accounts for a property.
run_report read-only
Runs a Google Analytics report using the Data API.
run_funnel_report read-only
Runs a Google Analytics funnel report using the Data API.
get_custom_dimensions_and_metrics read-only
Retrieves the custom dimensions and metrics for a specific property.
run_realtime_report read-only
Runs a Google Analytics realtime report using the Data API.

Use cases

Ask which Google Analytics properties exist under an account
Get details and configuration for a specific property
Analyze the most popular events over a time range
Check whether most users were signed in
Inspect custom dimensions and custom metrics for a property
List linked Google Ads accounts for a property
Run realtime and funnel reports

Supported clients

Gemini CLI
Gemini Code Assist
Claude Code

Listed from the project's documentation, not tested by this site.

Overview

This is the source for a local MCP server from the Google Analytics repository that exposes Google Analytics account, property, and reporting capabilities to LLMs through the Google Analytics Admin API and Data API. It runs locally and requires Python (pipx), Google Analytics credentials via Application Default Credentials with the read-only scope, and registration in a client such as Gemini CLI, Gemini Code Assist, or Claude Code. The repository labels the server as experimental.

Similar servers

BioMCP 75 · B

One binary. One grammar. Evidence from the biomedical sources you already trust.

★ 670 · Tools 11 Compare with this →

Source revision a7b483f2b02c Data synced 2026-11-02 Read the FMRS scoring method