Gmail, Calendar, and Maps MCP Server
Provides tools to list and search Gmail messages, read email content and metadata, and send emails on the user's behalf.
Provides tools to list upcoming calendar events and create new events with details such as time, location, description, and attendees.
Provides tools to get directions between locations, geocode addresses to coordinates, and find nearby places or points of interest.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Gmail, Calendar, and Maps MCP Server
A comprehensive MCP (Model Context Protocol) server that integrates Gmail, Google Calendar, and Google Maps functionality. This server provides tools for email management, calendar operations, and location-based services.
Features
π§ Gmail Integration
List recent emails with search queries
Send emails
Read email content and metadata
π Calendar Integration
List upcoming calendar events
Create new calendar events
Manage event details, locations, and attendees
πΊοΈ Maps Integration
Get directions between locations
Geocode addresses to coordinates
Find nearby places and points of interest
Related MCP server: Google Calendar MCP Server
Prerequisites
Python 3.8 or higher
Google Cloud Project with APIs enabled
Google OAuth 2.0 credentials
Google Maps API key
Setup Instructions
1. Install Dependencies
pip install -r requirements.txt2. Google API Setup
Step 1: Create Google Cloud Project
Go to Google Cloud Console
Create a new project or select an existing one
Enable the following APIs:
Gmail API
Google Calendar API
Maps JavaScript API
Directions API
Places API
Step 2: Create OAuth 2.0 Credentials
Go to "Credentials" section in Google Cloud Console
Click "Create Credentials" β "OAuth 2.0 Client IDs"
Choose "Desktop application"
Download the JSON file and rename it to
client_secrets.jsonPlace it in the project directory
Step 3: Get Google Maps API Key
In Google Cloud Console, go to "Credentials"
Click "Create Credentials" β "API Key"
Copy the API key for use in the server
3. Run Setup Script
python setup_google_apis.pyThis script will:
Guide you through OAuth authentication
Save credentials to
credentials.jsonHelp you set up environment variables
4. Configure MCP Client
Add the following to your MCP client configuration:
{
"mcpServers": {
"gmail-calendar-maps": {
"command": "python",
"args": ["server.py"],
"env": {
"GOOGLE_MAPS_API_KEY": "YOUR_GOOGLE_MAPS_API_KEY"
}
}
}
}Available Tools
Gmail Tools
list_gmail_messages_tool
List recent Gmail messages with optional search query.
Parameters:
query(string, optional): Search query (e.g., "from:example@gmail.com")max_results(integer, optional): Maximum number of messages to return (default: 10)
Example:
{
"name": "list_gmail_messages_tool",
"arguments": {
"query": "is:unread",
"max_results": 5
}
}send_gmail_message_tool
Send a Gmail message.
Parameters:
to(string, required): Recipient email addresssubject(string, required): Email subjectbody(string, required): Email body content
Example:
{
"name": "send_gmail_message_tool",
"arguments": {
"to": "recipient@example.com",
"subject": "Test Email",
"body": "This is a test email sent via MCP server."
}
}Calendar Tools
list_calendar_events_tool
List upcoming calendar events.
Parameters:
calendar_id(string, optional): Calendar ID (default: "primary")max_results(integer, optional): Maximum number of events to return (default: 10)
Example:
{
"name": "list_calendar_events_tool",
"arguments": {
"calendar_id": "primary",
"max_results": 5
}
}create_calendar_event_tool
Create a new calendar event.
Parameters:
summary(string, required): Event titlestart_time(string, required): Start time in ISO formatend_time(string, required): End time in ISO formatdescription(string, optional): Event descriptionlocation(string, optional): Event locationattendees(array, optional): List of attendee email addresses
Example:
{
"name": "create_calendar_event_tool",
"arguments": {
"summary": "Team Meeting",
"start_time": "2024-01-15T10:00:00Z",
"end_time": "2024-01-15T11:00:00Z",
"description": "Weekly team sync meeting",
"location": "Conference Room A",
"attendees": ["colleague@example.com"]
}
}Maps Tools
get_directions_tool
Get directions between two locations.
Parameters:
origin(string, required): Starting locationdestination(string, required): Destination locationmode(string, optional): Travel mode - "driving", "walking", "bicycling", "transit" (default: "driving")
Example:
{
"name": "get_directions_tool",
"arguments": {
"origin": "San Francisco, CA",
"destination": "Mountain View, CA",
"mode": "driving"
}
}geocode_address_tool
Convert address to coordinates.
Parameters:
address(string, required): Address to geocode
Example:
{
"name": "geocode_address_tool",
"arguments": {
"address": "1600 Amphitheatre Parkway, Mountain View, CA"
}
}find_nearby_places_tool
Find nearby places around a location.
Parameters:
location(string, required): Center locationradius(integer, optional): Search radius in meters (default: 5000)place_type(string, optional): Type of place to search for (e.g., "restaurant", "hotel")
Example:
{
"name": "find_nearby_places_tool",
"arguments": {
"location": "San Francisco, CA",
"radius": 1000,
"place_type": "restaurant"
}
}Usage Examples
Email Management
# List unread emails
await list_gmail_messages_tool({
"query": "is:unread",
"max_results": 10
})
# Send an email
await send_gmail_message_tool({
"to": "friend@example.com",
"subject": "Meeting Reminder",
"body": "Don't forget our meeting tomorrow at 2 PM!"
})Calendar Management
# List upcoming events
await list_calendar_events_tool({
"max_results": 5
})
# Create a new event
await create_calendar_event_tool({
"summary": "Doctor Appointment",
"start_time": "2024-01-20T14:00:00Z",
"end_time": "2024-01-20T15:00:00Z",
"location": "Medical Center",
"description": "Annual checkup"
})Location Services
# Get directions
await get_directions_tool({
"origin": "Home",
"destination": "Work",
"mode": "driving"
})
# Find nearby restaurants
await find_nearby_places_tool({
"location": "Downtown",
"radius": 2000,
"place_type": "restaurant"
})Error Handling
The server includes comprehensive error handling for:
API authentication failures
Network connectivity issues
Invalid input parameters
Rate limiting
API quota exceeded
All errors are returned with descriptive messages to help with debugging.
Security Considerations
Store API keys securely (use environment variables)
Never commit credentials to version control
Use OAuth 2.0 for user authentication
Implement proper access controls
Monitor API usage and quotas
Troubleshooting
Common Issues
Authentication Errors
Ensure
client_secrets.jsonis in the project directoryCheck that OAuth scopes are properly configured
Verify credentials haven't expired
API Key Issues
Ensure Google Maps API key is valid
Check that required APIs are enabled
Verify billing is set up for the project
Rate Limiting
Monitor API usage in Google Cloud Console
Implement exponential backoff for retries
Consider caching frequently accessed data
Debug Mode
Enable debug logging by setting the log level:
import logging
logging.basicConfig(level=logging.DEBUG)Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
Check the troubleshooting section
Review Google API documentation
Open an issue on GitHub
Changelog
v1.0.0
Initial release
Gmail integration (read/send)
Calendar integration (list/create events)
Maps integration (directions, geocoding, places)
OAuth 2.0 authentication
Comprehensive error handling
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Email, calendar and contacts for AI agents: Gmail, Microsoft 365 and IMAP accounts behind one API.
Routing, geocoding, places, matrix and map tools for location-aware AI workflows.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Calendar through OAuth 2.0 authentication. Supports listing, creating, and deleting calendar events with timezone handling and RFC3339 date formatting.-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Google Calendar through the Google Calendar API. Supports listing calendars, creating/deleting events, and retrieving calendar events with OAuth2 authentication.-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Calendar through OAuth2 authentication, supporting calendar and event management including creating, updating, deleting events with attendees, reminders, and search functionality.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive management of Google Calendar, Contacts, and Gmail through AI systems. Supports full CRUD operations including creating/updating/deleting events, managing contacts, sending emails, organizing with labels, and batch operations with OAuth2 authentication.107 npmMIT