Open source · Model Context Protocol server
Give your AI assistant an inbox, not a screenshot
One MCP server for Gmail, Outlook, iCloud and generic IMAP. Search, read, send, organize, and batch-manage email from Claude or any MCP-compatible assistant. It runs on your own machine and talks directly to your provider's own API — no server of ours ever sees your inbox.
npx -y -p @marlinjai/email-mcp@latest email-mcp-setup
Multi-provider
Gmail via its REST API, Outlook via Microsoft Graph, iCloud and any other mailbox over IMAP/SMTP. One tool surface, four kinds of account.
Encrypted at rest
Credentials are stored locally, AES-256-GCM encrypted with a key derived from your machine, not our servers. Bring your own OAuth app if you'd rather not use the shared one.
Built for batch work
Delete, move, mark or block hundreds of messages in one call, with a lightweight search mode that keeps results small until you ask for the full body.
How it works
-
1
Run the setup wizard.
npx -y -p @marlinjai/email-mcp@latest email-mcp-setupwalks you through adding one or more accounts, right in your terminal. -
2
Authorize in your browser.
Gmail and Outlook use a standard OAuth flow with PKCE. iCloud and IMAP use an app-specific password. Tokens stay on your machine.
-
3
Point your MCP client at it.
Add
{"email": {"command": "npx", "args": ["@marlinjai/email-mcp"]}}to your MCP config and the tools show up in Claude, or any other MCP-compatible client.
32 tools, six categories
The full list, with exact parameters, is in the README.
Accounts
Add, list, test and remove connected mailboxes.
Reading & search
Search, fetch, and list folders — compact by default, full body on request.
Sending & drafts
Send, reply, forward, and create, update or save attachments from drafts.
Organization
Delete, move, mark read/unread/starred, one message at a time.
Batch operations
The same actions across hundreds of messages in a single call.
Spam moderation
Report spam, and create, list or delete standing block rules per provider.
Open source, MIT licensed
The whole server is on GitHub: read the code, open an issue, or send a pull request. Community contributions have already fixed real bugs in IMAP reconnect handling, Gmail drafts, credential-key stability, and more — see the changelog for the running history.
Worth knowing before you connect a real inbox
- Gmail and Outlook, by default, use a shared OAuth app published by
this project so setup needs zero configuration. Prefer your own? Set
EMAIL_MCP_GMAIL_CLIENT_ID/EMAIL_MCP_GMAIL_CLIENT_SECRET(or the Outlook equivalent) and it's used instead — see the README. - Gmail's default scope permits permanent deletion. Choose the
"Restricted" scope during setup (or
EMAIL_MCP_GMAIL_SCOPE=restricted) to drop that permission and keep everything else working. - This project is not affiliated with Google, Microsoft or Apple. It's an independent client built against their public APIs.
It's a terminal command away
No account with us, no dashboard, no lock-in. Uninstall by removing the npm package;
your accounts and their tokens live in ~/.email-mcp on your own machine.