IMAP mail MCP server and CLI with offline search
Your agent searches your mail offline, tells you which emails you owe an answer and drafts replies you approve. Moves and deletions can be undone.
You find the invoice from last spring, or the thread where a price was agreed, by asking. mail keeps a copy of your
mailbox on your computer, so the AI agent you already use, such as Claude Code or Codex, searches it there, even
without the internet. It works with Gmail, Outlook, iCloud, Fastmail, Yandex and any other mail server that offers
IMAP.
Your agent tells you which emails you owe an answer, what a PDF attachment says, and files this week's newsletters for you. Moves and deletions can be undone, and mail to anyone but you waits for your yes.
On this page:
- What you get
- Things a newcomer would not guess
- How it looks
- Why mail
- What it can do
- How it works
- Start
- Limits
- Find the guide for your task
What you get
- Mail your agent can use. Ask for an email by what it said, who sent it or what is in its attachment. The agent shows the email it found.
- A short list of what needs you. Which threads have new mail, which emails you owe an answer, which wait for someone else.
- Fewer newsletters and alerts. Choose which senders, lists or kinds of mail to skip or keep only as a short record. Look at a mailbox by sender before you copy it.
- A tidier mailbox, with undo. Moves, flags and deletion happen on the mail server. Deleted mail goes to Trash, and a move or a deletion can be undone while Trash still holds it.
- Drafts and replies you approve. Your agent saves a draft in your own Drafts folder, so it shows in every mail app. Mail to anyone but you asks you first.
- Mail beside your chats. The same store holds your Telegram, MAX and WhatsApp history, so Memo searches mail together with your chats and notes.
Things a newcomer would not guess
- Most providers want an app password. It is a password made for one program, which you can revoke. Outlook and Microsoft 365 use a browser sign-in instead. Prepare the mailbox
- The first sync reads the last 30 days. Add a start date to go further back, or bring in a Google Takeout file.
personalis a name you choose for one mailbox. No command picks a mailbox for you.- Text in an email is someone else's. Your agent treats it as data, never as an instruction.
How it looks
You: Which emails from this week do I still owe an answer?
Agent: (runs mail personal review --unanswered 1d, then mail personal messages show on each)
· Ann Example asked on Tuesday whether the invoice can move to December.
· Bob Sample sent the contract on Wednesday and asked for comments by Friday.
You: Draft a reply to Ann: yes, December is fine.
Agent: Saved a draft in your Drafts folder, in Ann's thread. Nothing is sent.Why mail
- One store with your chats. Of the mail tools on the comparison (Himalaya, mu, gog, Google Workspace MCP, Microsoft 365 MCP), none documents keeping mail in one store with chats, meetings and notes and searching them together.
- Undo for what it changed. No other tool on the comparison documents an undo for what it changed on the server.
- An agent over MCP mails only you until you allow more. A deletion or a change of many emails asks first.
- Your password stays in the system keyring.
mailtalks only to your provider's mail servers, over encrypted connections. - Free and open source. Apache 2.0.
Another tool fits better when your organisation turns IMAP off (Microsoft 365 MCP), or you use Gmail only and want Calendar and Drive in the same tool (gog).
What it can do
- Read and search: offline, by words, sender, date, size and attachment text. Search your mail
- Review: what is new, what you owe, what waits. Review
- Organise: rules for what to keep, flags, folders, Trash, with an undo. Organise the mailbox
- Write: drafts, send, reply and forward with attachments. Send, reply and forward
- Keep: export to mbox or Maildir, count mail by day or sender, add your own tags. Your own tags
- Hand triage to an agent: with Memo, a scheduled agent proposes tasks and facts for you to confirm. Mail in Memo
| Provider | How you sign in | Guide |
|---|---|---|
| Gmail | An app password, or a Google sign-in | Prepare the mailbox |
| Outlook.com, Hotmail, Microsoft 365 | A Microsoft sign-in in your browser | Connect Outlook |
| iCloud, Fastmail, Yandex | An app password | Prepare the mailbox |
| Any other IMAP server | An app password, if the provider has one | Prepare the mailbox |
How it works
- A copy on your computer.
syncreads your mail into the local store that the other WireCat tools share. Search and reading answer from it. A timer keeps it current. Everyday use - Changes happen on the server. A move or a deletion changes your real mailbox, so every mail app sees it. Each change keeps what it needs to undo itself.
- Made for scripts and agents. One operation per call, one JSON answer with
--json, a skill for terminal agents and an MCP server. - What is stored and what is sent. Access and safety
Start
Paste this into your agent:
Use mail CLI. Install it with npm install -g @wirecat/mail-cli, help me prepare my mailbox, sign in with mail personal session start, sync the last 30 days and show which emails I owe an answer.Or in a terminal. Turn on IMAP and make an app password first (steps per provider):
npm install -g @wirecat/mail-cli
mail personal session start # asks for the address, finds the server, asks for the app password
mail personal sync # the last 30 days
mail personal search messages invoice
mail skill install # optional: instructions for your agentYou need Node.js 22.16 or later on 22.x, or 24 and later. Installation
Limits
mailreads mail over IMAP. A mailbox reached only through JMAP or Microsoft Graph needs another tool.- A deleted draft does not come back, and Gmail empties Trash after 30 days, so an undo works only until then.
Find the guide for your task
| Task | Guide |
|---|---|
| Connect a mailbox and read mail | Everyday use |
| Prepare Gmail, iCloud, Fastmail, Yandex or another server | Prepare the mailbox |
| Connect Outlook or Microsoft 365 | Connect Outlook |
| Search mail with your chats, spot scams | Email with Memo |
| An exact command | Command reference |
| Change a setting or a permission | Settings |
| Something does not work | Troubleshooting |
| What mail stores and sends | Access and safety |
| How mail differs from other mail tools | Comparison |