Gmail Tidy MCP logo

Gmail Tidy MCP

Organizes multiple Gmail accounts with search, labels, filters, archiving, and drafts without sending or deleting mail.

Install Gmail Tidy 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": {
    "gmail-tidy-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "gmail-tidy-mcp"
      ]
    }
  }
}

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

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

gmail-tidy-mcp connects an AI assistant to multiple Gmail accounts for reading, searching, labeling, archiving, filtering, and draft management. It uses fixed Gmail-focused tools and deliberately provides no operations for sending, replying, forwarding, deleting, or moving messages to Trash or Spam. Reach for it when inbox organization and cross-account review matter more than unrestricted mailbox control. OAuth tokens are encrypted locally, and changes are recorded in a local audit log.

Use cases

  • Organize newsletters across several Gmail accounts
  • Search and review messages across every connected account
  • Archive or label matching messages in batches
  • Create Gmail filters without sending or deleting mail
  • Prepare drafts with approved local attachments

Key features

  • Multi-account Gmail search and reading
  • Label, archive, and mark-as-read operations
  • Gmail filter creation and management
  • Draft creation, replies, updates, and attachments
  • Local token encryption and change auditing
  • Attachment and email security checks

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.

11/11 checks healthy over the last 42d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · gmail-tidy-mcp (npm)

Adoption & maintenance

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

GitHub stars2Stargazers on the source repository.
npm downloads639Package downloads in the last 30 days.
Last commit23d agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Gmail Tidy MCP works

What gmail-tidy-mcp does

gmail-tidy-mcp gives an AI assistant a constrained set of Gmail tools for several connected accounts. It can search one account or all accounts, read messages and threads, inspect attachments, analyze sender and newsletter activity, and manage labels. Organization actions include applying or removing labels, archiving by removing the INBOX label, and marking messages as read by removing UNREAD.

The server also manages Gmail filters and drafts. Drafts can be created as replies, updated without replacing unspecified fields, and given local file attachments. A signature can be changed, and recent_changes provides a record of modifications made during sessions. It cannot send, reply to, forward, delete, or move mail to Trash or Spam.

How it works

Accounts are connected through Google OAuth using PKCE and a random state value, with the local redirect bound to 127.0.0.1. After authentication, the account address and granted scopes are checked before credentials are saved. Each account receives a short label for use in requests such as organizing mail in a particular account.

Gmail content is treated as untrusted input. Returned messages and attachments are placed in fenced blocks with per-call markers, while HTML, control characters, zero-width characters, Unicode tag characters, and text-direction controls are filtered. The server adds heuristic notices for issues such as suspected prompt injection, authentication failures, misleading links, lookalike senders, and suspicious reply addresses.

Large searches and sender or newsletter scans fetch data in small batches and back off when Gmail applies quota pressure. Changes and saved files are logged locally without message bodies, draft text, or signature contents.

Setup and configuration

Node.js 22 or newer is required. Setup uses a Google OAuth client created by the operator rather than a shared client or third-party service. The server requests gmail.modify for Gmail changes and gmail.settings.basic for filter operations; Google does not provide a draft-only scope that excludes sending.

OAuth tokens are encrypted in ~/.config/gmail-tidy-mcp/tokens.enc with file mode 600. The encryption key is kept in the macOS Keychain, Linux Secret Service, or a DPAPI-protected Windows file. Operators can instead provide a 64-character hexadecimal key through GMAIL_TIDY_KEY.

Draft attachments must be located under Downloads, Desktop, or Documents, or under directories listed in GMAIL_TIDY_ATTACH_DIRS. The server blocks hidden locations and its own configuration directory. Saved attachments go to ~/Downloads/gmail-tidy-mcp and cannot overwrite existing files.

Tools and capabilities

  • Connect and inspect accounts with list_accounts, check_accounts, connect_account, and finish_connect_account.
  • Search Gmail syntax in one account or across all accounts with search_emails and search_all_accounts.
  • Read messages, threads, and attachments with get_email, get_thread, and get_attachment.
  • Review sender volume and newsletters with sender_stats and newsletters.
  • Create, rename, recolor, show, hide, and list nested labels.
  • Organize up to 5,000 messages per operation by adding or removing labels, archiving, or marking them read.
  • Create, list, and delete filters; skipping the inbox requires explicit skip_inbox: true.
  • Create, list, and update drafts, including replies and permitted local attachments.
  • Review changes through recent_changes and change only the Gmail signature with set_signature.

Limitations and notes

The no-send and no-delete boundary is enforced by the server’s fixed tool set and tested in the project. It is not a restriction on the OAuth token itself: a stolen token together with its encryption key could have the permissions granted by gmail.modify.

Security findings are heuristics and cannot identify every malicious message. A model could still archive or relabel mail, create an inbox-skipping filter, remove a filter, alter a draft or signature, or save a flagged attachment when allow_risky: true is supplied. Filter deletion cannot be recovered through the server. Drafts are never sent automatically.

Potentially dangerous executables, scripts, mismatched file types, unsafe archives, macro-enabled Office files, and PDFs with JavaScript or automatic actions are refused or flagged. Draft header fields reject line breaks to prevent hidden header injection. On macOS, saved files receive the quarantine flag.

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 Tidy MCP

gmail-tidy-mcp is an MCP server that connects AI assistants to multiple Gmail accounts and provides tools for searching, reading, labeling, archiving, managing filters, and creating drafts. It also supports account management, attachment inspection, sender statistics, newsletter analysis, signatures, and audit history, but has no tools for sending or deleting email.

No, gmail-tidy-mcp cannot send, reply to, forward, delete, or move messages to Trash or Spam. Its fixed tool set excludes those operations, although the OAuth token itself technically includes permissions associated with Gmail's `gmail.modify` scope.

Install and run it with Node.js 22 or newer, then configure your own Google OAuth client and connect the server to an MCP client. Authentication uses PKCE, a local `127.0.0.1` redirect, and account and scope verification before credentials are stored.

It stores encrypted tokens at `~/.config/gmail-tidy-mcp/tokens.enc` and the local audit log at `~/.config/gmail-tidy-mcp/audit.log`, both with mode 600. The encryption key is kept in the platform keychain or secret store, unless `GMAIL_TIDY_KEY` is supplied.

No, draft attachments must come from Downloads, Desktop, Documents, or directories configured through `GMAIL_TIDY_ATTACH_DIRS`. Hidden locations and the server's configuration directory are blocked, and dangerous files or archives are refused unless `allow_risky: true` is explicitly used.

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