mailwarden
A native Gmail MCP server providing full mailbox control via the live Gmail API, including unique snooze functionality.
README
mailwarden
A reliable, native Gmail MCP server — full mailbox control for AI assistants, with the feature nobody else ships: snooze.
Every operation hits the live Gmail API (no cached snapshot), so it reliably sees all your mail — search, read, label, archive, trash, download attachments, and snooze threads until a date.
Why
Hosted Gmail connectors run on a synced index that can silently miss messages. mailwarden talks straight to the Gmail API, so what you see is what's there. It's a generic Gmail capability layer — keep your own rules/logic in your AI client, not in the server.
Tools
| Tool | What it does |
|---|---|
search |
Gmail query syntax → thread summaries (from/subject/date/labels/snippet) |
get_thread |
Full thread: headers, plaintext + HTML bodies, attachment metadata |
list_labels |
All labels (system + user) |
modify_labels |
Add/remove labels (archive = remove INBOX, read = remove UNREAD) |
archive / mark_read / mark_unread |
Convenience wrappers |
trash / untrash |
Move to / restore from Trash |
download_attachment |
Save an attachment to a local path |
snooze |
Archive now, resurface on/after a date (YYYY-MM-DD) |
unsnooze |
Cancel a snooze, return to inbox now |
list_snoozed |
All snoozed threads + due dates |
sweep_snoozed |
Resurface threads whose snooze is due (run on demand, via cron, or the daemon) |
How snooze works (no Gmail API snooze exists — we build it)
snooze removes INBOX and applies a dated label MCP/Snoozed/<YYYY-MM-DD>. sweep_snoozed finds due labels and returns those threads to the inbox (marked unread). Run the sweep:
- on demand (
sweep_snoozedtool), - via cron:
mailwarden --sweep, - or automatically: set
MAILWARDEN_AUTO_SWEEP=1(hourly sweep while the server runs).
Setup
- Google Cloud: create a project → enable the Gmail API → configure the OAuth consent screen → create an OAuth client ID of type Desktop app → download it as
credentials.json. - Put
credentials.jsonin~/.mailwarden/(or setMAILWARDEN_CREDENTIALS=/path/to/credentials.json). - Install & authorize once:
Scope requested:npm install && npm run build mailwarden --auth # opens a browser, stores a refresh token in ~/.mailwarden/token.jsonhttps://www.googleapis.com/auth/gmail.modify.
Run
- Local (stdio) — for Claude Code / Claude Desktop:
mailwarden - Remote (Streamable HTTP) — for a VPS / claude.ai custom connector:
mailwarden --http # listens on :8787/mcp ; set PORT, optional MAILWARDEN_TOKEN bearer gate
Connect
Claude Code:
# local stdio
claude mcp add mailwarden -- mailwarden
# or remote
claude mcp add --transport http mailwarden https://your-host/mcp
claude.ai (web): Settings → Connectors → Add custom connector → your https://your-host/mcp URL.
Config (env)
| Var | Meaning |
|---|---|
MAILWARDEN_DIR |
config dir (default ~/.mailwarden) |
MAILWARDEN_CREDENTIALS |
path to credentials.json |
MAILWARDEN_AUTO_SWEEP |
1 → hourly snooze sweep while running |
PORT |
HTTP port (default 8787) |
MAILWARDEN_TOKEN |
optional bearer token for the HTTP endpoint |
Status
0.1.0 — scaffold. Core Gmail tools + snooze implemented against googleapis. The HTTP transport is a thin wrapper to verify against your installed @modelcontextprotocol/sdk version. PRs welcome.
License
MIT © C.Sitte Softwaretechnik
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.