google-workspace-mcp
by: aaronsb
A Model Context Protocol (MCP) server that provides authenticated access to Google Workspace APIs, offering integrated Authentication, Gmail, Calendar, and Drive functionality
πOverview
Purpose: This framework allows users to seamlessly manage their Google Workspace account through a Model Context Protocol (MCP) server, enhancing productivity by simplifying interaction with services like Gmail, Calendar, and Drive.
Overview: The Google Workspace MCP Server provides a user-friendly interface to access and manage Google Workspace features. After a straightforward setup process, users gain enhanced control over their email, calendar, and files without dealing with cumbersome login protocols or manual organization.
Key Features:
-
Email Management: Automates sorting and labeling of emails, enables quick searches for specific messages, and simplifies attachment handling, making inbox management efficient and intuitive.
-
Calendar Optimization: Effectively schedules meetings by identifying open time slots, handles recurring events, and automates rescheduling, thereby reducing scheduling conflicts and improving time management.
-
Drive Organization: Transforms Google Drive into an organized workspace, allowing users to easily manage file sharing, search content within files, and streamline file storage across user accounts.
Google Workspace MCP Server
This Model Context Protocol (MCP) server allows you to manage your Google Workspace seamlessly. Once you connect your account, it maintains a safe connection while you focus on productivity.
Features
- Gmail Management: Quickly find emails, sort newsletters, track responses, and effortlessly handle attachments.
- Calendar Coordination: Avoid double bookings, find optimal time slots for meetings, and easily adjust schedules.
- Drive Organization: Keep your documents structured, share files with precision, and perform advanced searches.
TL;DR Setup
-
Create a Google Cloud Project:
- Go to the Google Cloud Console
- Enable Gmail, Calendar, and Drive APIs
- Configure the OAuth consent screen and create OAuth credentials.
-
Update Cline settings by adding the following to
cline_mcp_settings.json
:{ "mcpServers": { "google-workspace-mcp": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "/home/user/.mcp/google-workspace-mcp:/app/config", "-e", "GOOGLE_CLIENT_ID", "-e", "GOOGLE_CLIENT_SECRET", "-e", "LOG_MODE=strict", "ghcr.io/aaronsb/google-workspace-mcp:latest" ], "env": { "GOOGLE_CLIENT_ID": "your-client-id", "GOOGLE_CLIENT_SECRET": "your-client-secret" }, "disabled": false } } }
-
Restart Cline/Claude and ask the AI to "add my Google account" for authentication guidance.
Prerequisites
- Create a new project in Google Cloud Console.
- Enable Gmail, Calendar, and Drive APIs.
- Configure the OAuth consent screen and create OAuth 2.0 credentials (Desktop application).
- Copy the Client ID and Client Secret for later use.
File Management
The server organizes files automatically by creating directories for each Google account:
~/Documents/workspace-mcp-files/
βββ [email_1@domain.com]/
β βββ downloads/
β βββ uploads/
βββ shared/
βββ temp/
Manual Usage
For first-time setup, require an accounts.json
in your config directory.
You can run the container directly with:
docker run -i --rm \
-v ~/.mcp/google-workspace-mcp:/app/config \
-e GOOGLE_CLIENT_ID=your-client-id \
-e GOOGLE_CLIENT_SECRET=your-client-secret \
-e LOG_MODE=strict \
ghcr.io/aaronsb/google-workspace-mcp:latest
Available Tools
Account Management
- List Accounts: View configured Google accounts and their authentication status.
- Authenticate Account: Add and authenticate Google accounts.
- Remove Account: Disconnect accounts and clean credentials.
Gmail Operations
- Search Emails: Advanced filtering and search capabilities.
- Send Email: Send formatted emails with attachments and threading.
Calendar Operations
- List Events: Filter and list calendar events.
- Create Event: Schedule new events or set up recurring ones.
Drive Operations
- Manage Files: List, upload, download, and delete files; organize them into folders.
Best Practices
- Store credentials securely.
- Use minimal required API scopes.
- Regularly rotate tokens to maintain security.
Troubleshooting
Common Setup Issues
- Missing Configuration: Ensure
GOOGLE_CLIENT_ID
is set in your configuration file. - Authentication Errors: Verify Google Cloud project settings.
- Token Issues: Remove and re-authenticate accounts if needed.
For more help, consult the relevant documentation.
License
MIT License - See LICENSE file for details.