Google Services MCP Server
Allows sending and drafting emails through Gmail, with support for recipients, subject, HTML body, and optional CC/BCC.
Allows appending content to Google Docs with optional formatting such as heading level, bold, and italic.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Google Services MCP Server
A Model Context Protocol (MCP) server that exposes Google services — specifically Gmail and Google Docs — as standardized tools for AI agents.
This allows MCP-compatible agents (like Claude Desktop, Cursor, or custom agents) to seamlessly send/draft emails and append content to Google Docs on your behalf.
Capabilities (Tools)
Tool | Description |
| Send an email to one or more recipients with subject, body (text/html), and optional CC/BCC. |
| Create a draft email in your Gmail account without sending it. |
| Append text content to the end of an existing Google Doc, with optional formatting (heading level, bold, italic). |
Related MCP server: MCP Google Workspace Server
Prerequisites
Node.js: Version 20 or higher.
Google Cloud Project: You need to set up a project and obtain OAuth 2.0 credentials.
🛠️ Google Cloud Setup Guide
Go to the Google Cloud Console.
Create a new project (e.g., "MCP Server").
Go to APIs & Services > Library.
Search for and enable the Gmail API.
Search for and enable the Google Docs API.
Go to APIs & Services > OAuth consent screen.
Choose External (or Internal if you have a Workspace).
Fill out the App Name, User support email, and Developer contact information.
Click Save and Continue.
Under Scopes, add:
https://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.composehttps://www.googleapis.com/auth/documents
Finish the consent screen setup.
Go to APIs & Services > Credentials.
Click Create Credentials > OAuth client ID.
Application type: Web application.
Name: "MCP Server Local".
Under Authorized redirect URIs, add exactly:
http://localhost:3000/oauth2callbackClick Create.
Note down your Client ID and Client Secret.
🚀 Installation & Authentication
Clone or copy this repository.
Install dependencies:
npm installCopy the environment template:
cp .env.example .envOpen
.envand fill in yourGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRET.Run the authentication script to obtain your refresh token:
npm run authenticateFollow the prompt in your browser to authorize the app. Once completed, the terminal will output a
GOOGLE_REFRESH_TOKEN.Add the
GOOGLE_REFRESH_TOKENto your.envfile.Build the server:
npm run build
🔌 Connecting to an MCP Client
Claude Desktop
Add the following to your claude_desktop_config.json (usually found at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"google-services": {
"command": "node",
"args": [
"/absolute/path/to/google-mcp-server/build/index.js"
],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id",
"GOOGLE_CLIENT_SECRET": "your_client_secret",
"GOOGLE_REFRESH_TOKEN": "your_refresh_token",
"GOOGLE_REDIRECT_URL": "http://localhost:3000/oauth2callback"
}
}
}
}Note: Replace /absolute/path/to/ with the actual path to this folder.
🔧 Architecture
This server is built using the MCP SDK v2. It uses the stdio transport to communicate with the host agent.
The architecture is designed to be highly modular. Adding a new Google service requires:
Creating a new folder in
src/tools/.Defining Zod schemas for inputs.
Implementing the Google API logic.
Calling the registration function in
src/tools/index.ts.
It includes built-in exponential backoff for rate limiting and structured error handling for a robust agent experience.
⚠️ Troubleshooting
Authentication Error / Missing Token: Make sure you ran
npm run authenticateand copied the refresh token into your.envfile or Claude config.Permission Denied (403): Ensure you added all 3 required scopes during the Google Cloud OAuth consent screen setup, and that the account you authenticated with has access to the target Google Doc.
Resource Not Found (404): Double check the
document_id. It should be the string between/d/and/editin the Google Docs URL.
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email for AI agents: send, receive with a safety verdict, reply and approve, as MCP tools.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to send emails, create drafts in Gmail, and append content to Google Docs via standardized MCP tools.34 npmISC
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to draft and send Gmail emails and append content to Google Docs through MCP tools.34 npmISC
- FlicenseNot gradedqualityCmaintenanceEnables MCP-compatible AI agents to draft and send Gmail emails and append content to Google Docs without needing to understand Google's APIs.-
- AlicenseAqualityCmaintenanceEnables AI agents to create and send Gmail messages and append content to Google Docs through the MCP protocol.334 npmISC