Skip to main content
Glama
Google Analytics MCP Plus

Google Analytics MCP Plus

by marcvrn

Google Analytics MCP Plus

An independent MCP server for Google Analytics 4 reporting and property configuration. It connects an MCP client to the official Analytics Admin and Data APIs through a local Python process.

The official Google Analytics MCP is read-only. This server adds controlled writes: key events, custom dimensions and metrics, Google Ads links, data streams, Measurement Protocol secrets, audiences, annotations, and the rest of the Admin API.

This project is not affiliated with Google.

Tools

Tool

Purpose

list_account_summaries

Accounts and properties, filtered by the property allowlist

get_metadata

Dimensions and metrics available to a property, including custom ones

run_report

Data API reports: report, pivot, batch, batch_pivot, realtime, compatibility, funnel

list_admin_methods

Admin API v1alpha methods grouped as read, write, and blocked

get_request_schema

Protobuf fields for any Admin method or data.<kind>, without credentials

admin_read

Any get_, list_, search_, batch_get_, or run_ Admin method

admin_write

Any other Admin method, validate-only by default

admin_read and admin_write take the method name and its request JSON, so the whole Admin API is reachable without a tool per resource:

{"method": "create_key_event",
 "request": {"parent": "properties/123",
             "key_event": {"event_name": "purchase", "counting_method": "ONCE_PER_EVENT"}}}

Update masks accept snake_case ("display_name,description").

Related MCP server: Google Analytics MCP Server

Write safety

  • Writes are disabled by default. Execution requires GOOGLE_ANALYTICS_ENABLE_WRITES=true in the server environment and validate_only=false in the call.

  • Validation is local. The Admin API has no server-side dry run. Validation parses the request against the API schema, applies the allowlist, and returns the parsed request. Permissions and business rules are checked only on execution.

  • Property allowlist. With GOOGLE_ANALYTICS_ALLOWED_PROPERTY_IDS set, every properties/N reference in a request must be allowed, and writes that reference no property (account-level changes) are refused.

  • Blocked methods. Account and property deletion, account provisioning, roll-up properties, user deletion, user data collection acknowledgement, and access binding (user permission) changes are refused regardless of settings.

  • No automatic retries on writes. A timed-out write may have succeeded. Read the property before retrying.

Authentication

The server uses Application Default Credentials. The credential needs both Analytics scopes: the Admin API accepts analytics.edit for writes, but the Data API rejects it and requires analytics.readonly. One credential can serve this server and Google Ads MCP Plus:

gcloud auth application-default login \
	--client-id-file=/absolute/path/to/oauth-client.json \
	--scopes=https://www.googleapis.com/auth/analytics.readonly,https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/adwords,https://www.googleapis.com/auth/cloud-platform

Enable the Google Analytics Admin API and Google Analytics Data API in the Cloud project that owns the OAuth client. Set GOOGLE_CLOUD_QUOTA_PROJECT if quota should be billed to a different project.

Variable

Default

Meaning

GOOGLE_APPLICATION_CREDENTIALS

Standard ADC lookup

Absolute path to the credential file

GOOGLE_ANALYTICS_ENABLE_WRITES

false

true permits execution

GOOGLE_ANALYTICS_ALLOWED_PROPERTY_IDS

Empty

Comma-separated property IDs. Empty permits every property the user can access

GOOGLE_ANALYTICS_TIMEOUT_SECONDS

30

Timeout per API call, 1 to 300

Install and verify

uv sync --locked
export GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/to/application_default_credentials.json"
uv run python scripts/smoke_test.py --property-id 123456789               # read-only
uv run python scripts/smoke_test.py --property-id 123456789 --write-test  # creates and deletes one annotation

Connect a client

{
	"mcpServers": {
		"google-analytics-mcp-plus": {
			"command": "/absolute/path/to/uv",
			"args": ["run", "--directory", "/absolute/path/to/google-analytics-mcp-plus", "--locked", "google-analytics-mcp-plus"],
			"env": {
				"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/application_default_credentials.json",
				"GOOGLE_ANALYTICS_ALLOWED_PROPERTY_IDS": "123456789",
				"GOOGLE_ANALYTICS_ENABLE_WRITES": "false"
			}
		}
	}
}

