Google Analytics MCP Server
Provides tools for interacting with Google Analytics 4 (GA4) data, including listing accounts and properties, running historical reports with custom metrics and dimensions, and fetching real-time user activity.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Analytics MCP ServerHow many users did my site have yesterday?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Analytics MCP Server
🚀 MCP Server para Google Analytics 4 (GA4) - Permite a agentes de IA consultar datos de Analytics en tiempo real.
✨ Características
📊 Listar cuentas de Google Analytics
🌐 Listar propiedades (sitios web) por cuenta
📈 Reportes históricos con métricas y dimensiones personalizables
⚡ Reportes en tiempo real - usuarios activos ahora mismo
Related MCP server: Google Analytics MCP Server
📋 Requisitos Previos
Node.js v18 o superior
Proyecto en Google Cloud con las siguientes APIs habilitadas:
Google Analytics Admin API
Google Analytics Data API
Credenciales OAuth 2.0 (Client ID y Client Secret)
🔧 Instalación
1. Clonar el repositorio
git clone https://github.com/TU_USUARIO/google-analytics-mcp.git
cd google-analytics-mcp
npm install2. Configurar Google Cloud
Ve a Google Cloud Console
Crea un proyecto o selecciona uno existente
Habilita las APIs:
Ve a APIs & Services > Credentials
Crea credenciales OAuth 2.0 Client ID (tipo: Desktop App)
Descarga el archivo JSON
3. Obtener Refresh Token
Edita get-refresh-token.js con tu Client ID y Client Secret, luego:
```bash
node get-refresh-token.jsNota: El script solicitará permisos de edición (
analytics.edit) para permitir la creación de nuevas propiedades.
Esto abrirá el navegador para autenticarte y generará google-analytics.yaml.
4. Crear credentials.json
Crea un archivo credentials.json con este formato:
{
"type": "authorized_user",
"client_id": "TU_CLIENT_ID",
"client_secret": "TU_CLIENT_SECRET",
"refresh_token": "TU_REFRESH_TOKEN",
"quota_project_id": "TU_PROJECT_ID"
}5. Verificar conexión
node test-connection.js🔌 Integración con Antigravity/Claude
Añade a tu mcp_config.json:
{
"mcpServers": {
"google-analytics": {
"command": "node",
"args": ["C:/ruta/a/google-analytics-mcp/mcp-server.js"]
}
}
}🛠️ Herramientas Disponibles
Herramienta | Descripción |
| Lista todas las cuentas de Analytics |
| Lista propiedades de una cuenta |
| Ejecuta un reporte con métricas/dimensiones |
| Usuarios activos en tiempo real |
Ejemplos de uso
"¿Cuántos usuarios tuvo mi sitio ayer?"
"Dame un reporte de países de los últimos 7 días"
"¿Cuánta gente hay navegando ahora?"📁 Estructura del Proyecto
google-analytics-mcp/
├── mcp-server.js # Servidor MCP principal
├── get-refresh-token.js # Script para obtener credenciales
├── test-connection.js # Test de conexión
├── credentials.json # (No subir) Credenciales OAuth
├── google-analytics.yaml # (No subir) Configuración
└── package.json🔒 Seguridad
⚠️ IMPORTANTE: Nunca subas
credentials.jsonogoogle-analytics.yamla Git.
Estos archivos contienen tokens de acceso a tus cuentas de Analytics.
📄 Licencia
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
SEO & marketing toolkit for AI agents: GA4, Search Console, AdSense, GTM, PageSpeed, Trends.
Connect Google Analytics to ChatGPT. Query GA4 data in plain English and get instant insights.
Query your Betterlytics web analytics from AI agents: traffic, funnels, journeys, errors, uptime.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Google Analytics 4 data, providing tools for historical reporting, real-time activity monitoring, and property management. It supports secure service account authentication to access metrics like traffic summaries, user acquisition, and custom dimensions.MIT
- AlicenseAqualityCmaintenanceEnables LLMs to interact with Google Analytics Admin and Data APIs to retrieve account summaries, property details, and custom metrics. It allows users to run core and real-time reports to analyze website performance and configuration via natural language.71Apache 2.0
- AlicenseNot gradedqualityFmaintenanceEnables LLMs to interact with Google Analytics 4 data through the Google Analytics Data API, supporting standard reports, real-time data, and metadata retrieval.19MIT
- AlicenseAqualityDmaintenanceEnables LLMs to interact with Google Analytics via Admin and Data APIs, allowing users to retrieve account summaries, run reports, and analyze realtime data.6Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/creativedesignseo/google-analytics-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server