G
Google Workspace MCP Server
作者 @devin95835
MCP server by devin95835
创建于 11/15/2025
更新于 30 days ago
README
Repository documentation and setup instructions
Google Workspace MCP Server
A production-quality Model Context Protocol (MCP) server providing comprehensive access to Google Workspace services. Built with FastMCP and the official Google API client libraries.
Services Supported
- 📧 Gmail - Send, read, reply, drafts, labels, threads
- 📅 Google Calendar - Events, scheduling, availability
- 📊 Google Sheets - Read, write, manage spreadsheets
- 📄 Google Docs - Create, read, update documents
- 📁 Google Drive - Upload, download, search, organize files
Features
- Native MCP Protocol - Works with Claude Desktop, Claude Code, and any MCP client
- Full OAuth Support - Secure authentication with Google
- Type-Safe - Pydantic models for all operations
- Async - Built on async/await for performance
- Comprehensive - 41 tools across 5 Google services
What's Included
✅ 41 Production-Ready Tools
- 📧 Gmail (9 tools): Send, read, reply, search, drafts, labels, threads
- 📅 Calendar (6 tools): Create events, manage meetings, free/busy queries
- 📊 Sheets (8 tools): Create, read, write, batch operations, metadata
- 📄 Docs (8 tools): Create, edit, format, find/replace, batch updates
- 📁 Drive (10 tools): Upload, download, search, share, organize files
Quick Start
1. Install
cd google-workspace-mcp-server
poetry install
2. Set Up Google OAuth
See SETUP.md for detailed instructions on:
- Creating a Google Cloud project
- Enabling required APIs
- Getting OAuth credentials
3. Configure
cp .env.example .env
# Edit .env with your Google credentials
4. Test
poetry run python test_server.py
Expected output:
✅ Successfully imported MCP server
✅ Found 41 registered tools
📧 Gmail: 9 tools
📧 Calendar: 6 tools
📧 Sheets: 8 tools
📧 Docs: 8 tools
📧 Drive: 10 tools
Configuration
Create a .env file:
# Google OAuth Credentials
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=http://localhost:8080
# Optional: Pre-authorized credentials
GOOGLE_CREDENTIALS_PATH=./credentials.json
Usage
Start the Server
poetry run python -m google_workspace_mcp
Use with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"google-workspace": {
"command": "poetry",
"args": ["run", "python", "-m", "google_workspace_mcp"],
"cwd": "/path/to/google-workspace-mcp-server"
}
}
}
Use with Claude Code
The server will be automatically discovered when running in the same project.
Available Tools
Gmail
gmail_send- Send an emailgmail_get- Get email by IDgmail_list- List emails with filtersgmail_search- Search emailsgmail_reply- Reply to an emailgmail_draft_create- Create a draftgmail_draft_send- Send a draftgmail_labels_list- List all labelsgmail_thread_get- Get email thread
Calendar
calendar_event_create- Create calendar eventcalendar_event_get- Get event detailscalendar_event_list- List upcoming eventscalendar_event_update- Update an eventcalendar_event_delete- Delete an event
Sheets
sheets_create- Create new spreadsheetsheets_read- Read sheet datasheets_write- Write to sheetsheets_append- Append rowssheets_update- Update cellssheets_clear- Clear range
Docs
docs_create- Create new documentdocs_get- Get document contentdocs_append- Append contentdocs_insert- Insert at positiondocs_replace- Find and replace
Drive
drive_upload- Upload filedrive_download- Download filedrive_search- Search for filesdrive_list- List files in folderdrive_move- Move filedrive_delete- Delete file
Documentation
- SETUP.md - Complete setup guide with Google Cloud configuration
- TOOLS.md - Comprehensive tool reference with examples
- README.md - This file, quick start and overview
Development
Built with:
- MCP Python SDK - Model Context Protocol
- Google API Python Client - Google Workspace APIs
- FastMCP - Simplified MCP server framework
Project Structure
google-workspace-mcp-server/
├── src/google_workspace_mcp/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Entry point
│ ├── auth.py # OAuth authentication manager
│ ├── server.py # FastMCP server setup
│ ├── gmail.py # Gmail tools (9)
│ ├── calendar.py # Calendar tools (6)
│ ├── sheets.py # Sheets tools (8)
│ ├── docs.py # Docs tools (8)
│ └── drive.py # Drive tools (10)
├── test_server.py # Structure verification test
├── pyproject.toml # Poetry dependencies
├── .env.example # Configuration template
├── README.md # This file
├── SETUP.md # Setup guide
└── TOOLS.md # Tool reference
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
MIT License - see LICENSE file for details
Acknowledgments
- Built with FastMCP
- Uses Google API Python Client
- Follows the Model Context Protocol specification
Support
快速设置
此服务器的安装指南
安装包 (如果需要)
uvx google-workspace-mcp-server
Cursor 配置 (mcp.json)
{
"mcpServers": {
"devin95835-google-workspace-mcp-server": {
"command": "uvx",
"args": [
"google-workspace-mcp-server"
]
}
}
}