← Back to directory
G

Google Analytics MCP Server

Official
Local, experimental MCP server for Google Analytics
GitHub source repository ↗
★ 3.2k Stars Category · Other Very popular
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.

Reliability
9/20
Security and permissions
13/20
Maintenance
13/20
Documentation
13/20
Setup experience
14/20
Read the FMRS scoring method →

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.

Tools

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

Setup

  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.
claude_desktop_config.json
{
  "mcpServers": {
    "analytics-mcp": {
      "command": "pipx",
      "args": ["run", "analytics-mcp"],
      "env": {
        "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_CREDENTIALS_JSON",
        "GOOGLE_PROJECT_ID": "YOUR_PROJECT_ID"
      }
    }
  }
}

Fit and risk

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

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

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 CLIFull support
Gemini Code AssistFull support
Claude CodeFull support