Claude Code is great at the things you'd expect a senior engineer to be great at: refactoring, writing tests, walking through a codebase, debugging. Less obvious: it's also pretty good at running an inbox, if you give it the right tools.
I started doing this seriously a few months ago, after I got tired of the morning triage that took fifteen minutes every day. I wanted to say claude "summarize anything that's not a recruiter and draft a polite decline for the recruiters" and walk away.
To get there, you need three things:
- A Claude Code installation (you probably have one)
- An MCP server that knows how to talk to your inbox over IMAP and SMTP
- A working
.mcp.jsonso Claude Code knows where to find it
The first one's already done. The third one's a one-liner. The second is the actual question.
A 60-second refresher on MCP
If you've been using Claude Code for a while, MCP (Model Context Protocol) is the thing that lets the agent reach beyond its context window into your tools. Anthropic ships it as an open spec, and the way you plug a tool in is a single entry in ~/.claude.json or .mcp.json pointing at a server binary.
A server can be anything: a Python script you wrote yourself, an npm package someone shipped, a Docker container running on your laptop. As long as it speaks the MCP protocol over stdio or HTTP, Claude Code will talk to it.
For email specifically, you have two real paths.
Path 1: write the MCP server yourself
If you're comfortable with imapflow or node-imap on the Node side, or imaplib in Python, you can build a server in an afternoon. The minimum viable version is list_messages, get_message, and send_message over a single account.
I did this first. It worked. Then I needed search across folders, then attachments, then drafts that Claude could revise before send, then multi-account support, then proper error handling for the dozen ways IMAP can return things that aren't what you expected.
A weekend project turned into the better part of a month. Which is how I ended up with what became mcp-email.
Path 2: use an existing MCP server
If "month of evenings" is not on your roadmap, you have a few off-the-shelf options. Most of them do the obvious two operations (read, send) and stop there. If you only need notification-style "tell me when something new arrives" or "send this drafted message," any of them work.
The moment you want Claude to actually triage — search across folders, fetch attachments, draft and revise, move messages around, flag for follow-up — you need a server with the boring operations covered. That's the niche mcp-email fills.
I'm the maker, so take this with the usual grain of salt. The full feature list is on oneshotforge.com/mcp-email. The rest of this article describes what the setup looks like in practice, whether you end up using mcp-email or building your own.
The setup, step by step
Step 1: pick a provider and get the right credentials
You want IMAP + SMTP credentials, ideally an app password rather than your main account password. Common providers and what to ask for:
- Gmail: enable 2FA, then generate an app password at
myaccount.google.com/apppasswords. Useimap.gmail.com:993andsmtp.gmail.com:465. - Fastmail: settings → privacy & security → app passwords.
imap.fastmail.com:993,smtp.fastmail.com:465. - Proton Mail: install Proton Bridge locally. Bridge gives you
127.0.0.1:1143(IMAP) and127.0.0.1:1025(SMTP) with a Bridge-generated password. - iCloud: settings → sign-in and security → app-specific passwords.
imap.mail.me.com:993,smtp.mail.me.com:587. - Outlook 365 / Microsoft 365: app password through the security portal.
outlook.office365.com:993,smtp.office365.com:587. - Custom domain (Hostinger, ProtonMail Mail Pro, etc.): your provider gives you IMAP/SMTP hostnames directly.
If you're using your inbox for business, set up SPF, DKIM, and DMARC records on the sending domain before you ask Claude to send anything. mail-tester.com will give you a 0-10 score on the resulting setup; aim for 10/10. My setup on hello@oneshotforge.com scores 10/10 and I'm pretty confident a 10/10 mail-tester score correlates with not landing in spam.
Step 2: configure the MCP server
For mcp-email specifically, the config lives in a .env file:
ACCOUNT_MAIN_EMAIL=hello@oneshotforge.com
ACCOUNT_MAIN_PASSWORD=...
ACCOUNT_MAIN_IMAP_HOST=imap.hostinger.com
ACCOUNT_MAIN_IMAP_PORT=993
ACCOUNT_MAIN_SMTP_HOST=smtp.hostinger.com
ACCOUNT_MAIN_SMTP_PORT=465
Multi-account just means more blocks: ACCOUNT_GMAIL_*, ACCOUNT_PROTON_*, and so on. Every tool call from Claude will include an account argument, so the agent never confuses which inbox is being read or sent from.
Other servers will have slightly different conventions, but the credentials are the same.
Step 3: wire it into Claude Code
In your project (or globally in ~/.claude.json), add:
{
"mcpServers": {
"mcp-email": {
"command": "node",
"args": ["/path/to/mcp-email/dist/index.js"],
"env": { "DOTENV_PATH": "/path/to/mcp-email/.env" }
}
}
}
Restart Claude Code. Ask it list my unread messages. If a list of subject lines comes back, you're done.
The 15 tools, briefly
The tools fall into three buckets.
Reading: list_folders, list_messages, search_messages, get_message, get_thread, get_attachment. This is the part where Claude needs to figure out what's in the inbox. The thread tool is the one I rely on most because Claude reasons better when it can see the chain of replies, not just the latest message.
Writing: send_message, create_draft, reply_message. The create_draft tool is essential. I never let the agent send anything without me reading the draft in Gmail first, and create_draft is what makes that workflow possible.
Management: move_message, copy_message, delete_message, mark_message (read/unread/flag), and folder ops (create_folder, rename_folder, delete_folder). The boring stuff. The reason you need this is so Claude can actually file things — "move this to triage/recruiters" — instead of just listing them and forgetting.
What Claude is good at, what it isn't
After a few months of running this daily, here's the actual capability shape.
Good at:
- Drafting polite, on-tone replies if you give it 2-3 examples of how you usually write
- Summarizing a long thread into 3 bullets ("they want X, you said Y, the action item is Z")
- Triaging by category if your folder naming is unambiguous (
triage/recruiters,triage/newsletters,triage/clients) - Catching duplicate threads (same person, same topic, slightly different subject line)
Bad at:
- Inferring tone from cold context. If the sender has been emailing you for two years and you have a running joke, Claude won't catch it.
- Deciding what to send. I haven't found a prompt that makes me trust auto-send.
create_draftplus manual review is the workflow. - Long-running watch-and-react patterns. MCP is request-response; you trigger it, it acts. For "notify me when X arrives" you want a webhook, not an agent.
Common gotchas
A few things that bit me early:
- Gmail rate limits. IMAP on Gmail throttles aggressively if you fetch large attachments in a loop. Use the
search_messagestool with a date range to scope down before fetching. - Proton Bridge needs to be running. If your laptop sleeps, Bridge sleeps too, and the IMAP connection drops. I added a
launchdplist to restart Bridge automatically. - Time zones in headers are unreliable. Always trust the message body's date if it's mentioned, not the header.
- DKIM keys take time to propagate. If you just set up a new domain, give it 24 hours before testing send.
Closing
The honest pitch: if you spend more than 15 minutes a day on triage, this pays for itself in a week, even at the highest possible interpretation of your hourly rate. If you're at "I check email three times a day, it's fine," you don't need it.
mcp-email is distributed as a paid product. After checkout on https://shop.oneshotforge.com/l/mcp-email you get the full TypeScript source code, the Docker compose setup, the per-provider config docs, and a perpetual commercial license. The whole thing fits in a single zip. The README walks you through your first .mcp.json entry in Claude Code.
If you build something interesting on top, hit me at hello@oneshotforge.com. I read everything.