Google Workspace MCP Server
A production-ready MCP server that bridges AI agents with Google Workspace (Gmail & Docs) to securely compose emails and edit documents via standardized tools.
README
title: Google Workspace MCP Server emoji: 📧 colorFrom: blue colorTo: green sdk: docker app_file: app.py pinned: false
Google Workspace Model Context Protocol (MCP) Server
A reusable, production-ready Model Context Protocol (MCP) Server that bridges AI agents with Google Workspace services (Gmail & Google Docs). By exposing standardized productivity tools, this server allows any MCP-compatible AI agent (such as Claude Desktop, IDE assistants, or autonomous workflows) to securely compose emails and edit documents without requiring hardcoded Google API logic.
Features & Capabilities
📧 Gmail Integration
send_email: Send emails immediately with validation forto,cc, andbcclists. Supports both plain text and HTML alternative body rendering.draft_email: Create drafts in your Gmail mailbox for subsequent manual review before sending.
📄 Google Docs Integration
append_content: Append plain text or formatted notes to the end of any Google Document. Supports Heading styles (HEADING_1,HEADING_2,HEADING_3), bulleted lists, numbered lists, bold text, and italic text.
🔐 Secure & Transparent Authentication
- Implements Google OAuth 2.0 with PKCE for enhanced desktop security.
- Automatically checks token expiration and performs silent background refreshes using stored refresh tokens without interrupting AI agent execution.
- AI agents are strictly isolated from raw tokens or client secrets.
Quickstart Guide
1. Requirements & Setup
Ensure you have Python 3.10+ installed. Create a virtual environment and install dependencies:
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
2. Configure OAuth Client Secrets
- Follow the step-by-step instructions in [docs/GCP_SETUP.md](file:///Users/vkg/Desktop/MCP%20Server/docs/GCP_SETUP.md) to enable Gmail and Docs APIs in Google Cloud Console.
- Download your Desktop App OAuth client secrets JSON file.
- Save the downloaded file to your project root or configure its path in your
.envfile:GOOGLE_CLIENT_SECRETS_FILE=client_secret_YOUR_ID.json TOKEN_STORAGE_PATH=token.json LOG_LEVEL=INFO
3. Authorize Your Google Account
Before running the MCP server, perform a one-time interactive login to generate your token.json:
workspace-auth
(This opens a browser window. Sign in with your Google account and grant permissions).
Connecting to AI Agents
Option A: Claude Desktop Configuration
To connect this MCP server to Claude Desktop, add the following entry to your claude_desktop_config.json (located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"google-workspace": {
"command": "/Users/vkg/Desktop/MCP Server/.venv/bin/workspace-mcp",
"args": ["--transport", "stdio"],
"cwd": "/Users/vkg/Desktop/MCP Server",
"env": {
"GOOGLE_CLIENT_SECRETS_FILE": "/Users/vkg/Desktop/MCP Server/client_secret_YOUR_ID.json",
"TOKEN_STORAGE_PATH": "/Users/vkg/Desktop/MCP Server/token.json"
}
}
}
}
Option B: Run via Server-Sent Events (SSE)
For network-based AI agents, launch the server in SSE mode:
workspace-mcp --transport sse --port 8000
Then connect your client to http://localhost:8000/sse.
Documentation Suite
- [Hugging Face Deployment Guide](file:///Users/vkg/Desktop/MCP%20Server/docs/HUGGINGFACE_DEPLOYMENT.md): Complete step-by-step tutorial for cloud container hosting on Hugging Face Spaces.
- [GCP Setup Guide](file:///Users/vkg/Desktop/MCP%20Server/docs/GCP_SETUP.md): Detailed step-by-step tutorial on creating GCP projects and credentials.
- [Configuration Guide](file:///Users/vkg/Desktop/MCP%20Server/docs/CONFIGURATION.md): Advanced environment variables, scopes, and multi-account readiness.
- [Troubleshooting Guide](file:///Users/vkg/Desktop/MCP%20Server/docs/TROUBLESHOOTING.md): Solutions for common OAuth errors, token expiration, and permission denials.
- [Problem Statement & Architecture](file:///Users/vkg/Desktop/MCP%20Server/ProblemStatement.md): Architectural specifications and tool schemas.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.