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
Gmail today: self-service only
Until the shared Gmail sign-in passes an independent security assessment, Google only lets accounts on a short test list use it. The lab charges 675 US dollars a year (details). email-mcp is free, has no paid tier and is not funded yet, so we cannot cover that ourselves. The assessment is what donations are for.
Use Gmail now, with your own project
- In the Google Cloud Console, create a project and enable the Gmail API.
- Set up the OAuth consent screen and add yourself as a test user.
- Create an OAuth client of the type Desktop app.
- Set
EMAIL_MCP_GMAIL_CLIENT_IDandEMAIL_MCP_GMAIL_CLIENT_SECRETfor the setup wizard and for the MCP server, then run the wizard.
It costs nothing. While your app stays in Google's testing mode, Google ends the sign-in after 7 days and you sign in again; a Google Workspace account can choose the Internal user type instead and avoid that. Full steps in the README.
Donate, so nobody has to
Once the assessment passes, Gmail works with the one command above, for everyone, with no Google project of your own.
0 of 675 US dollars collected for this year's Google security assessment
0 supporters, 0 percent of the goal. The assessment starts once the goal is reached, and Google's deadline for it is 29 December 2026. No other funding stands behind it yet. Updated 1 November 2026, refreshed once a day.
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.
36 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 and rules
Report spam, keep standing block rules, and forward matching mail to addresses you allowed yourself.
From the same maker
email-mcp handles your inbox. Lumitra Mail reaches your whole list.
Newsletters and product mail through your own sending provider, with a visual editor, one-click unsubscribe, and your contacts on servers in Germany. Send from your app through the API, or from the dashboard with no code at all. Free for up to 6,000 messages a month.
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
- Outlook uses a shared OAuth app published by this project, so setup needs zero configuration. Prefer your own? Set the Outlook equivalent of the variables below, see the README.
- Gmail needs your own OAuth client for now. The shared Gmail app is limited to Google's test list until its yearly independent security assessment (CASA) is done. Google has requested it, and its applicability to this local-only app is being clarified. What to do today; status, cost and what we asked Google are in the privacy policy.
- 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.