Google Workspace MCP Server
Provides unified access to Google Workspace APIs including Gmail, Drive, Sheets, Calendar, Docs, Forms, and Chat through a single interface, enabling email management, file operations, spreadsheet editing, event scheduling, and more via natural language.
README
Google Workspace MCP Server
Comprehensive Model Context Protocol (MCP) server providing unified access to all major Google Workspace APIs through a single interface.
Features
Supported Google Services
- Gmail: Read, send, search emails, manage labels
- Google Drive: List, create, delete, share files and folders
- Google Sheets: Create, read, update spreadsheets
- Google Calendar: Manage events and calendars
- Google Docs: Create and edit documents
- Google Forms: Create forms, add questions, read responses
- Google Chat: Send messages and manage spaces
Key Capabilities
- Unified Authentication: Single OAuth 2.0 flow for all services
- Comprehensive API Coverage: 25+ tools across 7 Google services
- Docker-Based: Easy deployment with credential persistence
- Production-Ready: Secure credential handling and error management
Quick Start
Prerequisites
-
Google Cloud Project with enabled APIs:
- Gmail API
- Google Drive API
- Google Sheets API
- Google Calendar API
- Google Docs API
- Google Forms API
- Google Chat API
-
OAuth 2.0 Credentials:
- Go to Google Cloud Console
- Create OAuth 2.0 Client ID (Desktop application)
- Download the JSON file
Installation via Docker
# Pull the image
docker pull pauljeyasinghph/google-workspace-mcp:latest
# Run the container
docker run -i --rm \
-v $(pwd)/credentials:/data/credentials \
-v $(pwd)/client_secret.json:/data/credentials/client_secret.json:ro \
pauljeyasinghph/google-workspace-mcp:latest
Configuration in Claude Desktop
Add to ~/.config/claude/config.json:
{
"mcpServers": {
"google-workspace": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/path/to/credentials:/data/credentials",
"-v",
"/path/to/client_secret.json:/data/credentials/client_secret.json:ro",
"pauljeyasinghph/google-workspace-mcp:latest"
]
}
}
}
Available Tools
Gmail Tools
gmail_list_messages- List emails with filtersgmail_get_message- Get specific emailgmail_send_message- Send emailgmail_search_messages- Search emails
Google Chat Tools
chat_list_spaces- List Chat spaceschat_send_message- Send message to spacechat_list_messages- List messages in space
Google Sheets Tools
sheets_create_spreadsheet- Create new spreadsheetsheets_get_values- Read cell valuessheets_update_values- Update cellssheets_append_values- Append rows
Google Drive Tools
drive_list_files- List files/foldersdrive_create_folder- Create folderdrive_delete_file- Delete filedrive_share_file- Share with users
Google Forms Tools
forms_create_form- Create new formforms_add_question- Add questionforms_get_responses- Get form responses
Google Calendar Tools
calendar_list_events- List eventscalendar_create_event- Create eventcalendar_delete_event- Delete event
Google Docs Tools
docs_create_document- Create documentdocs_get_document- Get document contentdocs_insert_text- Insert textdocs_append_text- Append text
Authentication Flow
- First Run: Opens browser for OAuth consent
- Token Storage: Saves tokens to mounted volume
- Auto-Refresh: Automatically refreshes expired tokens
- Persistent: Tokens survive container restarts
Security Best Practices
- Never commit credentials to version control
- Use read-only mounts for client_secret.json
- Restrict OAuth scopes to minimum required
- Rotate credentials periodically
- Monitor API usage in Google Cloud Console
Building from Source
# Clone the repository
git clone https://github.com/PaulJeyasinghph/google-workspace-mcp.git
cd google-workspace-mcp
# Build the Docker image
docker build -t google-workspace-mcp .
# Run locally
docker run -i --rm \
-v $(pwd)/credentials:/data/credentials \
-v $(pwd)/client_secret.json:/data/credentials/client_secret.json:ro \
google-workspace-mcp
Usage Examples
Send an Email
{
"tool": "gmail_send_message",
"arguments": {
"to": "example@gmail.com",
"subject": "Test Email",
"body": "This is a test email sent via MCP."
}
}
Create a Spreadsheet
{
"tool": "sheets_create_spreadsheet",
"arguments": {
"title": "Q1 Budget",
"sheet_names": ["Revenue", "Expenses"]
}
}
Schedule a Meeting
{
"tool": "calendar_create_event",
"arguments": {
"summary": "Team Sync",
"start_time": "2024-03-20T10:00:00Z",
"end_time": "2024-03-20T11:00:00Z",
"attendees": ["team@example.com"]
}
}
Troubleshooting
Authentication Errors
- Verify all required APIs are enabled
- Check OAuth consent screen configuration
- Ensure credentials file is properly mounted
Permission Denied
- Confirm OAuth scopes in credentials
- Check Google Workspace admin settings
- Verify user has necessary permissions
Container Issues
- Check volume mount paths
- Verify credentials directory permissions
- Review Docker logs for errors
Development
Project Structure
google-workspace-mcp/
├── src/
│ ├── server.py # Main MCP server
│ ├── auth.py # OAuth handler
│ ├── gmail.py # Gmail tools
│ ├── chat.py # Chat tools
│ ├── sheets.py # Sheets tools
│ ├── drive.py # Drive tools
│ ├── forms.py # Forms tools
│ ├── calendar.py # Calendar tools
│ └── docs.py # Docs tools
├── Dockerfile # Multi-stage build
├── requirements.txt # Python dependencies
├── server.yaml # Docker registry config
├── tools.json # Tool definitions
└── README.md # This file
Running Tests
# Install dev dependencies
pip install -r requirements.txt pytest
# Run tests
pytest tests/
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Google Workspace APIs
Acknowledgments
- Built with Model Context Protocol
- Powered by Google Workspace APIs
- Inspired by the MCP community
Roadmap
- [ ] Add Google Meet integration
- [ ] Support service account authentication
- [ ] Add batch operation support
- [ ] Implement webhook listeners
- [ ] Add Google Admin SDK tools
- [ ] Support Google Workspace for Education
Made with ❤️ for the MCP community
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.