A Model Context Protocol (MCP) server that provides authenticated access to Google Workspace APIs, offering integrated Authentication, Gmail, Calendar, and Drive functionality
This Model Context Protocol (MCP) server puts you in control of your Google Workspace. Once you connect your account - a simple, secure process that takes just a minute - you're ready to go. Behind the scenes, it keeps your connection safe and active, so you can focus on getting things done instead of managing logins and permissions.
Take command of your Gmail inbox in ways you never thought possible. Want that proposal from last quarter? Found in seconds. Drowning in newsletters? They'll sort themselves into folders automatically. Need to track responses to an important thread? Labels and filters do the work for you. From drafting the perfect email to managing conversations with your team, everything just clicks into place. With streamlined attachment handling, you can easily find and manage email attachments while the system takes care of all the complex metadata behind the scenes.
Your calendar becomes a trusted ally in the daily juggle. No more double-booked meetings or timezone confusion. Planning a team sync? It spots the perfect time slots. Running a recurring workshop? Set it up once, and you're done. Even when plans change, finding new times that work for everyone is quick and painless. The days of endless "when are you free?" emails are over.
Turn Google Drive from a file dump into your digital command center. Every document finds its place, every folder tells a story. Share files with exactly the right people - no more "who can edit this?" confusion. Looking for that presentation from last week's meeting? Search not just names, but what's inside your files. Whether you're organizing a small project or managing a mountain of documents, everything stays right where you need it.
Note: For AI assistants like Cline, see llms-install.md for specialized installation guidance.
Create Google Cloud Project:
# Go to Google Cloud Console
https://console.cloud.google.com
→ Create Project
→ Enable Gmail API and Calendar API
→ Configure OAuth consent screen (External)
→ Create OAuth Desktop Client ID and Secret
Add to Cline settings (e.g., ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"google-workspace-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/home/aaron/.mcp/google-workspace-mcp:/app/config",
"-v", "/home/aaron/Documents/workspace-mcp-files:/app/workspace",
"-e", "GOOGLE_CLIENT_ID",
"-e", "GOOGLE_CLIENT_SECRET",
"-e", "LOG_MODE=strict",
"ghcr.io/aaronsb/google-workspace-mcp:latest"
],
"env": {
"GOOGLE_CLIENT_ID": "123456789012-abcdef3gh1jklmn2pqrs4uvw5xyz6789.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "GOCSPX-abcdefghijklmnopqrstuvwxyz1234"
},
"autoApprove": [],
"disabled": false
}
}
}
Logging modes:
normal
(default): Uses appropriate console methods for each log levelstrict
: Routes all non-JSON-RPC messages to stderr (recommended for Claude desktop)Restart Cline/Claude
Just ask the AI to "add my Google account" - it will guide you through the authentication process conversationally.
See detailed setup guide for more information.
Important:
Before starting the MCP server, you must create the config directory (e.g.,~/.mcp/google-workspace-mcp
) yourself, and ensure it is owned by your user account.
If this directory is missing or owned by root, the server will not be able to create or update configuration files and will fail to start.
Before using this MCP server, you must set up your own Google Cloud Project with access to Google Workspace APIs:
The MCP server requires:
~/.mcp/google-workspace-mcp
)Note: This server uses out-of-band (OOB) authentication flow, which means you'll need to manually copy-paste authorization codes during the initial setup of each account.
Add the following configuration to your Cline MCP settings:
{
"mcpServers": {
"google-workspace-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "/home/aaron/.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": "123456789012-abcdef3gh1jklmn2pqrs4uvw5xyz6789.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "GOCSPX-abcdefghijklmnopqrstuvwxyz1234"
},
"autoApprove": [],
"disabled": false
}
}
}
The server automatically manages files in a structured way:
~/Documents/workspace-mcp-files/
├── [[email protected]]/
│ ├── downloads/ # Files downloaded from Drive
│ └── uploads/ # Files staged for upload
├── [[email protected]]/
│ ├── downloads/
│ └── uploads/
└── shared/
└── temp/ # Temporary files (cleaned up automatically)
The WorkspaceManager creates and maintains this structure automatically:
You can customize the workspace location by setting the WORKSPACE_BASE_PATH
environment variable.
Important:
The config directory you mount (e.g.,~/.mcp/google-workspace-mcp
) must exist and be owned by your user before starting the container.
If it does not exist, create it withmkdir -p ~/.mcp/google-workspace-mcp && chown $USER ~/.mcp/google-workspace-mcp
.
The server will attempt to createaccounts.json
automatically if it is missing, but only if it has write access to the directory.
You can run the container directly:
docker run -i --rm \
-v ~/.mcp/google-workspace-mcp:/app/config \
-v ~/Documents/workspace-mcp-files:/app/workspace \
-e GOOGLE_CLIENT_ID=123456789012-abcdef3gh1jklmn2pqrs4uvw5xyz6789.apps.googleusercontent.com \
-e GOOGLE_CLIENT_SECRET=GOCSPX-abcdefghijklmnopqrstuvwxyz1234 \
-e LOG_MODE=strict \
ghcr.io/aaronsb/google-workspace-mcp:latest
The server will automatically:
For a fast, CI-like local build and Docker image creation, use the provided script:
# Run the local build pipeline (installs, lints, tests, builds, and creates Docker image)
./scripts/build-local.sh
google-workspace-mcp:local
.--verbose
:
./scripts/build-local.sh --verbose
./scripts/build-local.sh --tag my-custom-tag
/tmp/google-workspace-mcp/
for review.The build script uses Dockerfile.local
which is optimized for local development without platform-specific settings or BuildKit features. This ensures compatibility across different development environments.
You can also build and run the container manually:
# Build the image using the standard Dockerfile
docker build -t google-workspace-mcp:local .
# Or build using the local development Dockerfile (recommended for local development)
docker build -t google-workspace-mcp:local -f Dockerfile.local .
# Run with required environment variables
docker run -i --rm \
-v ~/.mcp/google-workspace-mcp:/app/config \
-v ~/Documents/workspace-mcp-files:/app/workspace \
-e GOOGLE_CLIENT_ID=123456789012-abcdef3gh1jklmn2pqrs4uvw5xyz6789.apps.googleusercontent.com \
-e GOOGLE_CLIENT_SECRET=GOCSPX-abcdefghijklmnopqrstuvwxyz1234 \
-e LOG_MODE=strict \
google-workspace-mcp:local
list_workspace_accounts
(aliases: list_accounts, get_accounts, show_accounts)
authenticate_workspace_account
(aliases: auth_account, add_account, connect_account)
remove_workspace_account
(aliases: delete_account, disconnect_account, remove_account)
search_workspace_emails
(aliases: search_emails, find_emails, query_emails)
send_workspace_email
(aliases: send_email, send_mail, create_email)
get_workspace_gmail_settings
(aliases: get_gmail_settings, gmail_settings, get_mail_settings)
manage_workspace_draft
(aliases: manage_draft, draft_operation, handle_draft)
manage_workspace_label
(aliases: manage_label, label_operation, handle_label)
manage_workspace_label_assignment
(aliases: assign_label, modify_message_labels, change_message_labels)
manage_workspace_label_filter
(aliases: manage_filter, handle_filter, filter_operation)
list_workspace_calendar_events
(aliases: list_events, get_events, show_events)
get_workspace_calendar_event
(aliases: get_event, view_event, show_event)
manage_workspace_calendar_event
(aliases: manage_event, update_event, respond_to_event)
create_workspace_calendar_event
(aliases: create_event, new_event, schedule_event)
delete_workspace_calendar_event
(aliases: delete_event, remove_event, cancel_event)
get_workspace_contacts
(aliases: get_contacts, list_contacts, fetch_contacts)
list_drive_files
(aliases: list_files, get_files, show_files)
search_drive_files
(aliases: search_files, find_files, query_files)
upload_drive_file
(aliases: upload_file, create_file, add_file)
download_drive_file
(aliases: download_file, get_file_content, fetch_file)
delete_drive_file
(aliases: delete_file, remove_file, trash_file)
create_drive_folder
(aliases: create_folder, new_folder, add_folder)
update_drive_permissions
(aliases: share_file, update_sharing, modify_permissions)
See API Documentation for detailed usage.
Simplified Mocking
Test Organization
Mock Management
File System Testing
Token Handling
# Run all tests
npm test
# Run specific test file
npm test path/to/test.ts
# Run tests with coverage
npm test -- --coverage
# CI builds run all tests with coverage reporting
npm run test:ci
Authentication
Error Handling
Configuration & Security
Local Development Setup
Missing Configuration
Authentication Errors
Token Issues
remove_workspace_account
and re-authenticateDirectory Structure
For additional help, consult the Error Handling documentation.
MIT License - See LICENSE file for details
No configuration available
This service may require manual configuration, please check the details on the left
Related projects feature coming soon
Will recommend related projects based on sub-categories