# google-mail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/mmedum/google-mail-mcp  
**GitHub Stars:** 0  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/google-mail-mcp

## Description
Gmail over MCP from your own account: search, read threads and messages, labels and drafts.

## Tools
Capabilities this server exposes over MCP:

- **get_profile** — The signed-in account, its totals and the current history id
- **search_threads** — Find conversations with a Gmail search
- **search_messages** — Find single messages with a Gmail search
- **get_thread** — Read a conversation, newest first, within a budget
- **get_message** — Read one message, by id or by its `Message-ID` header
- **read_attachment** — Read an attachment's text: plain text, CSV, Markdown, JSON, HTML, a calendar or an attached email
- **list_labels** — Every label, optionally with counts
- **list_drafts** — Unsent drafts
- **get_draft** — Read one draft
- **list_changes** — What changed since a history id, and when that cursor has expired
- **get_settings** — Forwarding, vacation reply, send-as addresses, IMAP and POP, read-only
- **list_filters** — The account's filters, with any that forward mail flagged
- **download_attachment** — Save an attachment into `GMAIL_LOCAL_DIR`, never overwriting; only when that is set
- **download_attachments** — Save several attachments of one message, or all of them, the same way; only when `GMAIL_LOCAL_DIR` is set
- **create_draft** — Save a new draft, a reply threaded by the server and quoting its parent if asked, or a forward with the original attached; nothing is sent
- **update_draft** — Change only the fields given, refusing a draft that changed since it was read
- **delete_draft** — Delete a draft for good, named with the message it holds, with `confirm: true
- **modify_labels** — Add and remove labels on up to 100 messages or threads, reported per item
- **trash** — Move up to 100 messages or threads to the trash, kept 30 days
- **restore** — Take messages or threads out of the trash
- **create_label** — Create a user label
- **update_label** — Rename a user label or change how it shows
- **send_draft** — Send a draft, naming every recipient, its subject and its first line; only with `GMAIL_ENABLE_SEND=true
- **delete_permanently** — Delete up to 100 messages or threads for good, with `confirm: true`; only with `GMAIL_ENABLE_DESTRUCTIVE=true
- **delete_label** — Delete a user label, with `confirm: true`; only with `GMAIL_ENABLE_DESTRUCTIVE=true
- **update_signature** — Set the signature of one of the account's addresses; only with `GMAIL_ENABLE_SETTINGS=true
- **create_filter** — Create a filter for mail that arrives from now on; it cannot forward or trash; only with `GMAIL_ENABLE_SETTINGS=true
- **create_trash_filter** — Create a filter that moves matching mail to the trash as it arrives, with `confirm: true`; only with `GMAIL_ENABLE_SETTINGS=true` and `GMAIL_ENABLE_DESTRUCTIVE=true
- **delete_filter** — Delete a filter, naming its criteria, with `confirm: true`; only with `GMAIL_ENABLE_SETTINGS=true` and `GMAIL_ENABLE_DESTRUCTIVE=true
- **set_vacation** — Turn the vacation reply on for contacts or the domain, or off; only with `GMAIL_ENABLE_SETTINGS=true` and `GMAIL_ENABLE_SEND=true

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/mmedum/google-mail-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

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

2. Sign in:

```sh
google-mail-mcp login --client-secret ~/path/to/client_secret.json
```

3. Add to Claude Code:

```sh
claude mcp add google-mail -- google-mail-mcp
```

## Documentation

## 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:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/google-mail-mcp/readme_

