You have too many emails. Everyone does. Somewhere between the GitHub notifications, the newsletters you swore you'd read, and the receipts from 2019, your inbox turned into a graveyard of good intentions.
What if you could tell an AI "sort this mess out" and it actually could?
The problem
You open your inbox. 10,000+ unread. You think "I'll organize this weekend." That weekend never comes. You search for something important and your mail client spins for 30 seconds. You give up.
AI assistants are great at understanding text - summarizing, categorizing, drafting replies. But they can't touch your email. They don't have access. The tools that try to bridge that gap choke on large mailboxes, hit the mail server on every single query, and some want your password in a plaintext config file.
I had 300,000 emails. None of the existing tools could handle that.
What I built
IMAP-MCP connects AI assistants like Claude to your email via standard IMAP. It downloads emails into a local cache, and then everything runs instantly. No server roundtrips. No timeouts.
You talk to your AI assistant in plain English. It does the rest.
"Sort my 300K emails"
This started the whole project.
Years of accumulated email. Newsletters I never unsubscribed from. GitHub notifications from repos I'd forgotten. Shopping receipts, conference invitations, LinkedIn spam, monitoring alerts - all in one massive inbox.
I connected Claude and said: "Analyze the senders from the last 6 months. What categories do you see?"
Minutes later, a breakdown: 40% monitoring alerts, 15% GitHub notifications, 10% shopping, 8% LinkedIn. Only about 3% were messages from actual humans.
"Propose a folder structure and start sorting."
Claude created 12 folders - Dev, Shopping, Newsletters, LinkedIn, Finance, Travel - and started moving emails in batches. It matched patterns like "everything from @github.com goes to Dev" and processed hundreds at a time. Over a few sessions, it sorted about 200,000 emails.
Something I'd been postponing for years took one afternoon.
"Find that email I lost"
A few months ago I got an invitation from IEEE to join a reviewer panel. When I needed to respond, I couldn't find it. Inbox? Spam? Some subfolder?
"Find all emails from IEEE about a reviewer panel invitation."
Found in 2 seconds. It had landed in a subfolder I didn't remember creating. Claude pulled up the full thread, showed me follow-up messages I'd missed, and I had everything I needed.
No digging through folders. No trying six different search terms.
"Who haven't I replied to?"
This became a Monday routine.
"Show me emails from the last 2 weeks that I haven't replied to."
Claude cross-references sent and received mail, finds unanswered threads, and gives a prioritized list. Last week: 12 emails waiting for a response, each with a one-line summary.
It catches things I'd otherwise forget. The colleague who asked for feedback. The conference organizer waiting on a confirmation. The client question buried under notifications.
"Draft a reply for me"
For emails that need a response, Claude reads the full thread and writes a draft.
"Read the thread with Sarah about the Q3 budget review and draft a reply confirming the meeting time she proposed."
It picked up that Sarah suggested Thursday at 2pm, drafted a confirmation, and saved it in my Drafts folder. I opened it, tweaked one sentence, hit send.
Important: it never sends anything automatically. It creates drafts. You review, you send.
"Clean up newsletters and notifications"
Ongoing maintenance is where this gets addictive.
"Archive all newsletters older than 3 months."
"Move all GitHub notifications to the Dev folder."
"Show me everything from no-reply addresses older than a year."
There's a dry-run mode - preview exactly what would be moved before committing. I ran it once, it showed 3,000 matching emails. I reviewed the list, confirmed, and they were processed in minutes.
Thousands of emails sorted while I drank my coffee.
"Analyze my communication patterns"
This one turned out more useful than I expected.
"Who emails me the most?" - top senders ranked by volume.
"What percentage of my inbox is automated versus human?" - 97% automated. 3% real people writing real messages.
"Which senders do I never open?" - a hit list for unsubscribing.
Once you see patterns in your email, you make better decisions about what to filter and where your attention actually goes.
How it works
No deep technical dive - just what you'd want to know before trying it:
- Works with any email provider. Gmail, Outlook, Yahoo, Exchange, self-hosted. If it speaks IMAP, it works.
- Local cache means instant queries. Emails download once and stay cached. Searching 100,000 emails takes seconds.
- Your password stays in your OS keychain. macOS Keychain, Windows Credential Locker, or Linux secret service. Not in a config file.
- Cache encryption is optional. Personal email with sensitive content? Encrypt it. High-volume shared mailbox? Skip encryption, save memory.
- Works with Claude Code, Claude Desktop, VS Code, Cursor, and Windsurf. Anything that speaks MCP.
Get started
pipx install git+https://github.com/newlc/IMAP-mcp.git
imap-mcp --set-password --config config.json
claude mcp add imap-mcp -- imap-mcp --config config.json
Then tell Claude:
"Connect to my email and load the last 200 emails. Who's been emailing me the most?"
That's it.
Source code: github.com/newlc/IMAP-mcp
Top comments (0)