gmail
A robust Model Context Protocol server for Gmail integration with intelligent authentication and comprehensive email operations
claude mcp add --transport stdio devdattatalele-gmail-mcp-server node /absolute/path/to/gmail-mcp-server/dist/index.js \ --env GCP_OAUTH_KEYS="~/.gmail-mcp/gcp-oauth.keys.json" \ --env GMAIL_MCP_CREDENTIALS="~/.gmail-mcp/credentials.json"
How to use
This Gmail MCP Server exposes a set of Gmail-enabled capabilities that you can drive from Claude Desktop or any MCP client. It handles authentication, token refresh, and a full suite of email operations directly against the Gmail API, without relying on external AI services for processing. You can send emails, draft messages, read and search emails, manage labels, and perform batch operations including attachments handling. The server is built in TypeScript and ships with robust error handling to help you recover from common auth or API issues. To connect, configure Claude Desktop (or your MCP client) to point at the local Node.js server entry point, then invoke the available tools to perform actions against your Gmail inbox.
How to install
Prerequisites:
- Node.js 16+ installed on your machine
- npm (comes with Node.js)
- A Google Cloud Platform project with Gmail API enabled and OAuth credentials configured as described in the Quick Start
Installation steps:
- Clone the repository and install dependencies
git clone https://github.com/devdattatalele/gmail-mcp-server.git
cd gmail-mcp-server
npm install
- Build the TypeScript project
npm run build
- Run the server (example)
node dist/index.js
- If you want to install as a global package (optional)
npm install -g @devdattatalele/gmail-mcp-server
- Start authentication flow when needed (see Quick Start for details)
node dist/index.js auth
Configure Claude Desktop to point to the server as described in the Quick Start section.
Additional notes
Tips and notes:
- Ensure your OAuth credentials JSON is placed as ~/.gmail-mcp/gcp-oauth.keys.json and that the server can read it.
- The server stores tokens and refreshed credentials in ~/.gmail-mcp/credentials.json; keep this directory secure.
- When configuring Claude Desktop, use the absolute path to the compiled dist/index.js file.
- If you encounter authentication errors, re-run the auth command with --force to re-authenticate and refresh tokens.
- For large attachments or batch operations, be mindful of Gmail API rate limits and the server’s retry behavior.
- The npm package name for this server is @devdattatalele/gmail-mcp-server; use the exact package name if installing globally or referencing in scripts.
Related MCP Servers
Pare
Dev tools, optimized for agents. Structured, token-efficient MCP servers for git, test runners, npm, Docker, and more.
python-notebook
Lightweight Python Notebook MCP - Enable AI assistants to create, edit, and view Jupyter notebooks via Model Context Protocol
mcp-tidy
CLI tool to visualize and manage MCP server configurations in Claude Code. List servers, analyze usage statistics, and clean up unused servers
mcpman
The package manager for MCP servers — install, manage & monitor across Claude Desktop, Cursor, VS Code, Windsurf
localdata
A dynamic MCP server for local databases and text files with enhanced security and query buffering capabilities
mcp-grafana
MCP (Model Context Protocol) server for Grafana - TypeScript/npm implementation with 43+ tools for dashboards, alerts, incidents, and observability