MailOtter
Provides tools for managing multiple Gmail accounts, including cross-account search, reading emails, identifying top senders, previewing and confirming bulk trash or archive actions, and undoing logged actions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
A little help for a lot of mail.
MailOtter lets your AI assistant (Claude, or any MCP client) search and clean up all your Gmail accounts at once, without the scary parts:
đ Search everywhere. One search across every inbox you own.
đ Top senders. Find out who's actually filling your inbox.
đī¸ Bulk trash, two steps. Preview first ("43 emails, here are 5"), act only after you say yes.
âŠī¸ Undo anything. Every trash or archive is logged and can be reversed.
đĨ Archive to clear the inbox without deleting.
And what it can't do, by design:
âī¸ It can't send email. MailOtter has no send function at all. (Honest note: Google's
gmail.modifypermission, which MailOtter needs for Trash, would technically allow sending. The guarantee comes from MailOtter's code, which tests check.)đĨ It can't permanently delete. Mail goes to Trash, which you can recover for 30 days.
đ§Š It can't do half a job. If a search matches more than the limit (2,000 by default), it refuses and changes nothing.
âąī¸ It can't act on stale previews. A preview code works once, for 15 minutes, on exactly the emails it showed. Mail that arrives later is never touched, and mail already changed since the preview is skipped.
đ It can't half-connect. Every account is reached before anything changes. A crash mid-way still leaves a journal, so
undoworks.
It runs on your own computer (Linux, macOS or WSL). Your mail goes only between your computer and Google.
It deliberately stays under Gmail's per-account speed limit, so big jobs take time: about 5 minutes to trash 1,000 emails, and about 1 minute to scan 250 for top senders.
Install
pipx install git+https://github.com/Choplac/mailotterRelated MCP server: gmail-mcp
One-time Google setup (about 15 minutes)
Gmail needs a "client key" that belongs to you:
Go to Google Cloud Console and create a project (any name).
Under APIs & Services â Library, open Gmail API and click Enable.
Open Google Auth Platform â Get started. App name:
MailOtter. Audience: External.Under Audience â Test users, add every Gmail address you want to manage.
Under Clients â Create client, choose Desktop app, then click Download JSON.
Run
mailotter setup ~/Downloads/client_secret_XXXX.json, then delete the download.
While your Google app is in Testing, Google makes sign-ins expire after 7 days. To avoid re-signing weekly, open Audience and click Publish app. It stays private to you, and Google shows an "unverified app" warning at sign-in, which is expected for a personal tool.
Sign in your accounts
mailotter login personal --email you@gmail.com
mailotter login old --email old.you@gmail.com
mailotter accountslogin prints a link. Open it, sign in, and allow access. If your browser can't reach the
computer (some WSL, SSH or container setups), use mailotter login personal --manual.
Use it from the command line
mailotter top-senders # who fills your inboxes
mailotter search "from:newsletter@shop.com" # across all accounts
mailotter trash "from:newsletter@shop.com older_than:3m" # preview, then type yes
mailotter archive "category:promotions" -a personal
mailotter history
mailotter undo # reverse the last actionThe search words are Gmail's own.
Use it from Claude Code
claude mcp add mailotter -- mailotter serveThen just ask: "Who sends me the most mail across all my accounts? Preview trashing the newsletters older than 3 months."
Keep yourself in the loop: when Claude asks permission to run confirm_action, read the
preview first. Don't add confirm_action to your always-allow list.
Tools
Tool | What it does | Changes mail? |
| Your accounts and nicknames | No |
| Gmail search in one account or | No |
| Read one email (plain text) | No |
| Biggest senders over recent mail | No |
| Count and examples, plus a one-time code | No |
| Carry out a preview | Yes (reversible) |
| Reverse a confirmed action | Yes (restores) |
| Recent actions and their ids | No |
Safety notes
Emails are written by strangers. MailOtter tells the assistant never to follow instructions found inside an email, and the two-step confirm means a sneaky email can't trash your mail on its own.
Files live in
~/.config/mailotter(or$MAILOTTER_HOME) and only your user can read them:client_secret.json,tokens/<nickname>.json,state/history.jsonl.To revoke access completely, run
mailotter logout <nickname>and remove MailOtter at https://myaccount.google.com/permissions.Undo works for as long as Gmail keeps Trash (30 days).
Develop
python -m venv .venv && .venv/bin/pip install -e '.[test]'
.venv/bin/pytest # uses an in-memory fake Gmail, never a real inboxLicense
MIT. See also the privacy policy.
This server cannot be deployed
Maintenance
Related MCP Connectors
Multiple Gmail accounts, editable Google Sheets & Docs for AI agents. Deny-by-default access rules.
Search and triage all your mailboxes; draft replies and campaigns; send only as you allow.
Give AI agents their own email inboxes: list, read and send mail via scoped, revocable OAuth grants.
One inbox for all your addresses: your AI agent reads, sorts, drafts and sends with your permission.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Gmail through OAuth2 authentication, allowing users to list, search, read emails, and create drafts with a safety-first design that prevents accidental sends by default.119 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read Gmail and create drafts securely with read-only access and query whitelisting.MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to review unread emails and perform email management operations like delete, archive, and label through Gmail integration.7Apache 2.0
- AlicenseAqualityAmaintenanceEnables AI assistants to search, read, draft, and send Gmail messages, as well as manage labels and trash using natural language.24482 npmMIT