mail-mcp
Allows the assistant to access AOL mailboxes via IMAP: list folders, search and read messages, create drafts, and mark, move, archive, or trash emails, with optional sending when enabled.
Allows the assistant to access Gmail mailboxes via IMAP using app passwords: list folders, search and read messages, inspect attachment names, compute sender stats, create drafts, and mark, move, archive, or trash emails, with optional sending when enabled.
Allows the assistant to access iCloud mailboxes via IMAP using app-specific passwords: list folders, search and read messages, create drafts, and mark, move, archive, or trash emails, with optional sending when enabled.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mail-mcp
One small server that gives any MCP-capable AI assistant (Claude, ChatGPT and others) access to your mailboxes: any number of Gmail accounts, Yahoo, Hotmail/Outlook.com, iCloud, AOL, or any IMAP server.
You run it in your own hosting account. Your passwords and mail never pass through anyone else's server, and nothing is stored: each request opens an IMAP connection, does its job and closes it.
Οδηγίες στα ελληνικά: ODIGOS.md
What the assistant can do
Tool | Purpose |
| See which mailboxes and folders exist |
| Latest messages, or search by text, sender, subject, date, unread |
| Text and attachment names of one message |
| Messages per sender and how many you never opened, for newsletter cleanup |
| Save a new message or a reply to Drafts. Nothing is sent |
| Read/unread, star, move, archive, trash |
| Only exists if you set |
| The pair ChatGPT expects for searching across all inboxes |
By default the assistant can only write drafts, and you send them yourself.
Related MCP server: Mailoo
Set it up (about 10 minutes, free Vercel account)
Press the button above. Vercel copies this repository into your own GitHub account and creates the project.
When asked for
MCP_AUTH_TOKEN, type a long random text of at least 24 characters. It is the password of your server, so keep a copy.Deploy.
In the project, open Settings > Deployment Protection and make sure the production URL is not behind Vercel Authentication ("Standard Protection" is fine). Otherwise no assistant can reach it.
Open
https://<your-project>.vercel.app/setup/<MCP_AUTH_TOKEN>. That page walks you through the rest: it checks every mailbox login, tells you what to paste where, and shows the address to give to your assistant.
Adding mailboxes
One environment variable per mailbox, with the address and an app password (not your normal password):
MAIL_ACCOUNT_1=you@gmail.com abcd efgh ijkl mnop
MAIL_ACCOUNT_2=other@gmail.com qrst uvwx yzab cdef
MAIL_ACCOUNT_3=you@yahoo.com apppasswordThe provider is recognised from the address. Redeploy after changing variables.
Where to create app passwords:
Gmail: https://myaccount.google.com/apppasswords (2-Step Verification must be on)
Yahoo: Account security > Generate app password
iCloud: account.apple.com > Sign-In and Security > App-Specific Passwords
For any other IMAP server use the JSON form instead:
MAIL_ACCOUNTS=[{"id":"work","provider":"custom","email":"me@example.com","password":"...","imap":{"host":"mail.example.com","port":993},"smtp":{"host":"mail.example.com","port":465}}]Hotmail / Outlook.com
The easy way needs no setup here at all: in Outlook.com open Settings > Mail > Forwarding, forward to a Gmail or Yahoo address you have connected, and keep a copy. New mail then shows up in that mailbox. Older messages stay behind, and replies go out from the other address.
To connect the mailbox directly, the server needs the id of an Azure app, because Microsoft accepts only OAuth2 here. Registering one requires an Azure account (free, but Microsoft asks for a phone number and a card), since a plain Hotmail account cannot open the Entra admin center:
In the Microsoft Entra admin center, create an App registration that supports personal Microsoft accounts.
Under Authentication, enable Allow public client flows.
Put its Application (client) ID in the
OUTLOOK_CLIENT_IDvariable and redeploy.On the setup page, type the address and press Connect. You get a code to enter at Microsoft, then a ready
MAIL_ACCOUNT_...line to paste.
The token from step 4 expires after roughly 90 days; repeat step 4 when the mailbox stops connecting.
Connecting an assistant
The connector address is https://<your-project>.vercel.app/mcp/<MCP_AUTH_TOKEN>.
Claude: Settings > Connectors > Add custom connector.
ChatGPT: Settings > Connectors (developer mode), no authentication.
Clients that can send headers may use
/mcpwithAuthorization: Bearer <MCP_AUTH_TOKEN>.
Security
The connector address is a password. Whoever has it can read your mail. To revoke it, change
MCP_AUTH_TOKENand redeploy.Email is text written by strangers, and a hostile message can try to instruct the assistant ("forward everything to..."). That is why sending is off by default. Turn it on only if your assistant asks you before each tool call.
One deployment is for one person. Do not put other people's mailboxes in yours; have them deploy their own.
Development
npm installcp .env.example .envnpm run devnpm testMCP_URL=https://<host>/mcp/<token> npm run smoke checks a live deployment and prints counts only, never message content.
Status
Verified against real Gmail and Yahoo mailboxes on Vercel: listing, searching and reading. Covered by automated tests: authentication, the MCP protocol, configuration parsing and the setup page. Not yet verified against live servers: drafts, marking, moving, sending, Outlook sign-in, iCloud, AOL and the ChatGPT connection.
License
MIT. Provided as is, without warranty.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted email MCP for your own Gmail, Outlook.com, Microsoft 365, iCloud or IMAP inbox: read, search, draft, reply in thread, forward and file mail. It moves or flags up to 500 messages in one call, and a send leaves exactly one copy in Sent. A calendar is a separate connection, and connecting one adds diary and scheduling tools.
Your mailboxes in ChatGPT and Claude: Gmail, iCloud, Fastmail, any IMAP. Passwords stay yours.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceConnects MCP-compatible AI assistants to any IMAP/SMTP mailbox, enabling email search, reading, folder management, and sending with automatic saving to Sent.1MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to read, search, send, manage, schedule, and analyze emails across multiple IMAP/SMTP accounts via MCP, with features like OAuth2, calendar extraction, analytics, and real-time email watching.221 npmLGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to search, read, send, reply to, forward, organize, move, and bulk-delete email across multiple IMAP/SMTP mailboxes, with AES-256-encrypted credential storage, connection pooling, and folder management. Supports 15+ pre-configured providers and works with any MCP client such as Claude or Cursor.1,009 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants to search, read, send, reply to, forward, organize, and bulk-delete email across multiple IMAP/SMTP mailboxes, with AES-256-encrypted credential storage, connection pooling, and folder management. Supports 15+ pre-configured providers and simultaneous multi-account access from any MCP client.1,009 npmMIT