MCP Calendar Assistant

MCP Calendar Assistant

Enables AI assistants to manage calendars and tasks through natural language, supporting Google Calendar operations like event creation, availability checking, and smart scheduling. It features schedule analysis, task reminders, and meeting time recommendations to streamline productivity.

Category
访问服务器

README

MCP Calendar Assistant

A powerful Model Context Protocol (MCP) server that provides intelligent calendar and task management capabilities. This server allows AI assistants to interact with your calendar through natural language, handling everything from simple event creation to complex scheduling analysis.

🌟 Features

Core Calendar Operations

  • Multi-Calendar Support: Google Calendar (with Outlook/Apple Calendar planned)
  • Event Management: Create, read, update, delete calendar events
  • Smart Scheduling: Find free time slots across multiple calendars
  • Availability Checking: Check if people are available for meetings
  • Meeting Suggestions: AI-powered optimal meeting time recommendations

Task & Reminder Management

  • Smart Reminders: Create and manage tasks with priorities and due dates
  • Natural Language: Process tasks from unstructured text input
  • Analytics: Track completion rates and productivity patterns

Intelligence Features

  • Schedule Analysis: Understand your scheduling patterns and habits
  • Contact Suggestions: Auto-suggest frequent collaborators
  • Similar Events: Find related events for context
  • Working Hours: Respect user preferences and constraints

Performance & Reliability

  • Intelligent Caching: Redis-powered caching with configurable TTLs
  • Batch Operations: Efficient bulk calendar operations
  • Error Handling: Robust error recovery and retry mechanisms
  • Rate Limiting: Built-in protection against API abuse

🏗️ Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   AI Assistant  │────│  MCP Calendar    │────│  Calendar APIs  │
│   (Claude, etc) │    │     Server       │    │ (Google, etc)   │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                              │
                       ┌──────────────────┐
                       │  PostgreSQL +    │
                       │     Redis        │
                       └──────────────────┘

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 12+
  • Redis 6+ (optional but recommended)
  • Google Cloud Project with Calendar API enabled

1. Clone and Install

git clone <repository-url>
cd mcp-calendar-server
npm install

2. Environment Setup

cp .env.example .env
# Edit .env with your configuration

3. Google Calendar Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Enable the Google Calendar API
  4. Create OAuth 2.0 credentials
  5. Add your credentials to .env

4. Database Setup

# Start PostgreSQL and Redis (using Docker)
docker-compose up -d postgres redis

# Or install locally and create database
createdb calendar_assistant

5. Build and Start

npm run build
npm start

# Or for development
npm run dev

🔧 Configuration

Environment Variables

Variable Description Default
DATABASE_URL PostgreSQL connection string postgresql://localhost:5432/calendar_assistant
REDIS_URL Redis connection string redis://localhost:6379
GOOGLE_CLIENT_ID Google OAuth client ID Required
GOOGLE_CLIENT_SECRET Google OAuth client secret Required
JWT_SECRET Secret for JWT tokens Required

Feature Flags

FEATURE_CACHING=true          # Enable Redis caching
FEATURE_BATCHING=true         # Enable batch operations
FEATURE_PREFETCHING=true      # Enable predictive data loading
FEATURE_ANALYTICS=false       # Enable usage analytics
FEATURE_MULTI_PROVIDER=false  # Enable multiple calendar providers

📋 Available Tools

Calendar Operations

  • get_calendars - List available calendars
  • get_calendar_events - Retrieve events from a calendar
  • create_calendar_event - Create new events
  • update_calendar_event - Modify existing events
  • delete_calendar_event - Remove events
  • find_free_time - Find available time slots
  • check_availability - Check if people are free
  • suggest_meeting_times - AI-powered meeting suggestions

Task Management

  • create_reminder - Create tasks and reminders
  • get_reminders - Retrieve tasks with filtering
  • update_reminder - Modify existing tasks
  • complete_reminder - Mark tasks as completed

Analytics & Insights

  • analyze_schedule_patterns - Understand scheduling habits
  • get_working_hours - Retrieve work schedule preferences
  • get_recent_similar_events - Find related events
  • get_contact_suggestions - Auto-suggest contacts

💬 Usage Examples

Creating Events

// AI Assistant can process:
"Schedule a dentist appointment next Tuesday at 2pm"
"Book a team meeting with John and Sarah for next week, 1 hour duration"
"Create a recurring weekly standup every Monday at 9am"

Finding Free Time

// AI Assistant can process:
"When are we all free next week for a 2-hour workshop?"
"Find time for a 30-minute call with the marketing team"
"What's my availability on Friday afternoon?"

Task Management

// AI Assistant can process:
"Remind me to call mom this weekend"
"Add a high-priority task to review the Q4 budget by Friday"
"Show me all my overdue tasks"

🔌 MCP Integration

With Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "calendar-assistant": {
      "command": "node",
      "args": ["/path/to/mcp-calendar-server/dist/index.js"],
      "env": {
        "DATABASE_URL": "postgresql://localhost:5432/calendar_assistant",
        "GOOGLE_CLIENT_ID": "your-client-id",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

With Custom Applications

import { CalendarMCPServer } from 'mcp-calendar-server';

const server = new CalendarMCPServer();
await server.start();

🐳 Docker Deployment

Using Docker Compose

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Start all services
docker-compose up -d

# Check logs
docker-compose logs -f mcp-calendar-server

Production Deployment

# Build production image
docker build -f docker/Dockerfile -t mcp-calendar-server .

# Run with external database
docker run -d \
  --name calendar-server \
  -p 3000:3000 \
  -e DATABASE_URL="postgresql://user:pass@host:5432/db" \
  -e REDIS_URL="redis://host:6379" \
  -e GOOGLE_CLIENT_ID="your-id" \
  -e GOOGLE_CLIENT_SECRET="your-secret" \
  mcp-calendar-server

🔒 Security

Authentication

  • JWT-based session management
  • OAuth 2.0 with Google Calendar
  • Secure token refresh handling
  • Session cleanup and expiration

Data Protection

  • Environment variable encryption
  • Database connection encryption
  • API rate limiting
  • Input validation and sanitization

Best Practices

  • Non-root container execution
  • Minimal attack surface
  • Regular security updates
  • Audit logging

📊 Monitoring

Health Checks

# Check server health
curl http://localhost:3000/health

# Check database connectivity
curl http://localhost:3000/health/db

# Check cache connectivity
curl http://localhost:3000/health/cache

Logging

Structured JSON logging with configurable levels:

  • Error tracking and alerting
  • Performance metrics
  • Security event logging
  • Debug information for development

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Install dependencies
npm install

# Run tests
npm test

# Run linter
npm run lint

# Format code
npm run format

# Start development server
npm run dev

🗺️ Roadmap

Phase 1 (Current)

  • ✅ Google Calendar integration
  • ✅ Basic CRUD operations
  • ✅ Free time finding
  • ✅ Task management
  • ✅ Caching layer

Phase 2 (In Progress)

  • 🔄 Outlook Calendar integration
  • 🔄 Advanced scheduling algorithms
  • 🔄 Natural language time parsing
  • 🔄 Webhook support for real-time updates

Phase 3 (Planned)

  • 📅 Apple Calendar integration
  • 📅 CalDAV support
  • 📅 Meeting room booking
  • 📅 Travel time integration
  • 📅 Smart conflict resolution

Phase 4 (Future)

  • 🔮 Machine learning insights
  • 🔮 Predictive scheduling
  • 🔮 Integration with other productivity tools
  • 🔮 Mobile app companion

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Support


Made with ❤️ for the MCP community

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选