home / mcp / gmail mcp server

Gmail MCP Server

A powerful Model Context Protocol (MCP) server providing comprehensive Gmail integration with LLM processing capabilities.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "cablate-mcp-google-gmail": {
      "command": "npx",
      "args": [
        "-y",
        "@cablate/mcp-gmail"
      ],
      "env": {
        "GMAIL_CLIENT_ID": "your_client_id",
        "GMAIL_CLIENT_SECRET": "your_client_secret",
        "GMAIL_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

This Gmail MCP Server provides seamless Gmail integration for your MCP environment, enabling AI-powered workflows over email with capabilities to read, search, filter, and process messages and attachments. It is designed to run alongside your existing MCP client, letting you invoke Gmail-backed actions from your language model workflows.

How to use

You can run the Gmail MCP Server from the command line using the provided CLI tool or add it to your Dive Desktop setup for a graphical, server-based integration.

CLI usage: start by invoking the Gmail MCP CLI. This launches the server utilities that bridge Gmail data into your MCP environment, enabling your models to read and process emails. Use it as part of your automation pipelines or within your conversational agents.

With Dive Desktop: add a new MCP server and paste the following configuration to integrate Gmail as a local MCP server.

{
  "mcpServers": {
    "gmail": {
      "command": "npx",
      "args": ["-y", "@cablate/mcp-gmail"],
      "env": {
        "GMAIL_CLIENT_ID": "your_client_id",
        "GMAIL_CLIENT_SECRET": "your_client_secret",
        "GMAIL_REFRESH_TOKEN": "your_refresh_token"
      },
      "enabled": true
    }
  }
}

How to install

Prerequisites: you need Node.js and npm installed on your system. Node provides the runtime for the MCP server and the CLI tooling.

Step 1: Install the Gmail MCP server globally so you can access the CLI tools.

npm install -g @cablate/mcp-gmail

Step 2: Verify the CLI is available and run the Gmail MCP command to start the server locally.

map-gmail

Gmail API authentication setup

To enable Gmail access, you must configure Gmail API credentials (client ID, client secret, and a refresh token). Follow the Gmail API setup steps to generate these credentials, then supply them in the server configuration to authorize access to your Gmail account.

Notes and usage tips

This server focuses on email-oriented actions within your MCP workspace. Use it to extract and route information from messages, search your mailbox, filter results, and handle attachments as part of your AI-driven workflows.

License and contact

License: MIT. If you have questions or suggestions, you can reach out through the provided contact channels.

Available tools

read_emails

Read and search emails within Gmail, enabling you to retrieve message data based on queries or filters.

process_email_content

Process email content in various formats (text, HTML, attachments) for downstream AI processing.

filter_emails

Apply advanced filtering criteria to emails to narrow results for models and workflows.

handle_attachments

Manage email attachments, including extraction, processing, and routing to storage or downstream tasks.