Google Docs & Gmail MCP Server
Allows creating Gmail drafts and listing recent drafts.
Allows creating, reading, appending text, and inserting at placeholders in Google Docs documents.
Allows searching for Google Docs by name in Google Drive.
Click on "Deploy 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 Server Create a new Google Doc titled 'Weekly Summary' and paste the meeting notes."
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
An MCP (Model Context Protocol) server that enables AI agents (e.g., Claude Desktop) to interact with Google Docs and Gmail — creating documents, appending content, replacing placeholders, and drafting emails.
Project Structure
MCP/
├── src/
│ ├── index.ts # MCP server entry point (all tool handlers)
│ ├── auth.ts # One-time OAuth 2.0 token generation script
│ ├── googleClient.ts # Centralized authenticated Google API clients
│ └── tools/
│ ├── docsTools.ts # Google Docs & Drive tool implementations
│ └── gmailTools.ts # Gmail draft tool implementations
├── credentials.json # ← You must download this from Google Cloud Console
├── token.json # ← Generated automatically by: npm run auth
├── claude_desktop_config.json # Claude Desktop MCP server configuration
├── package.json
├── tsconfig.json
├── .env.example
└── .gitignoreRelated MCP server: Google Workspace MCP Server
Getting Started
Prerequisites
Node.js v18+
A Google account with access to Google Workspace (Docs + Gmail)
Step 1: Google Cloud Console Setup
Create a new project (e.g.,
MCP-Server)Enable the following APIs:
Google Docs API
Google Drive API
Gmail API
Go to APIs & Services → Credentials
Click Create Credentials → OAuth 2.0 Client ID
Application Type: Desktop App
Name:
MCP Server
Download the JSON file and rename it to
credentials.jsonPlace
credentials.jsonin the project root:C:\Users\Vaibhav Singh\Desktop\MCP\
Step 2: Authorize the Application (one-time)
powershell -ExecutionPolicy Bypass -Command "npm run auth"This will:
Print a Google authorization URL
You open the URL, log in, and paste the authorization code back
token.jsonis saved automatically
Step 3: Test the MCP Server
# Start the server directly
powershell -ExecutionPolicy Bypass -Command "npm run dev"
# Or launch the MCP Inspector UI for testing
powershell -ExecutionPolicy Bypass -Command "npm run inspect"Step 4: Connect to Claude Desktop (Phase 5)
Copy the contents of claude_desktop_config.json into your Claude Desktop configuration file, located at:
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Then restart Claude Desktop. You should see 7 tools available from this MCP server.
Available Tools
Tool | Description |
| Creates a new Google Doc and returns ID + URL |
| Searches Google Drive for Docs by name |
| Appends text to the end of a document |
| Replaces |
| Returns the full text content of a document |
| Creates a Gmail draft email (To, Subject, Body, CC) |
| Lists recent Gmail drafts |
Example Prompts for Claude
"Create a new Google Doc titled 'Q3 Report' and append a summary of our meeting."
"Search for a document called 'Meeting Notes' and append today's agenda."
"Create a Gmail draft to john@example.com with subject 'Project Update' and a professional body."
"Find the document 'Email Log' and replace the placeholder
{{latest_draft}}with the email I just dictated."
Available Tools
7 toolsappend_textB
Appends text content to the end of an existing Google Document.
Inputs: text (required), document_id (required).
create_documentA
Creates a new Google Doc with the given title. Returns the document ID, title, and URL.
Inputs: title (required).
create_gmail_draftA
Creates a Gmail draft email ready for review and sending. Returns the draft ID and a preview URL.
Inputs: to (required), body (required), subject (required), cc.
insert_at_placeholderA
Replaces every occurrence of a placeholder string (e.g. {{email_draft}}) in an existing Google Document with the provided text.
Inputs: text (required), document_id (required), placeholder (required).
list_gmail_draftsA
Lists the most recent Gmail drafts in the authenticated user's account.
Inputs: max_results.
read_documentA
Reads and returns the plain-text content of an existing Google Document.
Inputs: document_id (required).
search_documentsA
Searches the authenticated user's Google Drive for documents whose name contains the query string. Returns a list of matching files with ID, name, URL, and last modified time.
Inputs: query (required), max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
All tools have clear, distinct purposes. Google Docs tools (create, read, append, insert at placeholder, search) and Gmail tools (create draft, list drafts) are easily distinguishable with no overlap.
All tool names follow a consistent verb_noun pattern in snake_case, e.g., create_document, list_gmail_drafts. Naming is predictable and clear.
7 tools is well-scoped for covering core operations of two services. Each tool earns its place without being excessive or insufficient.
Missing key operations like sending a Gmail draft and deleting a document. While the set covers basic CRUD for Docs and draft creation for Gmail, the lack of send creates a workflow gap.
Related MCP Connectors
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Connect an AI assistant to your Google Sheets, Drive, Docs, PDFs, BigQuery and Gmail.
Gmail, Outlook, Drive, OneDrive and calendars for AI agents. Many accounts, one endpoint, audit log.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to create Gmail drafts and append content to Google Docs, supporting automated review analysis and notification workflows.528 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely interact with Google Workspace services, including sending emails via Gmail and appending content to Google Docs.547 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send emails via Gmail and append content to Google Docs.547 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI agents to create drafts and send emails in Gmail, and append text to existing Google Docs documents.ISC