Google Workspace MCP Server
Provides tools for composing and sending emails immediately, as well as saving email drafts for later review in Gmail.
Provides a tool for appending text to existing Google Documents.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Google Workspace MCP Server
An agent-agnostic Model Context Protocol (MCP) server that exposes Gmail and Google Docs as tools for any MCP-compliant AI agent (Claude, Gemini, GPT, or custom agents).
Tools Exposed
Tool | Description |
| Compose and immediately send an email |
| Save an email as a Gmail draft for human review |
| Append text to an existing Google Document |
Related MCP server: Generic Google Workspace MCP Server
Quick Start
1. Install dependencies
pip install -r requirements.txt2. Configure credentials
Copy .env.example to .env and fill in your Google OAuth 2.0 credentials:
cp .env.example .envGOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=your-long-lived-refresh-tokenHow to get credentials: Go to Google Cloud Console → APIs & Services → Credentials → Create OAuth 2.0 Client ID. Enable the Gmail API and Google Docs API. Then run the interactive login flow once to generate a refresh token (see §Auth below).
3. Run the server
stdio mode (default — for local agent integrations):
python -m src.serverSSE mode (for remote/HTTP agents):
MCP_TRANSPORT=sse python -m src.server
# Server starts on http://localhost:3000Authentication
The server loads Google OAuth 2.0 credentials in this priority order:
Environment variables —
GOOGLE_CLIENT_ID+GOOGLE_CLIENT_SECRET+GOOGLE_REFRESH_TOKEN(recommended for production)token.json— Cached token from a prior interactive login (auto-generated)credentials.json— Standard Google OAuth client secrets file → triggers interactive browser consent flow on first run
Getting a Refresh Token
If you don't have a refresh token yet, place your credentials.json in the project root and run:
python -m src.serverThe server will open a browser for the Google consent screen, then cache the token in token.json for future runs.
Project Structure
mcp-google-workspace/
├── src/
│ ├── server.py # Entry point
│ ├── config/config.py # Configuration manager
│ ├── auth/auth_manager.py # OAuth 2.0 credential management
│ ├── tools/
│ │ ├── registry.py # Tool registry
│ │ ├── gmail/
│ │ │ ├── send_email.py
│ │ │ └── draft_email.py
│ │ └── docs/
│ │ └── append_to_doc.py
│ ├── adapters/
│ │ ├── gmail_adapter.py
│ │ └── docs_adapter.py
│ └── errors/error_handler.py
├── .env.example
├── .gitignore
├── requirements.txt
└── pyproject.tomlConnecting to Claude Desktop
Add this to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"google-workspace": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/MCPserver"
}
}
}OAuth 2.0 Scopes Required
https://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.composehttps://www.googleapis.com/auth/documents
Security
Credentials are never logged or hardcoded
.env,credentials.json, andtoken.jsonare gitignoredMinimum required OAuth scopes only
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email and optional phone for AI agents: send, receive, search, draft and call over MCP.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send and draft Gmail emails and append content to Google Docs through standardized MCP tools.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI agents to create Gmail drafts, send emails, and append content to Google Docs with OAuth-secured authentication.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to draft and send Gmail emails and append content to Google Docs through MCP tools.MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI agents to draft and send Gmail emails and append content to Google Docs without needing to understand Google's APIs.-