Skip to main content

Syne Google Analytics MCP Server

A Model Context Protocol (MCP) server for Google Analytics 4 data.

Overview

This server provides an MCP interface to Google Analytics 4 data, allowing AI assistants to query GA4 data through a standardized protocol.

Features

The server exposes the following tools via the MCP call_tool endpoint:

  • run_ga4_report: Runs a standard report using the Google Analytics Data API v1beta. Allows specifying metrics, optional dimensions, date range, and row limit.
  • run_realtime_report: Runs a realtime report using the Google Analytics Data API v1beta. Allows specifying metrics, optional dimensions, and row limit.
  • get_metadata: Gets metadata about available metrics and dimensions (or all) for the configured GA4 property.

It also handles authentication using Google service account credentials provided in the configuration.

        tools = [
            types.Tool(
                name="run_ga4_report",
                description="Runs a report using the Google Analytics Data API v1beta.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "metrics": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Required. List of metric names (e.g., ['activeUsers', 'sessions']). See GA4 documentation for valid metrics."
                        },
                        "dimensions": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Optional. List of dimension names (e.g., ['country', 'city']). See GA4 documentation for valid dimensions.",
                            "optional": True
                        },
                        "date_range": {
                            "type": "string", # Could also be an object, handled by ga_handler
                            "description": "Optional. Date range alias ('today', 'yesterday', 'last7days', 'last30days') or an object like {'start_date': 'YYYY-MM-DD', 'end_date': 'YYYY-MM-DD'}.",
                            "default": "last30days"
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Optional. The maximum number of rows to return in the report.",
                            "default": 10
                        }
                    },
                    "required": ["metrics"]
                },
            ),
            types.Tool(
                name="run_realtime_report",
                description="Runs a realtime report using the Google Analytics Data API v1beta.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "metrics": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Required. List of metric names (e.g., ['activeUsers', 'screenPageViews']). See GA4 realtime documentation for valid metrics."
                        },
                        "dimensions": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "Optional. List of dimension names (e.g., ['country', 'city']). See GA4 realtime documentation for valid dimensions.",
                            "optional": True
                        },
                        "limit": {
                            "type": "integer",
                            "description": "Optional. The maximum number of rows to return in the report.",
                            "default": 10
                        }
                    },
                    "required": ["metrics"]
                },
            ),
            types.Tool(
                name="get_metadata",
                description="Gets metadata about available metrics and dimensions for the configured property.",
                inputSchema={
                    "type": "object",
                    "properties": {
                        "metadata_type": {
                            "type": "string",
                            "description": "Optional. Specifies the type of metadata to retrieve: 'metrics', 'dimensions', or 'all'.",
                            "default": "all",
                            "enum": ["metrics", "dimensions", "all"] # Adding enum for clarity
                        }
                    }
                },
            ),
        ]

Metadata

Release files for syne_ga_mcp 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for syne_ga_mcp 0.0.1
File Size Uploaded Provenance
syne_ga_mcp-0.0.1.tar.gz 34.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for syne_ga_mcp 0.0.1
File Interpreter ABI Platform
syne_ga_mcp-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 kB

Release files / syne_ga_mcp-0.0.1.tar.gz

Download URL syne_ga_mcp-0.0.1.tar.gz
Size 34.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3b4be469311c9725e0ba47ac548b3a2a214b8ad879b4ac9b899a21d9b26af2ee
BLAKE2b-256 checksum
How to use checksums
0256889e464daf84e4a8ff4db269843e856542427c53193335f7b82f9cb53bc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / syne_ga_mcp-0.0.1-py3-none-any.whl

Download URL syne_ga_mcp-0.0.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e179325d786358daaf68e9c0d06fe8902a9e3a3dfd1b6c79347d690d9e2f31f
BLAKE2b-256 checksum
How to use checksums
f27e6b8fcee54e45af7c9aee357fafc6a2ffbc486abe00fec9a7306593359b8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Security for syne_ga_mcp 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page