Google Mail MCP logo

Google Mail MCP

Access Gmail through MCP to search, read, organize, draft, and optionally send or manage mail from a local client.

Install Google Mail MCP

Run the project’s own setup commands, in order.

Setup steps from the project

google-mail-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    go install github.com/mmedum/google-mail-mcp/v4/cmd/google-mail-mcp@latest
    
  2. 2. Sign in
    google-mail-mcp login --client-secret ~/path/to/client_secret.json
    
  3. 3. Add to Claude Code
    claude mcp add google-mail -- google-mail-mcp
    

Overview

google-mail-mcp connects an MCP client to a user's Gmail account through a local Go binary and Google OAuth. It supports Gmail search, thread and message reading, attachment handling, labels, drafts, mailbox history, filters, and selected account settings. Reach for it when an agent needs controlled access to one mailbox without hosting a separate service. Write and destructive operations are gated by configuration switches, while read-only mode limits both OAuth access and registered tools.

Use cases

  • Search a mailbox for conversations matching Gmail queries
  • Read recent threads and extract supported attachment text
  • Create and review replies without sending them
  • Organize messages with labels, trash, and restore operations
  • Track mailbox changes from a saved history ID

Key features

  • Gmail thread and message search
  • Bounded thread and message reading
  • Attachment text reading and local downloads
  • Draft creation, editing, and optional sending
  • Label, trash, restore, and filter management
  • OAuth credentials stored in the OS keyring

Tools30

What Google Mail MCP lets your agent do. Expand a tool for its parameters.

Self-reported~654 tokens of context

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 48d

Adoption & maintenance

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

Last commit5d agoMost recent push to the default branch.
Tools exposed30Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How Google Mail MCP works

What google-mail-mcp does

google-mail-mcp exposes Gmail operations as MCP tools for a single Google account. It can locate conversations or individual messages using Gmail's search syntax, return thread and message contents, inspect labels and drafts, read supported attachment formats, and report mailbox changes since a history cursor.

The server also covers common mailbox maintenance. Agents can create and revise drafts, apply or remove labels, move messages to trash, restore trashed mail, create labels, and inspect forwarding, vacation, send-as, IMAP, and POP settings. Optional tools support sending an existing draft, changing signatures, managing filters, enabling vacation replies, and permanently deleting messages or labels.

How it works

A local Go executable communicates with the MCP client over stdio. It runs as the client's subprocess, so there is no hosted server or service account involved. Google OAuth is completed with a Desktop application client, and the refresh token is kept in the operating system keyring.

Mail content is returned with boundaries around message text. Hidden styling and other concealed text are removed and counted, links whose displayed site differs from their destination are flagged, and linked or embedded external content is not fetched. Thread results are newest first and constrained by a character budget; collapsed quotations and signatures indicate how much content was omitted.

Search requests accept Gmail's q language plus after and before instants. Write operations report the affected IDs, support dry_run, and return the change observed from Gmail. Attachment downloads use a configured local directory and avoid overwriting existing files.

Setup and configuration

Create a Google Cloud project, enable the Gmail API, configure an External consent screen with the scopes required for the intended mode, and create a Desktop OAuth client. Install the binary with:

bash
go install github.com/mmedum/google-mail-mcp/v4/cmd/google-mail-mcp@latest

Authenticate once with the client JSON, then check the setup:

bash
google-mail-mcp login --client-secret ~/path/to/client_secret.json
google-mail-mcp doctor

Add the executable to an MCP client's configuration, for example with Claude Code:

Terminal
claude mcp add google-mail -- google-mail-mcp

GMAIL_READ_ONLY=true registers only read tools and requests read-only Gmail access. GMAIL_PROFILE supports multiple accounts on one machine, while GMAIL_LOCAL_DIR enables attachment downloads. Sending requires GMAIL_ENABLE_SEND=true; permanent deletion and destructive label or filter operations require GMAIL_ENABLE_DESTRUCTIVE=true. Signature, filter, and vacation settings require GMAIL_ENABLE_SETTINGS=true. Read-only mode cannot be combined with these write switches.

Tools and capabilities

  • Search threads or individual messages with Gmail queries.
  • Read messages, conversations, drafts, and supported text-based attachments.
  • List labels, drafts, filters, account settings, and mailbox history changes.
  • Download one or more attachments to the configured local directory.
  • Create, update, and permanently remove drafts with confirmation where required.
  • Apply labels, trash or restore mail, create or rename labels, and optionally send drafts.
  • Optionally update signatures, create or remove filters, and manage vacation replies.

Limitations and notes

The server operates within Gmail rather than across related Google services. Calendar events, linked Drive files, and Chat spaces require separate services. Automatic forwarding, forwarding filters, and delegation are not available; forwarding a message creates a draft with the original attached.

Sending is disabled unless explicitly enabled and is limited to sending drafts. Permanent deletion is separately disabled by default and requires confirmation. Settings-changing tools and trash filters have their own configuration gates. Messages from an External OAuth client in Google's Testing state can have refresh tokens that expire after seven days.

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 Google Mail MCP

google-mail-mcp is an MCP server that connects an AI client to a user's Gmail account through Google OAuth. Its main tools search threads and messages, read mail and attachments, inspect labels and drafts, track mailbox changes, and optionally create, send, modify, or remove mail under explicit configuration controls.

Install it with `go install github.com/mmedum/google-mail-mcp/v4/cmd/google-mail-mcp@latest`. Then create a Google OAuth Desktop client, run `google-mail-mcp login --client-secret <path>`, run `google-mail-mcp doctor`, and add the executable to the MCP client's configuration.

Set `GMAIL_READ_ONLY=true`. The server then requests read-only Gmail access and registers only its read tools, preventing write tools from being exposed through the MCP connection.

Set `GMAIL_ENABLE_SEND=true` and have the agent send an existing draft. Sending is limited to drafts and the tool requires the recipients, subject, and first line to be named.

Set `GMAIL_LOCAL_DIR` to a local directory, then use `download_attachment` or `download_attachments`. Files are saved without overwriting existing files; the download tools are unavailable when that directory is not configured.

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 PreviewGoogle Mail MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/google-mail-mcp?style=directory)](https://allmcps.com/mcp/google-mail-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/google-mail-mcp"><img src="https://allmcps.com/api/badge/google-mail-mcp?style=directory" alt="Google Mail MCP on AllMCPs" /></a>