Gmail & Google Docs MCP Server
Enables AI agents to send Gmail emails, create drafts, and append content to Google Docs through MCP tools. Provides secure OAuth-based integration with Google Workspace.
README
Generic MCP Server for Gmail & Google Docs Integration
A standalone Model Context Protocol (MCP) server that exposes Gmail and Google Docs actions as reusable tools. This allows any MCP-compatible AI agent (Claude, LangGraph, etc.) to securely interact with your Google Workspace.
Features
gmail_send_email: Send an email immediately on behalf of the user.gmail_create_draft: Create an email draft without sending it.gdocs_append_content: Append text to an existing Google Doc.
Setup Instructions
1. Google Cloud Project Setup
- Go to the Google Cloud Console.
- Create a new project.
- Enable the following APIs:
- Gmail API
- Google Docs API
- Go to APIs & Services > OAuth consent screen and configure it for "Desktop app" or "Web application".
- You can leave it in "Testing" mode and add your own email as a Test User.
- Go to Credentials > Create Credentials > OAuth client ID.
- Download the
credentials.jsonor copy theClient IDandClient Secret.
2. Environment Variables
Create a .env file in the root directory (you can copy .env.example):
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:3000/oauth2callback
GOOGLE_REFRESH_TOKEN=your_refresh_token
3. Acquiring a Refresh Token
To use this server, you must provide a GOOGLE_REFRESH_TOKEN. You can obtain one by running the OAuth consent flow locally. You can build a small script using generateAuthUrl from src/auth/googleAuth.ts and visiting the generated URL to get the token, or you can use Google OAuth Playground.
4. Build and Run
- Install dependencies:
npm install - Build the project:
npm run build - Run the server (Stdio mode):
npm start
Connecting to an MCP Client
Cursor / Claude Desktop
Add the following to your MCP client configuration (e.g., in Claude Desktop's mcp.json or Cursor's settings):
{
"mcpServers": {
"gmail-docs-mcp": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/build/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "...",
"GOOGLE_CLIENT_SECRET": "...",
"GOOGLE_REDIRECT_URI": "http://localhost:3000/oauth2callback",
"GOOGLE_REFRESH_TOKEN": "..."
}
}
}
}
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.