MCP Gmail Google Docs Integration
Enables sending emails with support for To, CC, BCC, subject, and body (plain text or HTML) via the Gmail API.
Allows appending plain text content to an existing Google Document using 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., "@MCP Gmail Google Docs Integrationsend an email to boss@company.com about the quarterly report"
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.
Generic MCP Server for Gmail and Google Docs Integration
A generic Model Context Protocol (MCP) server that exposes Google Workspace capabilities as MCP tools. The server enables AI agents to interact with Gmail and Google Docs.
Features
Gmail: Send emails (To, CC, BCC, Subject, Body). Supports Plain Text and HTML.
Google Docs: Append plain text to an existing Google Document.
Related MCP server: MCP Google Workspace Server
Prerequisites
Node.js 18+ (if running locally)
Docker (if running via container)
Google Cloud Console Project
Enable Gmail API
Enable Google Docs API
Configure OAuth Consent Screen (add yourself as a Test User)
Create OAuth 2.0 Client IDs (Application Type: Web Application or Desktop)
Add
http://localhost:3000/oauth2callbackas an Authorized redirect URI (if Web Application).
Local Setup & Generating the Refresh Token
To run this server (either locally or on a platform like Railway), you need an OAuth Refresh Token.
Clone the repository and install dependencies:
npm installCopy the example environment file:
cp .env.example .envOpen
.envand add yourGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET.Run the token generation script:
npm run generate-tokensFollow the prompt, log in with your Google account, and grant permissions.
The script will automatically save your tokens into a
tokens.jsonfile in the root of the project. This file is loaded by the server when it runs.
Deployment
If you deploy this to a cloud environment (like Railway or Docker):
You must ensure the
tokens.jsonfile you generated locally is available to the container.If you are uploading code directly, DO NOT commit
tokens.jsonto a public repository. If it's a private repository, you can commit it.If you want to change the file name, set the
TOKEN_STORAGE_PATHenvironment variable.
Deployment (Railway)
This repository is optimized for deployment on Railway.
Push this repository to GitHub.
In Railway, create a new project from your GitHub repository.
In the Railway project settings, go to Variables and add:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETTOKEN_STORAGE_PATH(if you want to override the default 'tokens.json')GOOGLE_REDIRECT_URI(optional, defaults tohttp://localhost:3000/oauth2callback)
Railway will automatically detect the
package.json, install dependencies, run thebuildscript, and execute thestartscript using Nixpacks.Alternatively, Railway can build from the provided
Dockerfileif you configure it to use Docker.
Connecting an MCP Client
Once deployed or running locally, you can connect an MCP Client (like Claude Desktop) to it.
If running locally:
{
"mcpServers": {
"gmail-gdoc": {
"command": "node",
"args": ["/path/to/your/project/dist/index.js"]
}
}
}If deployed, you will likely connect via an SSE or HTTP transport (if you modify the transport layer) or through a remote execution bridge, depending on your agent's capabilities. Note: The current implementation uses standard input/output (stdio), which is ideal for local agent execution. For remote cloud execution, consider switching the transport to SSE in src/server.ts.
Available Tools
send_email
to: string[]cc?: string[]bcc?: string[]subject: stringbody: stringisHtml?: boolean
append_to_google_doc
documentId: stringcontent: string
Available Tools
2 toolsappend_to_google_docA
Append plain text to a Google Document.
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | The text content to append. | |
| documentId | Yes | The ID of the Google Document (found in the URL). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must shoulder the burden. It only says 'append' without disclosing any behavioral traits such as permissions, error behavior, or whether formatting is supported. This is minimal transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that immediately conveys the tool's purpose with no unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with two parameters and no output schema, the description is functional but lacks details on return values, error handling, or constraints. It is minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with both parameters described. The description adds no extra meaning beyond the schema, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Append plain text to a Google Document,' with a specific verb and resource, and it naturally distinguishes from the sibling tool 'send_email' which performs a completely different function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no explicit guidance on when to use this tool versus alternatives. While the sibling tool is a different operation, no usage contexts or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_emailA
Send an email using Gmail.
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Array of email addresses to CC. | |
| to | Yes | Array of email addresses to send the email to. | |
| bcc | No | Array of email addresses to BCC. | |
| body | Yes | The body content of the email. | |
| isHtml | No | Whether the body is HTML. | |
| subject | Yes | Subject of the email. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description must carry burden. Only states action, no details on authentication, rate limits, side effects, or failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded, no wasted words. Efficient and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a simple tool but lacks context about authentication, attachments, or delivery confirmation. Could be improved with minimal additions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so schema already explains all parameters. Description adds no extra meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb ('Send') and resource ('email using Gmail'). Distinct from sibling tool 'append_to_google_doc'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or alternatives provided, but usage is implied due to common tool purpose. Sibling is different, so no confusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
append_to_google_doc - First observed
send_email
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: one appends to a Google Doc, the other sends an email via Gmail. There is no ambiguity or overlap.
Both tool names follow a consistent verb_noun pattern: 'append_to_google_doc' and 'send_email'. The naming is clear and predictable.
With only two tools for an integration involving two complex services, the tool count is too low. A typical integration would require 10-20 tools to cover basic operations.
The server lacks essential operations such as reading or listing Google Docs, creating documents, reading/searching emails, or managing drafts. The coverage is severely incomplete for the stated integration purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceAn MCP server that exposes Google Docs and Gmail capabilities to LLMs via SSE transport.-
- AlicenseBqualityCmaintenanceExposes Gmail (send/draft) and Google Docs (append) capabilities as tools for any MCP-compliant agent.347ISC
- AlicenseBqualityBmaintenanceA production-ready MCP server that bridges AI agents with Google Workspace (Gmail & Docs) to securely compose emails and edit documents via standardized tools.3MIT
- AlicenseAqualityBmaintenanceAn MCP-compliant server that exposes Gmail and Google Docs as tools, enabling AI agents to draft, send, and manage emails, as well as create, read, and append to documents through natural language.9MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/tusharikaT/MCP-gmail-gdoc'
If you have feedback or need assistance with the MCP directory API, please join our Discord server