Gmail MCP logo

Gmail MCP

by @klodr

Scope-gated Gmail tools for reading, searching, sending, drafting, threading, labeling, filtering, and downloading email.

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"
      ]
    }
  }
}

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

Claude Code command
claude mcp add --transport stdio klodr-gmail-mcp -- npx -y @klodr/gmail-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

The install command started, but didn't respond the way we expected when we tried to talk to it.

npx -y @klodr/gmail-mcp

initialize succeeded but no response to tools/list.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

@klodr/gmail-mcp connects MCP-enabled assistants to the Gmail v1 API through a single npx-installed server. It exposes scope-aware tools for messages, threads, labels, filters, drafts, replies, aliases, and attachments, while filtering the available tools according to granted OAuth scopes. In-process controls cover recipient pairing, input sanitization, rate limits, audit logging, path jails, and safer file handling. Reach for it when an agent needs to manage Gmail while keeping authorization and outbound-mail behavior constrained.

Use cases

  • Search Gmail messages and summarize relevant correspondence
  • Draft and send replies within existing threads
  • Organize mail with labels, filters, and batch operations
  • Download messages or attachments for local processing

Key features

  • Scope-gated Gmail OAuth tools
  • Thread-aware replies, forwards, and send-as aliases
  • Recipient pairing and write-rate limits
  • Attachment and email downloads with path jails
  • Label, filter, draft, and batch message operations
  • Input sanitization and audit logging

Security & health

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

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 50d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

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

Adoption & maintenance

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

GitHub stars19Stargazers on the source repository.
npm downloads2.9kPackage downloads in the last 30 days.
Last commit5d agoMost recent push to the default branch.
Install checkInconclusiveStarted but did not complete the MCP handshake in our test.
Directory activity6 viewsConfig copies, upvotes, and views on AllMCPs.

How Gmail MCP works

What @klodr/gmail-mcp does

@klodr/gmail-mcp gives MCP-compatible AI assistants access to selected Gmail operations. Its tool surface covers reading and searching messages, creating and sending drafts, modifying labels, managing filters, working with threads, replying or forwarding, and downloading email or attachments.

The server wraps the Gmail v1 API rather than exposing an unrestricted account connection. OAuth scopes determine which operations are authorized, and the tool list is narrowed to match those grants. This makes it suitable for deployments where read-only access and limited write access should remain distinct.

How it works

The package runs as an MCP server and can be launched through npx. An assistant invokes Gmail operations as MCP tools, while the server mediates request validation and account actions. Thread-aware operations preserve reply relationships using the relevant mail headers, and replies can use a permitted Gmail send-as alias.

Safety checks run inside the process. They include CRLF and null-byte sanitization, bounds on batch inputs, recipient validation, optional recipient pairing, write limits, and audit logging. Download operations use source and destination path jails, symlink-safe writes, and protections against path traversal. Exported files can be written as JSON, EML, TXT, or HTML; HTML exports block scripts, frames, forms, and remote resources unless explicitly allowed.

Setup and configuration

Install or run the package with npx and complete Gmail OAuth authorization. The server supports a --scopes option so deployments can request only the Gmail permissions they need. OAuth credential files are protected with restrictive file permissions, and the loopback authorization flow checks both state and PKCE with S256.

A gcp-oauth.keys.json file in the project directory is used during authentication rather than being imported during an ordinary server start. Recipient pairing can be enabled with GMAIL_MCP_RECIPIENT_PAIRING; when enabled, a human must approve additions through the MCP client or the package's pairing command. Paired addresses constrain sends, replies, forwards, and drafts.

Tools and capabilities

Available Gmail functions include:

  • Read and search messages, including visible Cc and Bcc fields.
  • Create, inspect, and send drafts.
  • Send messages, reply in-thread, reply-all, and forward mail.
  • Select a validated send-as alias for outgoing mail.
  • Retrieve threads, list inbox threads, and view an inbox grouped by thread.
  • Create, list, update, and delete labels and filters.
  • Apply batch message changes or deletions with retry handling.
  • Download messages as JSON, EML, TXT, or HTML.
  • Download one attachment or all attachments, optionally packaged as a ZIP.

Tool annotations identify read-only, destructive, and idempotent behavior for MCP clients that use those hints.

Limitations and notes

OAuth scope selection affects both authorization and which tools appear. Forwarding filters are rejected to prevent a rule from silently redirecting future matching mail. Recipient pairing is an optional safeguard, but when enabled it cannot be expanded by the model through Gmail tools alone.

The server refuses unrecognized send-as addresses when Gmail exposes a non-empty alias list. It also validates draft recipients before sending and applies write caps over both 24-hour and 30-day periods. Downloaded files receive operating-system internet-origin markers where supported, and path protections are designed to prevent prompt-injected file exfiltration.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

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, and draft messages; manage threads, labels, and filters; reply or forward mail; and download emails and attachments. OAuth scopes control which tools are available.

Run it through npx and complete the Gmail OAuth authorization flow. The package supports a --scopes option for requesting limited permissions, and authentication uses the Google Cloud OAuth keys file during setup.

Yes, @klodr/gmail-mcp is intended for MCP-enabled assistants including Cursor. Configure Cursor to launch the package as an MCP server, then authorize the Gmail account and grant the scopes needed for the tools you want to use.

Enable GMAIL_MCP_RECIPIENT_PAIRING to restrict sends, replies, forwards, and drafts to paired addresses. The model cannot add recipients through the Gmail tools; a human must approve additions in the MCP client or use the package's pairing command.

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>