google-workspace-mcp-server
Allows creating email drafts in Gmail, with interactive human approval before execution.
Allows appending formatted text to Google Docs, with interactive human approval before execution.
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-serverAppend the meeting notes to my Google 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 Workspace MCP-Style Server (Python)
This project provides an HTTP-based Model Context Protocol (MCP) style server built in Python using FastAPI. It exposes tools to safely append reports to Google Docs and create drafts in Gmail, requiring interactive human-in-the-loop terminal confirmation before any modifications are executed.
🛠️ Project Structure
google-mcp-server/
├── server.py → FastAPI app exposing endpoints with approval prompts
├── auth.py → Google API OAuth2 login & client token manager
├── docs_tool.py → Google Docs append operation logic
├── gmail_tool.py → Gmail draft creation logic
├── requirements.txt → Python package dependencies
├── README.md → Setup and execution instructions
├── credentials.json → (Not Committed) Downloaded OAuth credentials
└── token.json → (Not Committed) Authorized credentials tokenRelated MCP server: Google Docs & Gmail MCP Server
⚙️ Prerequisites & Setup
1. Python Environment
Ensure Python 3.9+ is installed. Create and activate a virtual environment:
# Create venv
python3 -m venv venv
# Activate venv (macOS/Linux)
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt2. Configure Google Cloud Credentials
To authorize access to Google Docs and Gmail APIs:
Go to the Google Cloud Console.
Create a project (or select an existing one).
Enable the Google Docs API and Gmail API under APIs & Services.
Go to APIs & Services > Credentials.
Click Create Credentials > OAuth client ID.
Set the Application Type to Desktop app.
Download the credentials JSON, rename it to
credentials.json, and place it in the root of thegoogle-mcp-serverdirectory.
🚀 Running the Server
Start the FastAPI server:
python server.pyFirst Run: A web page will automatically open in your browser prompting you to log into your Google Account and authorize access for Google Docs (modify) and Gmail (compose drafts) scopes. Once authenticated, a
token.jsonfile is written, and future runs execute silently.
The server runs locally at: http://localhost:8000
🔌 API Endpoints (Tools)
1. Append to Google Doc
Appends a formatted text block to the end of a Doc.
Endpoint:
POST /append_to_docContent-Type:
application/jsonRequest Body:
{ "doc_id": "your_google_doc_id_here", "content": "Verbatim text to append to the document body." }
2. Create Gmail Draft
Prepares a draft email in your mailbox.
Endpoint:
POST /create_email_draftContent-Type:
application/jsonRequest Body:
{ "to": "stakeholders@example.com", "subject": "Weekly review pulse teaser", "body": " Teaser summary and deep link to the Google Doc." }
🔒 Security & Interactive Approvals
For safety, the server implements an interactive human-in-the-loop gatekeeper.
When a POST request is sent to /append_to_doc or /create_email_draft, the FastAPI server will:
Print the pending action name and full payload details to the terminal console.
Wait/block for keyboard confirmation:
Approve action? (y/n):If
y: Executes the Google Workspace operation and returns a200 OKJSON response.If
nor invalid: Aborts the operation and returns a403 Forbiddenerror response.
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/work-samirk/mcp-server-google-workplace'
If you have feedback or need assistance with the MCP directory API, please join our Discord server