Google MCP Server
Allows creating email drafts in Gmail via the Gmail API.
Allows appending text to a Google Doc via the Google Docs API.
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 MCP ServerAppend 'Deadline extended' to the project 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 MCP Server
A FastAPI server that integrates with Google Docs and Gmail. Before each action runs, it prints the action and payload to the terminal and waits for your approval.
Features
Append to Google Doc — append text to any document you have access to
Create Gmail draft — create a draft email without sending it
OAuth 2.0 — credentials are saved locally after the first login
Approval gate — every request requires
yin the terminal before execution
Related MCP server: Google MCP Server
Project Structure
google-mcp-server/
├── server.py → FastAPI app with tool endpoints
├── auth.py → Google OAuth authentication
├── docs_tool.py → Google Docs tool (append content)
├── gmail_tool.py → Gmail tool (create draft)
├── requirements.txt → All dependencies
├── README.md → Setup and usage instructions
├── credentials.json → (NOT committed — downloaded from Google Cloud)
└── token.json → (NOT committed — auto-generated after OAuth)Prerequisites
Python 3.10+
A Google Cloud project with the Google Docs API and Gmail API enabled
Google Cloud Setup
Go to Google Cloud Console.
Create a project (or select an existing one).
Enable these APIs:
Go to APIs & Services → Credentials.
Click Create Credentials → OAuth client ID.
Choose Desktop app as the application type.
Download the JSON file and save it as
credentials.jsonin this directory.
Installation
cd google-mcp-server
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtFirst-Time Authentication
On the first API call (or when you run the server and trigger an endpoint), a browser window opens for Google sign-in. After you approve, a token.json file is created automatically. Subsequent runs reuse that token and skip the browser flow.
To re-authenticate, delete token.json and restart the server.
Running the Server
Run in the foreground so you can see approval prompts in the terminal:
python server.pyOr with uvicorn directly:
uvicorn server:app --host 0.0.0.0 --port 8000The server listens on http://localhost:8000. Interactive API docs are at http://localhost:8000/docs.
API Endpoints
POST /append_to_doc
Append text to a Google Doc.
Request body:
{
"doc_id": "YOUR_GOOGLE_DOC_ID",
"content": "Text to append at the end of the document.\n"
}The doc_id is the string between /d/ and /edit in the document URL:
https://docs.google.com/document/d/ABC123xyz/edit
^^^^^^^^^^
doc_idExample:
curl -X POST http://localhost:8000/append_to_doc \
-H "Content-Type: application/json" \
-d '{"doc_id": "ABC123xyz", "content": "Hello from the MCP server!\n"}'The terminal shows the action and payload, then prompts:
Action: append_to_doc
Payload: {'doc_id': 'ABC123xyz', 'content': 'Hello from the MCP server!\n'}
Approve? (y/n):Type y to proceed or anything else to reject (returns HTTP 403).
POST /create_email_draft
Create a Gmail draft.
Request body:
{
"to": "recipient@example.com",
"subject": "Draft subject line",
"body": "Plain-text body of the email."
}Example:
curl -X POST http://localhost:8000/create_email_draft \
-H "Content-Type: application/json" \
-d '{"to": "recipient@example.com", "subject": "Hello", "body": "This is a draft."}'Same approval prompt applies before the draft is created.
OAuth Scopes
Scope | Purpose |
| Read and edit Google Docs |
| Create and manage Gmail drafts |
Security Notes
Never commit
credentials.jsonortoken.json— both are listed in.gitignore.The approval prompt runs in the server terminal; keep the server in the foreground when testing.
Rejecting an action returns HTTP 403 with
"Action rejected by user".
Troubleshooting
Issue | Fix |
| Download OAuth credentials from Google Cloud and place the file in this directory. |
| Enable the Docs and Gmail APIs in your Google Cloud project. |
Token expired / invalid | Delete |
Doc not found | Confirm the doc ID and that the signed-in account has edit access. |
Approval prompt not visible | Run the server in a terminal (not as a background daemon). |
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/aayush13022/mcp-server-aayush'
If you have feedback or need assistance with the MCP directory API, please join our Discord server