google-analytics-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | HTTP port (default 8080). | 8080 |
| BASE_URL | No | Public URL of this service. Used for OAuth metadata and as the canonical resource URI tokens are bound to. Required for Mode B (remote HTTP server). | |
| LOG_LEVEL | No | Python log level (default INFO). | INFO |
| GCP_PROJECT_ID | No | GCP project hosting Firestore. Required for Mode B (remote HTTP server). | |
| MCP_USER_EMAIL | No | Your email — set in Claude Desktop config for Mode A (local STDIO). | |
| ALLOWED_DOMAINS | No | Comma-separated email domain allowlist (e.g. acme.com,beta.com). Empty = no restriction. | |
| GOOGLE_CLIENT_ID | No | Google OAuth client ID. Alternative to OAUTH_CONFIG_PATH for Mode B. | |
| OAUTH_CONFIG_PATH | No | Path to client_secret.json. Alternative to GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET; also used in Mode A. | |
| GOOGLE_REDIRECT_URI | No | Override the Google callback URL. Defaults to ${BASE_URL}/auth/callback. | ${BASE_URL}/auth/callback |
| GOOGLE_CLIENT_SECRET | No | Google OAuth client secret. Alternative to OAUTH_CONFIG_PATH for Mode B. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_propertiesA | List all Google Analytics 4 accounts with their associated properties in a hierarchical structure. |
| get_page_viewsB | Get page view metrics for a specific date range from Google Analytics 4. |
| get_active_usersA | Get active users metrics for a specific date range from Google Analytics 4. |
| get_eventsC | Get event metrics for a specific date range from Google Analytics 4. |
| get_traffic_sourcesC | Get traffic source metrics for a specific date range from Google Analytics 4. |
| get_device_metricsB | Get device metrics for a specific date range from Google Analytics 4. |
| get_realtime_usersA | Get active users in the last 30 minutes from Google Analytics 4. This uses the Realtime API — a different endpoint from standard reports. Data reflects activity within the last 30 minutes only; no date range applies. |
| get_property_metadataA | List all valid dimensions and metrics available for a Google Analytics 4 property. Use this before calling run_report to discover which metric and dimension names are valid for a specific property. Different properties may have custom dimensions and metrics in addition to the standard GA4 ones. |
| run_funnel_reportA | Run a funnel analysis report for a Google Analytics 4 property. WARNING: EXPERIMENTAL: This uses the GA4 Data API v1alpha endpoint which is unstable and may break or change without notice. A funnel shows how many users complete each step in a sequence — e.g. homepage -> product page -> add to cart -> purchase. Each step in
STEP FORMAT EXAMPLES: Page path step: { "name": "Homepage", "filterExpression": { "funnelFieldFilter": { "fieldName": "pagePath", "stringFilter": {"matchType": "EXACT", "value": "/"} } } } Event step: { "name": "Purchase", "filterExpression": { "funnelEventFilter": { "eventName": "purchase" } } } |
| run_reportA | Execute a comprehensive Google Analytics 4 report with full customization capabilities. IMPORTANT: Use STRING ARRAYS for metrics and dimensions, NOT objects! CORRECT FORMAT:
INCORRECT FORMAT (will fail):
VALID GA4 METRICS:
COMMON METRIC MISTAKES:
VALID GA4 DIMENSIONS:
COMMON DIMENSION MISTAKES:
SORTING (order_bys) - EXPERIMENTAL:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| ga4_reference | Google Analytics 4 API reference documentation. |
TDQS
Scored across 10 tools
Most tools are clearly distinct by metric type (page views, active users, events, traffic sources, devices, realtime users). However, get_active_users and get_realtime_users both measure active users, differing only by time window, which could cause confusion. run_report and run_funnel_report are distinct but run_report's broad scope overlaps somewhat with the individual metric getters.
Tool names follow a consistent get_<metric>_metrics pattern, with list_properties, get_property_metadata, run_report, and run_funnel_report as readable exceptions. The naming is mostly consistent, though run_report and run_funnel_report use a different verb style than the get_* tools.
10 tools is well-scoped for a Google Analytics MCP server. Each tool covers a distinct reporting need, and the count is within the ideal 3-15 range.
The server covers property discovery, metadata exploration, standard reports, realtime data, and funnel analysis. Minor gaps include no tool for creating/updating properties or managing audiences, but the core analytics querying surface is well covered.