Google Docs + Gmail MCP Server
Allows creating Gmail drafts with specified recipients, subject, and body.
Allows appending structured content to Google Docs.
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 Docs + Gmail MCP ServerAppend the meeting summary to my project notes doc."
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 Docs + Gmail MCP Server
A lightweight MCP-style server that integrates with Google Docs and Gmail.
This project demonstrates how to build structured AI tool interfaces with approval gating, inspired by the Model Context Protocol (MCP).
โจ Features
๐ Append structured content to Google Docs
๐ง Create Gmail drafts
๐ OAuth-based Google authentication
๐ง MCP-style tool interface
โ Human-in-the-loop approval before execution
๐งฉ Modular and extensible design
How to Use in Your Project
Run the MCP server: uvicorn server:app --reload
Call tools via API: POST /append_to_doc POST /create_email_draft
Integrate with your AI workflow:
Generate content using LLM
Send output to these endpoints
๐ Project Structure
google-mcp-server/
โโโ server.py
โโโ auth.py
โโโ docs_tool.py
โโโ gmail_tool.py
โโโ requirements.txt
โโโ credentials.json (not committed)
โโโ token.json (not committed)
โโโ README.mdโ๏ธ Setup
1. Clone the repository
git clone <your-repo-url>
cd google-mcp-server2. Create virtual environment
python3 -m venv venv
source venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. ๐ Google API Setup
Go to Google Cloud Console
Create a new project
Enable:
Google Docs API
Gmail API
Configure OAuth Consent Screen
Create OAuth Credentials (Desktop App)
Download
credentials.jsonPlace it in project root
5. ๐ Run OAuth
python3 auth.pyOpens browser for login
Generates token.json
6. โถ๏ธ Run Server
uvicorn server:app --reloadOpen:
http://127.0.0.1:8000/docs๐งช How to Test
Append to Google Doc
Endpoint: POST /append_to_doc
Example:
{
"doc_id": "YOUR_DOC_ID",
"content": "Hello from MCP ๐"
}Create Email Draft
Endpoint: POST /create_email_draft
Example:
{
"to": "test@example.com",
"subject": "Test Draft",
"body": "This is a test email"
}๐ Workflow
Request โ Approval โ Tool Execution โ ResponseEvery action requires manual approval
Ensures safe and controlled execution
โ ๏ธ Important Notes
Do NOT commit:
credentials.json
token.json
Approval is CLI-based (terminal input) Designed for local development
โ ๏ธ Approval Flow
Every action requires manual approval in terminal:
ACTION: append_to_doc
PAYLOAD: {...}
Approve? (y/n):Type:
y๐ง MCP Design
This project demonstrates:
Structured tool calls
Separation of generation and execution
Human approval before tool execution
โ Notes
No emails are sent automatically (draft only)
Google Doc must have edit access
Token is stored locally
๐ License
Apache License
This server cannot be installed
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/kajolchawla98/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server