Email (IMAP/SMTP) — Claude Code MCP server: mailbox for your agent
Wires a mailbox into your coding agent so it can read, search, draft and send mail over IMAP and SMTP. Handy when triaging an inbox or writing a reply without leaving the chat.
claude mcp add --env EMAIL_IMAP_EMAIL=<EMAIL_IMAP_EMAIL> --env EMAIL_IMAP_PASSWORD=<EMAIL_IMAP_PASSWORD> --env EMAIL_IMAP_PROVIDER=<EMAIL_IMAP_PROVIDER> --env EMAIL_IMAP_IMAP_HOST=<EMAIL_IMAP_IMAP_HOST> --env EMAIL_IMAP_SMTP_HOST=<EMAIL_IMAP_SMTP_HOST> --transport stdio email-imap -- npx -y @mindstone/mcp-server-email-imapWhat Email (IMAP/SMTP) does
The server exposes 17 tools covering mailboxes, messages, drafts and sending. iCloud Mail, Gmail, Yahoo Mail, Outlook and Microsoft 365 work out of the box, and any custom IMAP provider can be configured. Provider detection runs off the address domain; an unrecognised domain makes the server refuse to start instead of quietly picking a default.
Authentication uses an app-specific password, not your normal account login. Set it as EMAIL_IMAP_PASSWORD alongside EMAIL_IMAP_EMAIL. Custom providers also need EMAIL_IMAP_IMAP_HOST and EMAIL_IMAP_SMTP_HOST. Node.js 20+ and npm are required.
Sending is fenced in by two caps. EMAIL_IMAP_MAX_RECIPIENTS limits how many people one call can reach, and EMAIL_IMAP_RATE_LIMIT_PER_HOUR limits how many sends fit in the rolling window; going over returns a structured error with a reset time. Attachments land in a private staging folder under MCP_WORKSPACE_PATH, and outbound files are only accepted from inside that folder — anything else, symlinks included, gets rejected.
What it helps with
- triage an inbox and pull messages from one sender
- draft a reply from an existing thread
- send a file from the workspace as an attachment
- find a message by subject or date
- move messages between mailbox folders
Example prompts for the agent
- Show me the last week of mail from clients
- Draft a reply to the message titled "March invoice"
- Send
report.pdfto the address in the latest email
How to install Email (IMAP/SMTP)
Platform CLI
claude mcp add --env EMAIL_IMAP_EMAIL=<EMAIL_IMAP_EMAIL> --env EMAIL_IMAP_PASSWORD=<EMAIL_IMAP_PASSWORD> --env EMAIL_IMAP_PROVIDER=<EMAIL_IMAP_PROVIDER> --env EMAIL_IMAP_IMAP_HOST=<EMAIL_IMAP_IMAP_HOST> --env EMAIL_IMAP_SMTP_HOST=<EMAIL_IMAP_SMTP_HOST> --transport stdio email-imap -- npx -y @mindstone/mcp-server-email-imapReplace <…> with your own values. 6 more environment variables are in the server README
Platform CLI
codex mcp add email-imap --env EMAIL_IMAP_EMAIL=<EMAIL_IMAP_EMAIL> --env EMAIL_IMAP_PASSWORD=<EMAIL_IMAP_PASSWORD> --env EMAIL_IMAP_PROVIDER=<EMAIL_IMAP_PROVIDER> --env EMAIL_IMAP_IMAP_HOST=<EMAIL_IMAP_IMAP_HOST> --env EMAIL_IMAP_SMTP_HOST=<EMAIL_IMAP_SMTP_HOST> -- npx -y @mindstone/mcp-server-email-imapReplace <…> with your own values. 6 more environment variables are in the server README
Config file
{
"mcpServers": {
"email-imap": {
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-email-imap"
],
"env": {
"EMAIL_IMAP_EMAIL": "<EMAIL_IMAP_EMAIL>",
"EMAIL_IMAP_PASSWORD": "<EMAIL_IMAP_PASSWORD>",
"EMAIL_IMAP_PROVIDER": "<EMAIL_IMAP_PROVIDER>",
"EMAIL_IMAP_IMAP_HOST": "<EMAIL_IMAP_IMAP_HOST>",
"EMAIL_IMAP_SMTP_HOST": "<EMAIL_IMAP_SMTP_HOST>"
}
}
}
}Replace <…> with your own values. 6 more environment variables are in the server README
Config file
{
"servers": {
"email-imap": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-email-imap"
],
"env": {
"EMAIL_IMAP_EMAIL": "<EMAIL_IMAP_EMAIL>",
"EMAIL_IMAP_PASSWORD": "<EMAIL_IMAP_PASSWORD>",
"EMAIL_IMAP_PROVIDER": "<EMAIL_IMAP_PROVIDER>",
"EMAIL_IMAP_IMAP_HOST": "<EMAIL_IMAP_IMAP_HOST>",
"EMAIL_IMAP_SMTP_HOST": "<EMAIL_IMAP_SMTP_HOST>"
}
}
}
}Replace <…> with your own values. 6 more environment variables are in the server README
Platform CLI
gemini mcp add -e EMAIL_IMAP_EMAIL=<EMAIL_IMAP_EMAIL> -e EMAIL_IMAP_PASSWORD=<EMAIL_IMAP_PASSWORD> -e EMAIL_IMAP_PROVIDER=<EMAIL_IMAP_PROVIDER> -e EMAIL_IMAP_IMAP_HOST=<EMAIL_IMAP_IMAP_HOST> -e EMAIL_IMAP_SMTP_HOST=<EMAIL_IMAP_SMTP_HOST> email-imap npx -y @mindstone/mcp-server-email-imapReplace <…> with your own values. 6 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Email (IMAP/SMTP)
How do I install Email (IMAP/SMTP) in Claude Code?
Run `claude mcp add mcp-server-email-imap -e EMAIL_IMAP_EMAIL=<EMAIL_IMAP_EMAIL> -e EMAIL_IMAP_PASSWORD=<EMAIL_IMAP_PASSWORD> -- npx -y @mindstone/mcp-server-email-imap`, replacing the placeholders with your address and app password.
What does Email (IMAP/SMTP) do?
It gives an agent IMAP and SMTP access to a mailbox: reading, searching, drafts and sending. iCloud, Gmail, Yahoo, Outlook and custom IMAP providers are supported.
Which password does it need?
An app-specific password rather than your regular mailbox password. It goes into the EMAIL_IMAP_PASSWORD variable.