Unravel-Pranav/Calender-Gmail-MCP_Server
If you are the rightful owner of Calender-Gmail-MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project implements a Python-based MCP server that interfaces with Google Calendar and Gmail APIs, enabling advanced scheduling and email workflows.
Google Calendar & Gmail MCP Server (Python)
This project implements a Python-based MCP (Model Context Protocol) server that provides an interface between Large Language Models (LLMs) and the Google Calendar and Gmail APIs. It enables advanced scheduling, event management, and email workflows with seamless MCP integration.
📖 Documentation
- Getting Started:
- Architecture & Reference:
✨ Features
🔑 Authentication
- Secure OAuth 2.0 (Desktop App Flow) for Google APIs.
- Automatic token storage and refresh.
📅 Google Calendar
-
Core Actions
- List calendars →
mcp_google_calendar_list_calendars - Create calendars →
mcp_google_calendar_create_calendar - Find events (basic/advanced filters) →
mcp_google_calendar_find_events - Create detailed events →
mcp_google_calendar_create_event - Quick-add events from text →
mcp_google_calendar_quick_add_event - Update events →
mcp_google_calendar_update_event - Delete events →
mcp_google_calendar_delete_event - Add attendees →
mcp_google_calendar_add_attendee
- List calendars →
-
Advanced Scheduling & Analysis
- Check attendee response →
mcp_google_calendar_check_attendee_status - Query free/busy slots across calendars →
mcp_google_calendar_query_free_busy - Schedule mutual free slots automatically →
mcp_google_calendar_schedule_mutual - Analyze busyness (daily event counts & durations) →
mcp_google_calendar_analyze_busyness
- Check attendee response →
📧 Gmail
- List labels →
gmail_list_labels - Search/list messages with filters →
gmail_list_messages - Get messages in multiple formats →
gmail_get_message - Send email (simple or raw RFC 2822) →
gmail_compose_and_send,gmail_send_raw - Modify labels (add/remove) →
gmail_modify_labels
⚡ Server
- FastAPI-based REST API exposing Calendar & Gmail endpoints.
- MCP Integration: Provides tools via stdio using the
mcp_sdklibrary.
⚙️ Setup
1. Enable Google APIs
Enable the following in your Google Cloud Project:
- Google Calendar API
- Gmail API
2. Create OAuth Client
-
Create an OAuth 2.0 Client (Desktop App).
-
Add redirect URI:
http://localhost:8080/oauth2callback -
Configure consent screen and select required scopes.
3. Configure Environment
Copy example.env → .env and update with your credentials and scopes.
Recommended scopes:
GOOGLE_SCOPES='https://www.googleapis.com/auth/calendar, https://www.googleapis.com/auth/gmail.readonly, https://www.googleapis.com/auth/gmail.send, https://www.googleapis.com/auth/gmail.labels, https://www.googleapis.com/auth/gmail.modify'
4. Install & Run
pip install -r requirements.txt
python run_server.py
For a detailed walkthrough, see .
🌐 HTTP Endpoints
Calendar
GET /calendarsGET /calendars/{calendar_id}/eventsPOST /freeBusyPOST /schedule_mutual
Gmail
GET /gmail/labelsGET /gmail/messagesGET /gmail/messages/{message_id}POST /gmail/messages:sendRawPOST /gmail/messages:composeAndSendPOST /gmail/messages/{message_id}:modify
🛠️ MCP Tools
Calendar
list_calendarsfind_eventscreate_eventquick_add_eventupdate_eventdelete_eventadd_attendeecheck_attendee_statusquery_free_busyschedule_mutualanalyze_busyness
Gmail
gmail_list_labelsgmail_list_messagesgmail_get_messagegmail_compose_and_sendgmail_send_rawgmail_modify_labels
📌 Notes
- Works best with LLM-powered assistants for smart scheduling and email management.
- Supports MCP stdio integration for seamless AI workflows.