Google Workspace MCP Server
Provides tools for managing Gmail: listing, searching, reading, sending, replying to, drafting, trashing emails, and managing labels.
Provides tools for managing Google Docs: listing, reading, creating, updating, searching, sharing, exporting, and deleting documents.
Provides tools for interacting with Google Drive, enabling listing documents, sharing, and exporting in various formats.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Workspace MCP Servershow me my recent Google Docs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🔧 Google Workspace MCP Server
A complete Model Context Protocol (MCP) server in Python that integrates Gmail and Google Docs into any MCP-compatible AI host (Claude Desktop, Cursor, etc.).
✨ Features
Gmail Tools (10)
Tool | Description |
| List emails from any mailbox label |
| Fetch full email body (HTML → Markdown) |
| Search with Gmail query syntax |
| Compose and send a new email |
| Thread-aware reply |
| Save a draft without sending |
| Move to trash |
| List all Gmail labels with counts |
| Apply a label to a message |
| Remove a label from a message |
Google Docs Tools (8)
Tool | Description |
| List recent Google Docs |
| Fetch doc content as Markdown |
| Create a new doc (with optional content) |
| Append, prepend, or replace content |
| Full-text search across all docs |
| Share with reader/writer/owner role |
| Export as PDF, DOCX, TXT, HTML, ODT |
| Move to trash |
Resources (7)
URI | Description |
| Latest 20 inbox emails |
| Single email as Markdown |
| Full email thread |
| All Gmail labels |
| All accessible Google Docs |
| Full doc as Markdown |
| Doc title, owners, permissions |
Prompt Templates (6)
Prompt | Description |
| Summarise a thread (bullet, paragraph, exec summary) |
| Draft a context-aware reply |
| Review a doc (grammar, structure, clarity, tone) |
| Generate a full doc from a topic |
| Convert an email into a Google Doc |
| Create a digest of today's emails |
Related MCP server: Gmail Plugin MCP Server
🚀 Setup Guide
Step 1 — Create a Google Cloud Project
Go to Google Cloud Console
Click Select a project → New Project
Give it a name (e.g.
MCP Workspace) and click Create
Step 2 — Enable Required APIs
In the Cloud Console, go to APIs & Services → Library and enable:
✅ Gmail API
✅ Google Docs API
✅ Google Drive API
Step 3 — Create OAuth 2.0 Credentials
Go to APIs & Services → Credentials
Click Create Credentials → OAuth 2.0 Client ID
If prompted, configure the OAuth consent screen:
User Type: External (or Internal for Workspace orgs)
Add your email as a test user
Add these scopes:
https://www.googleapis.com/auth/gmail.modifyhttps://www.googleapis.com/auth/gmail.composehttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/documentshttps://www.googleapis.com/auth/drive
Application type: Desktop app
Click Create → Download JSON
Rename the downloaded file to
credentials.jsonand place it in theMCP-SERVERdirectory
Step 4 — Install Dependencies
cd "C:\Users\Lavanya gupta\OneDrive\Documents\Ghratika\MCP-SERVER"
pip install -r requirements.txtOr using a virtual environment (recommended):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txtStep 5 — Configure Environment Variables
Copy the example .env file and fill it in:
copy .env.example .envThe defaults work out of the box if credentials.json is in the project root.
Step 6 — Run the First-Time Auth Flow
python auth/google_auth.pyThis will:
Open your browser to the Google OAuth consent screen
Ask you to log in and grant permissions
Save a
token.jsonfile for future runs (no browser needed after this)
Step 7 — Test with MCP Inspector
mcp dev server.pyThis opens an interactive web UI where you can:
Browse all 18 tools, 7 resources, and 6 prompts
Call tools and see responses in real-time
Test authentication before connecting to Claude Desktop
🖥️ Claude Desktop Integration
Open Claude Desktop's config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Merge in the contents of
claude_desktop_config.jsonfrom this project:
{
"mcpServers": {
"google-workspace": {
"command": "python",
"args": [
"C:/Users/Lavanya gupta/OneDrive/Documents/Ghratika/MCP-SERVER/server.py"
],
"env": {
"GOOGLE_CREDENTIALS_PATH": "C:/Users/Lavanya gupta/OneDrive/Documents/Ghratika/MCP-SERVER/credentials.json",
"GOOGLE_TOKEN_PATH": "C:/Users/Lavanya gupta/OneDrive/Documents/Ghratika/MCP-SERVER/token.json",
"LOG_LEVEL": "INFO"
}
}
}
}Restart Claude Desktop — the Google Workspace tools will appear in the tools list.
Tip: If using a virtual environment, replace
"python"with the full path to your venv Python:"C:/Users/Lavanya gupta/OneDrive/Documents/Ghratika/MCP-SERVER/.venv/Scripts/python.exe"
🌐 SSE (Remote HTTP) Mode
To run the server as an HTTP endpoint (e.g. for Cursor or remote clients):
python server.py --sse --port 8000The server will be available at http://localhost:8000/sse.
📁 Project Structure
MCP-SERVER/
├── server.py ← Main entrypoint
├── credentials.json ← Your OAuth2 client credentials (DO NOT COMMIT)
├── token.json ← Auto-generated after first login (DO NOT COMMIT)
├── .env ← Your environment variables (DO NOT COMMIT)
├── .env.example ← Environment variable template
├── requirements.txt ← Python dependencies
├── claude_desktop_config.json ← Ready-to-paste Claude Desktop config
├── auth/
│ └── google_auth.py ← OAuth2 lifecycle manager
├── tools/
│ ├── gmail_tools.py ← Gmail MCP tools
│ └── docs_tools.py ← Google Docs MCP tools
├── resources/
│ ├── gmail_resources.py ← Gmail MCP resources
│ └── docs_resources.py ← Google Docs MCP resources
├── prompts/
│ └── google_prompts.py ← MCP prompt templates
└── utils/
├── html_to_text.py ← HTML → Markdown converter
└── docs_parser.py ← Google Docs JSON → Markdown parser🔒 Security Notes
⚠️ Never commit these files to version control:
credentials.json— your OAuth2 client secret
token.json— your personal access token
.env— your environment configuration
Add them to .gitignore:
credentials.json
token.json
.env🔧 Troubleshooting
"credentials.json not found"
Download it from Google Cloud Console → APIs & Services → Credentials.
"Access blocked: This app's request is invalid"
Make sure the OAuth consent screen is configured and your email is added as a test user.
"Token has been expired or revoked"
Delete token.json and run python auth/google_auth.py again.
"ModuleNotFoundError: No module named 'mcp'"
Install dependencies: pip install -r requirements.txt
Tools not appearing in Claude Desktop
Verify the path in
claude_desktop_config.jsonuses forward slashesCheck Claude Desktop logs at
%APPDATA%\Claude\logs\Make sure Python is in your PATH
📖 Example Workflows
Summarise unread emails
"Check my unread emails and give me a daily digest" → Uses
search_emails+daily_digestprompt
Draft and send a reply
"Reply to the latest email from john@example.com — say I'll be there" → Uses
search_emails+get_email+send_email
Create a document from an email
"Turn this email thread into a Google Doc summary" → Uses
get_email+create_document
Find and review a document
"Find my Q4 report document and review its structure" → Uses
search_documents+get_document+review_documentprompt
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ghratika/mcp-Server-Ghratika'
If you have feedback or need assistance with the MCP directory API, please join our Discord server