MCP Email: Self-hosted IMAP & SMTP for Claude Code
by OneShotForge
$49+
Stop building one-off email scripts every time you want Claude to handle your inbox. Drop this server in, add your accounts to a .env, point Claude Code at localhost. Done.
What it does
15 MCP tools covering the full email lifecycle:
Reading: email_list_folders, email_list_messages, email_search_messages, email_get_message, email_get_thread, email_get_attachment
Writing: email_send_message, email_create_draft
Management: email_move_message, email_copy_message, email_delete_message, email_mark_message (read/unread/flagged in one tool), email_create_folder, email_rename_folder, email_delete_folder
Multi-account out of the box. Declare as many inboxes as you want via env vars. Every tool takes an account argument on each call, so the agent never confuses which inbox it's reading or sending from. I run three on mine.
Any IMAP/SMTP provider. Gmail, Hostinger, Fastmail, Proton (via Bridge), iCloud, Outlook 365, Yahoo, Zoho, plus a generic option for custom domains. CONFIG.md has per-provider notes.
Self-hosted, credentials never leave your box. Runs locally with npm or in Docker. Only outbound traffic is the TLS connection to your provider. Bearer-token auth on the MCP endpoint. Nothing is reported anywhere.
Setup, in three steps
1. Get the code. Unzip, then either:
docker compose up -d
or
npm install && npm run build && npm start
2. Add your accounts to .env (one ACCOUNT_<id>_* block per inbox):
ACCOUNT_MAIN_EMAIL=hi@you.com
ACCOUNT_MAIN_PASSWORD=app_pw_here
ACCOUNT_MAIN_IMAP_HOST=imap.fastmail.com
ACCOUNT_MAIN_SMTP_HOST=smtp.fastmail.com
3. Wire to Claude Code via .mcp.json:
{ "mcpServers": { "email": { "url": "http://localhost:3000/mcp" } } }
Restart Claude Code, it picks the 15 tools up automatically.
I run this on my own inbox
The email at the bottom of every oneshotforge.com page is hello@oneshotforge.com. That inbox runs on a live mcp-email instance. When you email me, Claude reads your message through this server and drafts the reply. The version you're buying is the exact code I run on my own brand inbox today.
Bonus: that setup scores 10/10 on mail-tester — SPF, DKIM, DMARC all green. SMTP through this server isn't going to land your replies in spam.
What's included
Full TypeScript source code (Node 20+ compatible)
Docker Compose file + standalone npm setup
.env.example with templates for Gmail, Fastmail, Proton, iCloud, Outlook 365, Hostinger, generic IMAP
CONFIG.md with per-provider authentication notes (app passwords, OAuth equivalents)
README.md with full setup walkthrough
CHANGELOG.md with version history
LICENSE.md — commercial license, lifetime, single buyer, unlimited inboxes and projects of your own (including client work)
Requirements
Node 20+ or Docker
An MCP-compatible client (Claude Code recommended)
IMAP and SMTP credentials for at least one inbox
FAQ
Does it work with Gmail's OAuth?
Gmail uses an app password, not OAuth. One-line to create in Google account settings. No Google Cloud project, no service account JSON, no OAuth dance.
Does my data go through your servers?
No. It's self-hosted. Credentials and email content never leave your machine.
Will it work with my company's Outlook 365 / Exchange?
If your account has IMAP/SMTP enabled at the tenant level, yes. Some org admins disable IMAP — check with IT first.
Can I use it commercially?
Yes. Lifetime commercial license, single buyer, unlimited inboxes and projects (yours or your clients'). You just can't resell the source code as-is. Full terms in LICENSE.md.
Patch updates included?
All 1.x patch and minor releases are free for the lifetime of your license. A future 2.0 would be a paid upgrade at my discretion, but your 1.x license stays valid forever.
What if I get stuck during setup?
Email me at hello@oneshotforge.com. I run this myself; if something breaks at install time I want to know. Same-day refund if you can't make it work — no questions.