I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

ruchernchong_mcp-server-google-analytics
Mirror ofhttps://github.com/ruchernchong/mcp-server-google-analytics
3 years
Works with Finder
0
Github Watches
1
Github Forks
0
Github Stars
Google Analytics MCP Server
An MCP server implementation for accessing Google Analytics 4 (GA4) data, built using the Model Context Protocol TypeScript SDK.
Features
- Get page view metrics with customizable dimensions
- Track active and new users over time
- Analyze specific events and their metrics
- Monitor user behavior metrics (session duration, bounce rate)
- Flexible date range selection for all queries
Prerequisites
- Node.js 20 or higher
- Google Analytics 4 property
- Google Cloud project with Analytics Data API enabled
- Service account credentials with appropriate permissions
Setup
- Create a Google Cloud project and enable the Analytics Data API
- Create a service account and download the credentials JSON file
- Grant the service account appropriate access to your GA4 property
- Set up environment variables:
export GOOGLE_CLIENT_EMAIL="your-service-account@project.iam.gserviceaccount.com"
export GOOGLE_PRIVATE_KEY="your-private-key"
export GA_PROPERTY_ID="your-ga4-property-id"
Installation
pnpm install mcp-server-google-analytics
Usage
Starting the Server
pnpm start
Configuration in Claude Desktop
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"
}
}
}
}
Available Functions
getPageViews
Get page view metrics for a specific date range:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"dimensions": ["page", "country"] // Optional
}
getActiveUsers
Get active users metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31"
}
getEvents
Get event metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"eventName": "purchase" // Optional
}
getUserBehavior
Get user behavior metrics:
{
"startDate": "2024-01-01",
"endDate": "2024-01-31"
}
Security Considerations
- Always use environment variables for sensitive credentials
- Implement appropriate CORS settings
- Follow the principle of least privilege when setting up service account permissions
- Regularly rotate service account credentials
- Monitor API usage and implement rate limiting if needed
Contributing
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
相关推荐
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Professional Flask/SQLAlchemy code guide. Follow: https://x.com/navid_re
A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.
Converts Figma frames into front-end code for various mobile frameworks.
Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.
Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx
A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.
Mirror ofhttps://github.com/agentience/practices_mcp_server
Mirror ofhttps://github.com/bitrefill/bitrefill-mcp-server
Reviews

user_2UQq7xvy
I'm a loyal user of ruchernchong_mcp-server-google-analytics and it's a fantastic tool for integrating Google Analytics with MCP servers. Developed by MCP-Mirror, it offers seamless data tracking and insightful analytics. The user-friendly interface and efficient performance make it a must-have for anyone looking to optimize their server analytics. Highly recommend!