Google Workspace MCP Server
Integrates with Google Workspace to create Google Docs and draft Gmail emails through the Model Context Protocol, enabling AI agents to manage documents and emails securely.
README
Google Workspace MCP Server
This repository contains a Model Context Protocol (MCP) server that integrates with Google Workspace to automatically create Google Docs and draft emails in Gmail.
The server is built using Python, Starlette, and Server-Sent Events (SSE) to allow AI agents (such as custom Orchestrators or Claude Desktop) to connect remotely and execute tools securely.
Prerequisites
- Python 3.10+
- A Google Cloud Platform (GCP) project with the following APIs enabled:
- Google Docs API
- Google Drive API
- Gmail API
- An OAuth 2.0 Client ID (Desktop App) from the GCP Console, saved as
credentials.json.
Quick Start (Local Setup)
- Clone this repository.
- Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # Or .\venv\Scripts\activate on Windows pip install -r requirements.txt - Copy
.env.exampleto.envand configure your settings. - Place your downloaded
credentials.jsonin the root folder. - Generate the
token.jsonlocally by running:
Follow the link provided in the console to log in to Google and authorize the application.python generate_token.py - Run the server locally:
The server will start onpython src/main.pyhttp://0.0.0.0:8000. Your SSE endpoint will be available athttp://localhost:8000/sse.
Deploying to Railway
This server is configured to run effortlessly on Railway.
Because Railway containers are ephemeral (their file systems reset on every deployment), you must securely provide your token.json so the server remains authenticated with Google.
Deployment Steps:
- Push to GitHub: Push this repository to your GitHub account.
- Create Railway Project: Log into Railway, click "New Project", and deploy from your GitHub repo.
- Environment Variables: Add the variables from your
.envfile into the Railway dashboard. - Persistent Volume (Important):
- Go to your Railway service settings.
- Attach a new Volume to the service.
- Mount the volume at a path like
/data. - Update your Railway environment variable
TOKEN_PATHto/data/token.json.
- Upload the Token:
- Railway doesn't easily allow direct file uploads to volumes. Instead, you can encode your
token.jsonas a base64 string, store it in an environment variable, and update your startup command in Railway to decode it into the volume before starting the server. - Alternatively, you can use a database for token storage in the future.
- Railway doesn't easily allow direct file uploads to volumes. Instead, you can encode your
Tools Provided
create_doc(title: string, content: string): Creates a Google Doc and inserts the given markdown/text.draft_email(to: string[], subject: string, body: string): Drafts an email securely in the authenticated user's outbox.
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.
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.
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.
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.