Gmail MCP logo

Gmail MCP

by @klodr

Scope-gated Gmail tools for reading, searching, sending, drafting, labeling, filtering, and managing threads.

Install Gmail MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "klodr-gmail-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@klodr/gmail-mcp"
      ],
      "env": {
        "GMAIL_MCP_RECIPIENT_PAIRING": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

@klodr/gmail-mcp connects MCP-enabled assistants to the Gmail v1 API through scope-gated tools. It supports messages, threads, labels, filters, drafts, attachments, replies, aliases, and batch operations, with installation through npx. In-process controls cover input sanitization, recipient pairing, rate limits, audit logging, and filesystem path jails. Reach for it when an agent needs Gmail access with narrower authorization and safeguards around outbound mail and downloaded content.

Use cases

  • Search Gmail messages from an MCP-enabled assistant
  • Draft and send replies with thread context
  • Manage labels and filters through agent tools
  • Download attachments into controlled filesystem paths
  • Restrict automated mail to paired recipients

Key features

  • Scope-gated Gmail API tools
  • Thread-aware replies and inbox operations
  • Send-as alias and recipient-pairing controls
  • Attachment and email export downloads
  • Path-jail and symlink-safe file handling
  • Batch Gmail operations with bounded inputs

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

6/6 checks healthy over the last 21d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5d ago via OSV.dev · @klodr/gmail-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars17Stargazers on the source repository.
npm downloads3kPackage downloads in the last 30 days.
Last commit4d agoMost recent push to the default branch.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Gmail MCP works

What @klodr/gmail-mcp does

@klodr/gmail-mcp exposes selected Gmail operations to MCP-compatible assistants. Its coverage includes reading and searching messages, creating and sending drafts, managing labels and filters, working with conversation threads, handling attachments, and replying to messages. The server wraps the Gmail v1 API rather than presenting an unrestricted raw API surface.

Authorization is scope-aware. A --scopes option supports least-privilege OAuth configuration, and the available tool list is filtered according to the scopes granted to the account. This makes the package suitable for deployments where read-only access and write access should be treated differently.

How it works

The package runs as an MCP server launched through npx, allowing an MCP-enabled assistant to call Gmail operations as tools. Thread-aware operations include get_thread, list_inbox_threads, and get_inbox_with_threads. Message operations account for reply threading, reply-all behavior, Cc and Bcc information, and Gmail send-as aliases.

Security checks are applied inside the server. Header input is sanitized, recipient pairing can restrict sends, replies, forwards, and drafts to approved addresses, and write caps apply across tool families over 24-hour and 30-day periods. Batch operations count individual messages rather than only counting tool calls.

Downloaded attachments and exported email files are constrained by path jails. Writes use symlink protections and destination revalidation. HTML exports block scripts, frames, forms, and remote resources unless explicitly allowed, and downloaded files receive internet-origin markers on supported operating systems.

Setup and configuration

Install and launch the package through the MCP client configuration using the npm package name:

Terminal
npx @klodr/gmail-mcp

OAuth configuration supports a --scopes flag for selecting the permissions requested. OAuth credential files are protected with restrictive file permissions, and a gcp-oauth.keys.json file in the project directory is used during authentication rather than automatically imported during ordinary startup. The authorization callback validates state and uses PKCE with S256.

Recipient pairing is optional. Set GMAIL_MCP_RECIPIENT_PAIRING to enable an allowlist for outbound recipients. Addresses can be added through the pairing command, npx @klodr/gmail-mcp pair add, or confirmed by a human in the MCP client; the model cannot expand the allowlist through Gmail tools.

Tools and capabilities

  • Read and search Gmail messages, including visible Cc and Bcc lines.
  • Send messages, create drafts, and send existing drafts.
  • Reply in a thread, use reply-all, and preserve reply headers such as In-Reply-To and References.
  • Select a permitted send-as alias for outgoing mail and replies.
  • Create, list, update, and delete labels and filters.
  • Refuse filters that would forward matching mail.
  • Retrieve threads and inboxes at thread level.
  • Download individual attachments or all attachments from a message, optionally as a ZIP.
  • Export email as JSON, EML, TXT, or HTML.
  • Apply batch modifications and deletions with retry handling.

Attachment downloads preserve original filenames. Batch inputs and result sizes are bounded, including limits on message ID lists, batch sizes, and maximum results.

Limitations and notes

The tool surface depends on the Gmail scopes granted during authorization, so granting fewer scopes also makes fewer operations available. Recipient pairing restricts outbound addresses but does not replace human approval for changing the allowlist. A from address must match an available Gmail send-as alias when the account’s alias list is readable and non-empty. Gmail remains the underlying service, so account permissions and Gmail API behavior determine what the agent can access or change.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gmail MCP

@klodr/gmail-mcp is an MCP server that connects AI assistants to the Gmail v1 API. Its main tools read, search, send, draft, label, filter, and manage Gmail messages and threads, with support for replies, attachments, downloads, aliases, and scope-based authorization.

Install and launch it with `npx @klodr/gmail-mcp` from your MCP client configuration. OAuth setup supports the `--scopes` option for choosing permissions, and the server uses a protected loopback callback with state validation and PKCE.

Yes, @klodr/gmail-mcp works with Cursor because Cursor is listed among its MCP-enabled assistant clients. Configure Cursor to launch the package through npx, then complete Gmail authorization with the scopes required by the tools you intend to use.

Set `GMAIL_MCP_RECIPIENT_PAIRING` to enable recipient pairing. Outbound sends, replies, forwards, and drafts are then limited to paired addresses, which can be added with `npx @klodr/gmail-mcp pair add` or confirmed by a human in the MCP client.

Yes, attachment and email downloads use source and destination path jails, symlink-safe writes, and bounded inputs. The server can download one attachment or all attachments from a message, optionally as a ZIP, and can export email as JSON, EML, TXT, or HTML.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGmail MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/klodr-gmail-mcp?style=directory)](https://allmcps.com/mcp/klodr-gmail-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/klodr-gmail-mcp"><img src="https://allmcps.com/api/badge/klodr-gmail-mcp?style=directory" alt="Gmail MCP on AllMCPs" /></a>