Limits

  • Local stdio only.

  • The Admin API surface is v1alpha, which includes every v1beta method. Alpha methods can change.

  • List methods return one page. Pass page_token in the request to continue.

  • Measurement Protocol event sending and Data API audience exports are not exposed.

License

MIT.

Available Tools

7 tools
admin_readA
Read-only

Call a read-only Admin API method (get_, list_, search_, batch_get_, run_) with its request JSON, e.g. method=list_key_events, request={"parent":"properties/123"}. List methods return one page; pass page_token in request to continue.

Inputs: method (required), request (required).

admin_writeA
Destructive

Validate or execute one Admin API write (create_, update_, delete_, archive_, ...). e.g. method=create_key_event, request={"parent":"properties/123", "key_event":{"event_name":"purchase","counting_method":"ONCE_PER_EVENT"}}. Updates require update_mask. Default validates locally only; execution also requires GOOGLE_ANALYTICS_ENABLE_WRITES=true. Obtain user authorization before executing.

Inputs: method (required), request (required), validate_only.

get_metadataB
Read-only

List dimensions and metrics, including custom ones, usable in reports.

Inputs: property_id (required).

get_request_schemaA
Read-only

Inspect protobuf request fields without credentials. Method is an Admin method (e.g. create_key_event) or data. (e.g. data.report). Pass a returned message_type to inspect nested fields. Field masks are comma-separated strings.

Inputs: method (required), message_type.

list_account_summariesB
Read-only

List GA accounts and properties, filtered by the configured property allowlist.

Inputs: page_token.

list_admin_methodsA
Read-only

List Admin API (v1alpha) methods grouped as read, write, and blocked.

Inputs: no named parameters.

run_reportA
Read-only

Run a Data API report. Request is the request JSON without property. Kinds: report (RunReportRequest), pivot, batch, batch_pivot, realtime, compatibility, funnel (v1alpha RunFunnelReportRequest). Inspect get_request_schema("data."). Example: {"date_ranges":[{"start_date":"28daysAgo","end_date":"today"}], "dimensions":[{"name":"eventName"}],"metrics":[{"name":"eventCount"}],"limit":50}

Inputs: request (required), property_id (required), kind.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation4/5

    The Data API path (run_report) and Admin API path (admin_read/admin_write) are clearly separated, and read vs write is explicit. The only mild overlap is between the discovery tools list_admin_methods and get_request_schema, plus get_metadata vs get_request_schema, but descriptions clarify that one lists dimensions/metrics and the other inspects protobuf fields.

    Naming Consistency4/5

    Five tools follow a verb_noun pattern (list_account_summaries, get_metadata, run_report, list_admin_methods, get_request_schema), while admin_read/admin_write use a noun_verb grouping that still reads predictably as a pair. Minor deviation only, no chaotic mixing.

    Tool Count5/5

    Seven tools is well-scoped: instead of one tool per GA method, the server uses generic dispatch (admin_read/admin_write) with schema discovery, keeping the surface small while covering a large API. Each tool earns its place.

    Completeness4/5

    Reporting (report, pivot, batch, realtime, funnel), metadata, account listing, and full Admin read/write with validation and schema inspection cover the domain end to end. The main gap is that write execution requires an env flag and there is no built-in pagination helper beyond manually passing page_token.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides full Google Analytics 4 management and reporting capabilities via MCP, including property management, custom dimensions, audiences, events, data streams, and real-time reporting.
      MIT
    • A
      license
      A
      quality
      Not graded
      maintenance
      Enables LLM applications to query and analyze Google Analytics 4 data through standard MCP interfaces, supporting service account and OAuth2 authentication.
      5
      10 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying Google Analytics 4 data through MCP tools for running reports, listing properties, getting real-time metrics, and exploring metadata.
      57 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients to query Google Analytics 4 reporting and configuration data through 27 read-only tools, including pivots, funnels, realtime reports, Admin API inspection, and diagnostics, with identifiers redacted by default.
      27
      Apache 2.0