mcp-google-gmail
A powerful Model Context Protocol (MCP) server providing comprehensive Gmail integration with LLM processing capabilities.
claude mcp add --transport stdio cablate-mcp-google-gmail npx -y @cablate/mcp-gmail \ --env GMAIL_CLIENT_ID="your_client_id" \ --env GMAIL_CLIENT_SECRET="your_client_secret" \ --env GMAIL_REFRESH_TOKEN="your_refresh_token"
How to use
The Gmail MCP server integrates Gmail into your Model Context Protocol (MCP) environment, enabling Large Language Models (LLMs) to read, search, and process Gmail messages with support for attachments and various content formats. Once the server is configured, you can start interacting with Gmail through the MCP layer, allowing your agents to fetch emails, filter results, and perform actions based on natural language requests. The server exposes capabilities to read emails, search by query, filter by labels or metadata, and handle attachments, making it useful for user support bots, CRM assistants, and productivity tools.
To use the server via Dive Desktop or directly through the CLI, install the MCP server and provide Gmail API credentials. With the CLI, you can run the server using the provided command (map-gmail) after installation. In Dive Desktop, add the Gmail MCP server by supplying the mcpServers configuration shown in the installation guide, which includes your OAuth credentials, ensuring the agent can access your Gmail data securely. The server will then respond to LLM-driven prompts by querying Gmail and returning structured results (emails, snippets, attachments) suitable for downstream processing.
How to install
Prerequisites:
- Node.js and npm installed on your system
- Access to npm and the ability to install global npm packages
Manual installation steps:
-
Install the MCP Gmail server globally using npm:
npm install -g @cablate/mcp-gmail -
Verify installation:
map-gmail --help -
Configure Gmail API credentials:
- Create a Google Cloud project and enable Gmail API
- Create OAuth 2.0 credentials and obtain client ID, client secret, and refresh token
- Export or provide these values in your MCP configuration (as shown in the usage example)
-
Run the MCP server variant you need (via CLI or via your MCP manager like Dive Desktop):
- CLI example (if a wrapper script is installed):
map-gmail - Dive Desktop or other MCP managers: add a server with the provided configuration, ensuring the env vars are supplied as in the example.
- CLI example (if a wrapper script is installed):
Additional notes
Tips and common issues:
- Ensure Gmail API credentials are valid and have the necessary scopes (e.g., https://www.googleapis.com/auth/gmail.readonly).
- When using Dive Desktop, keep credentials secure and avoid exposing them in logs or UI exports.
- If you rotate credentials, update the environment variables in your MCP configuration accordingly.
- The server supports reading, searching, and filtering emails; for large mailboxes consider pagination or incremental fetch strategies.
- If you encounter authentication errors, re-authenticate with a fresh access token or refresh token from the Google Cloud Console.
- For attachments, verify file size limits and MIME type handling based on your downstream processing requirements.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
mcp-google-map
A powerful Model Context Protocol (MCP) server providing comprehensive Google Maps API integration with LLM processing capabilities.
systemprompt-code-orchestrator
MCP server for orchestrating AI coding agents (Claude Code CLI & Gemini CLI). Features task management, process execution, Git integration, and dynamic resource discovery. Full TypeScript implementation with Docker support and Cloudflare Tunnel integration.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)
mcp -js
MCP server that exposes YepCode processes as callable tools for AI platforms. Securely connect AI assistants to your YepCode workflows, APIs, and automations.