Google Calendar MCP Server
Enables language models to interact with Google Calendar through OAuth2 authentication, allowing creation, retrieval, listing, updating, and deletion of calendar events.
README
mcp-gcal
Servidor MCP (Model Context Protocol) para interactuar con Google Calendar. Permite a modelos de lenguaje crear, obtener, listar, actualizar y eliminar eventos de calendario.
🚀 Características
- Crear eventos: Crea eventos con título, descripción, ubicación, asistentes y más.
- Obtener eventos: Recupera información detallada de un evento por su ID.
- Listar eventos: Lista eventos en un rango de fechas con filtros de búsqueda.
- Actualizar eventos: Modifica parcialmente eventos existentes.
- Eliminar eventos: Elimina eventos del calendario.
📋 Requisitos
- Node.js 20 o superior
- Una cuenta de Google con acceso a Google Calendar
- Credenciales OAuth2 de Google Cloud Console
⚙️ Configuración
1. Crear proyecto en Google Cloud Console
- Ve a Google Cloud Console
- Crea un nuevo proyecto o selecciona uno existente
- Ve a APIs & Services > Library
- Busca y habilita Google Calendar API
2. Configurar credenciales OAuth2
- Ve a APIs & Services > Credentials
- Click en Create Credentials > OAuth client ID
- Selecciona Desktop app o Web application
- Configura el redirect URI:
http://localhost:3000/oauth2callback - Guarda el
Client IDyClient Secret
3. Obtener el Refresh Token
Para obtener el refresh_token, puedes usar el OAuth 2.0 Playground de Google:
- Ve a https://developers.google.com/oauthplayground/
- Click en el engranaje (⚙️) arriba a la derecha
- Marca "Use your own OAuth credentials"
- Introduce tu
Client IDyClient Secret - En la columna izquierda, busca Google Calendar API v3
- Selecciona el scope:
https://www.googleapis.com/auth/calendar - Click en Authorize APIs y autoriza tu cuenta
- Click en Exchange authorization code for tokens
- Copia el
refresh_tokendel resultado
4. Configurar variables de entorno
Copia el archivo de ejemplo y rellena tus credenciales:
cp env.example .env
Edita .env con tus valores:
GOOGLE_CLIENT_ID=123456789-abc123.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxx
GOOGLE_REFRESH_TOKEN=1//0xxxxxxxxxxxxxxxxxxxxxx
GOOGLE_REDIRECT_URI=http://localhost:3000/oauth2callback
GOOGLE_CALENDAR_ID=primary
LOG_LEVEL=info
🔧 Instalación y Ejecución
# Instalar dependencias
npm install
# Compilar TypeScript
npm run build
# Ejecutar el servidor
npm start
🚂 Despliegue en Railway
Este proyecto puede desplegarse como API REST en Railway. Consulta la guía completa de despliegue para instrucciones detalladas.
Resumen rápido:
- Conecta tu repositorio a Railway
- Configura las variables de entorno (Google OAuth2 o Service Account)
- Railway construirá y desplegará automáticamente
- Accede a tu API en la URL proporcionada por Railway
Endpoints disponibles:
GET /health- Health checkPOST /api/events- Crear eventoGET /api/events/:eventId- Obtener eventoGET /api/events- Listar eventosPUT /api/events/:eventId- Actualizar eventoDELETE /api/events/:eventId- Eliminar evento
🔌 Integración con Cursor/Claude
Añade el servidor a tu configuración de MCP. En Cursor, añade al archivo ~/.cursor/mcp.json:
{
"mcpServers": {
"google-calendar": {
"command": "node",
"args": ["ruta/a/mcp-gcal/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "tu-client-id",
"GOOGLE_CLIENT_SECRET": "tu-client-secret",
"GOOGLE_REFRESH_TOKEN": "tu-refresh-token",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/oauth2callback",
"GOOGLE_CALENDAR_ID": "primary"
}
}
}
}
🛠️ Tools Disponibles
create_event
Crea un nuevo evento en el calendario.
Parámetros:
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
summary |
string | ✅ | Título del evento |
start |
string | ✅ | Fecha/hora inicio (ISO 8601) |
end |
string | ✅ | Fecha/hora fin (ISO 8601) |
description |
string | ❌ | Descripción del evento |
location |
string | ❌ | Ubicación |
calendarId |
string | ❌ | ID del calendario (default: primary) |
timeZone |
string | ❌ | Zona horaria (default: Europe/Madrid) |
attendees |
string[] | ❌ | Emails de asistentes |
get_event
Obtiene un evento por su ID.
Parámetros:
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
eventId |
string | ✅ | ID del evento |
calendarId |
string | ❌ | ID del calendario |
list_events
Lista eventos en un rango de fechas.
Parámetros:
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
timeMin |
string | ✅ | Fecha/hora mínima (ISO 8601) |
timeMax |
string | ✅ | Fecha/hora máxima (ISO 8601) |
maxResults |
number | ❌ | Máximo de resultados (default: 50) |
calendarId |
string | ❌ | ID del calendario |
q |
string | ❌ | Texto de búsqueda |
update_event
Actualiza parcialmente un evento existente.
Parámetros:
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
eventId |
string | ✅ | ID del evento |
calendarId |
string | ❌ | ID del calendario |
summary |
string | ❌ | Nuevo título |
description |
string | ❌ | Nueva descripción |
location |
string | ❌ | Nueva ubicación |
start |
string | ❌ | Nueva fecha/hora inicio |
end |
string | ❌ | Nueva fecha/hora fin |
timeZone |
string | ❌ | Nueva zona horaria |
attendees |
string[] | ❌ | Nuevos asistentes |
delete_event
Elimina un evento del calendario.
Parámetros:
| Parámetro | Tipo | Requerido | Descripción |
|---|---|---|---|
eventId |
string | ✅ | ID del evento |
calendarId |
string | ❌ | ID del calendario |
💬 Ejemplos de Uso
Estos son ejemplos de prompts que puedes usar con un modelo de lenguaje conectado a este MCP:
Crear un evento
"Crea un evento de 30 minutos mañana a las 10:00 llamado 'Preparar presentación' en mi calendario principal."
Listar eventos
"Lista los eventos de la próxima semana que contengan la palabra 'reunión'."
Actualizar un evento
"Actualiza el evento con id 'abc123xyz' para moverlo a las 11:00."
Eliminar un evento
"Elimina el evento con id 'abc123xyz'."
📦 Estructura del Proyecto
mcp-gcal/
├── src/
│ ├── index.ts # Punto de entrada del MCP
│ ├── gcalClient.ts # Cliente OAuth2 de Google Calendar
│ ├── tools/
│ │ ├── createEvent.ts
│ │ ├── getEvent.ts
│ │ ├── listEvents.ts
│ │ ├── updateEvent.ts
│ │ ├── deleteEvent.ts
│ │ └── index.ts
│ ├── types/
│ │ └── index.ts # Tipos TypeScript compartidos
│ └── utils/
│ ├── errors.ts # Manejo de errores
│ └── logger.ts # Logging
├── dist/ # Código compilado
├── manifest.json # Definición del MCP
├── package.json
├── tsconfig.json
├── env.example
└── README.md
🐛 Manejo de Errores
Los errores se devuelven en formato JSON estructurado:
{
"type": "validation_error",
"message": "El campo 'summary' es requerido",
"details": {
"field": "summary"
}
}
Tipos de error:
auth_error: Problemas de autenticación con Googlevalidation_error: Parámetros inválidos o faltantesgoogle_api_error: Errores de la API de Google Calendarnot_found_error: Recurso no encontradounknown_error: Errores no categorizados
📝 Licencia
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Neon Database
MCP server for interacting with Neon Management API and databases