mailwarden — Gmail MCP Server for AI Assistants

mailwarden is a reliable, native Gmail MCP server — full mailbox triage for AI assistants such as Claude, with the feature nobody else ships: snooze. It talks straight to the live Gmail API (no cached mailbox snapshot) and re-verifies what Gmail’s sometimes-loose search index returns, so what your assistant sees is what is actually there.

Open source under the MIT license, written in TypeScript, published on npm. Install is a single command:

claude mcp add mailwarden -- npx -y mailwarden

Highlights

  • Snooze. Archive a thread now, have it resurface in the inbox on a date, a date + time, or a preset (tomorrow 9am, weekend, next week, in 3 hours). Built on dated labels plus a sweep, so it works from any client and survives restarts — the Gmail API itself has no snooze.
  • Search you can trust. Gmail’s search index silently drops is:unread in some operator combinations; every hit is re-checked against its live labels and false positives are discarded.
  • Bulk operations that scale. Batch label changes for everything matching a query, 1000 messages per API request, with per-chunk partial-success reporting.
  • Server-side auto-triage. Create, list and delete Gmail filters so the mailbox keeps triaging itself with no assistant in the loop — label-only actions, never forwarding, so there is still no exfiltration path.
  • Triage digest. One read-only triage_digest tool turns a mailbox slice into a decision-ready overview — top senders, label and age buckets, unread and attachment counts — instead of a raw thread list.
  • Structured outputs. Every tool declares an output schema and returns validated structured content — no parsing guesswork for clients.
  • Correct with real-world mail. Encoded headers decoded, bodies decoded in their declared charset, rate limits retried with exponential backoff.

Security & privacy by design

  • No send tools. mailwarden cannot compose, reply or forward — a prompt-injected instruction inside an e-mail has no exfiltration path through this server.
  • No telemetry, no open ports by default. stdio only; an HTTP listener exists solely behind an explicit flag, optionally gated by a bearer token.
  • Tool tiers & least scope. MAILWARDEN_TOOLS advertises only the tiers you name — read, manage, filters — and the OAuth scopes requested at authorization are derived from them, so a read-only deployment asks Google for nothing more than gmail.readonly. MAILWARDEN_READONLY=1 is the read-only shorthand.
  • Token encryption at rest. Set MAILWARDEN_TOKEN_PASSPHRASE and the stored OAuth token is AES-256-GCM-encrypted, so a copied or synced token file is useless without the passphrase.
  • Live API, no copy. No mailbox mirror or search index is stored anywhere; the only local state is your OAuth token.

Compared to other Gmail MCP servers

Several Gmail MCP servers exist. What stays mailwarden’s alone is not any single row below — it is snooze plus live re-verification together: an inbox-workflow layer over the mailbox’s current state, not over a snapshot.

CapabilitymailwardentaylorwilsdonGoogle officialmcpemails
Snooze (date / time / preset)
Search-result re-verification
Sweep / bulk over a querypartial
No send tools (by design)sendsdraft onlysends
Least-privilege tool tierspartialpartial
Token encryption at restn/a
Fully local (no cloud copy)

Comparison as of August 2026 against the then-current public versions; capabilities move, so treat it as a snapshot. The one recent shift: mcpemails added send and bulk — still no snooze.

Why re-verification matters — a concrete case

Ask an assistant to “archive the unread promotions that already scrolled past the inbox” and the obvious query is category:updates is:unread -in:inbox. Gmail’s search index silently drops the is:unread predicate in this combination and returns read mail as well. A server that trusts the index would archive already-read mail along with the rest — in a bulk action that is tedious to undo. mailwarden re-checks every hit against its reallabels and discards the index’s false positives before any action sees them.

Tools
ToolWhat it does
searchGmail query syntax → thread summaries, read-state predicates re-verified, paginated
get_threadFull thread: headers, plaintext + HTML bodies, attachment metadata
list_labelsAll labels, system + user
get_profileConnected address + message/thread totals — confirm which mailbox is wired up
triage_digestDecision-ready overview of a mailbox slice: top senders, label + age buckets, unread and attachment counts
create_labelCreate a user label (idempotent, nested via Parent/Child)
modify_labels / bulk_modifyLabel changes for one thread or for every message matching a query — 1000 per API request, partial success reported per chunk
archive, mark_read, mark_unread, trash, untrashEveryday mailbox actions
download_attachmentSave an attachment locally — fenced to a configured directory, never overwrites
snooze, unsnooze, list_snoozed, sweep_snoozedArchive now, resurface on a date, date + time or preset; sweep on demand, via cron or hourly daemon
list_filters, create_filter, delete_filterServer-side auto-triage rules (criteria → label actions only, never forwarding); optionally apply a new filter to existing mail

Links

mailwarden is developed and used in daily mailbox automation by C.Sitte Softwaretechnik. Contributions welcome.