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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。