Access Google Analytics 4 (GA4) data using the Model Context Protocol.
An MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.
To use this server, you need to configure authentication with Google Analytics. This is done using a service account.
client_email
from the JSON credentials file you downloaded.The server requires the following environment variables:
GOOGLE_CLIENT_EMAIL
: The client_email
from your service account JSON file.GOOGLE_PRIVATE_KEY
: The private_key
from your service account JSON file.GA_PROPERTY_ID
: Your Google Analytics 4 property ID.You can set them in your environment or use a .env
file.
export GOOGLE_CLIENT_EMAIL="your-service-account@your-project.iam.gserviceaccount.com"
export GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_PRIVATE_KEY\n-----END PRIVATE KEY-----\n"
export GA_PROPERTY_ID="your_property_id"
To install Google Analytics Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install mcp-server-google-analytics --client claude
npm install -g mcp-server-google-analytics
Or use with npx directly:
npx mcp-server-google-analytics
pnpm start
Add this to your Claude Desktop configuration:
{
"mcpServers": {
"google-analytics": {
"command": "npx",
"args": ["-y", "mcp-server-google-analytics"],
"env": {
"GOOGLE_CLIENT_EMAIL": "your-service-account@project.iam.gserviceaccount.com",
"GOOGLE_PRIVATE_KEY": "your-private-key",
"GA_PROPERTY_ID": "your-ga4-property-id"
}
}
}
}
Run a flexible report to get analytics data.
Input:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": [{ "name": "country" }, { "name": "city" }],
"metrics": [{ "name": "activeUsers" }, { "name": "newUsers" }],
"dimensionFilter": {
"filter": {
"fieldName": "country",
"stringFilter": {
"value": "United States"
}
}
}
}
Get page view metrics for a specific date range:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": ["page", "country"] // Optional
}
Get active users metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31"
}
Get event metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"eventName": "purchase" // Optional
}
Get user behavior metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31"
}
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Interact with Stripe API
Query Amazon Bedrock Knowledge Bases using natural language to retrieve relevant information from your data sources.
An MCP server for managing ONOS (Open Network Operating System) networks.
Interact with AWS services using the AWS CLI. Requires AWS CLI to be installed and configured.
Access the Hugging Face Dataset Viewer API to query, explore, search, and analyze machine learning datasets from the Hugging Face Hub.
Interact with the Illumio Policy Compute Engine (PCE) to manage workloads, labels, and analyze traffic flows.
APISIX Model Context Protocol (MCP) server is used to bridge large language models (LLMs) with the APISIX Admin API, supporting querying and managing all resources in Apache APISIX.
An MCP server for accessing YouTube Analytics data, powered by the CData JDBC Driver.
A remote, authentication-free MCP server deployable on Cloudflare Workers or locally via npm.
Access and manage AWS VPC Lattice resources and related documentation.