
Email MCP Server (IMAP/SMTP)
Provider-agnostic email MCP over IMAP/SMTP — read, search and send from any mailbox
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx mcp-email-server@latest stdioPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"email-mcp-server-imap-smtp": {
"command": "uvx",
"args": [
"mcp-email-server@latest",
"stdio"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Python 3.10+ with the uv package manager (or use the prebuilt Docker image ghcr.io/ai-zerolab/mcp-email-server)
- IMAP server details for reading: host, port, SSL/STARTTLS settings
- SMTP server details for sending (optional — omit to run read-only): host, port, SSL/STARTTLS settings
- Mailbox credentials: email address, username, and password. For Gmail or other 2FA providers, generate an app-specific password rather than using your account password
- For ProtonMail, run ProtonMail Bridge locally and point IMAP/SMTP at it
About Email MCP Server (IMAP/SMTP)
mcp-email-server (by ai-zerolab) is a self-hosted, provider-agnostic email MCP server. It talks plain IMAP for reading/searching and SMTP for sending, so it works with any mailbox — Gmail, ProtonMail Bridge, Fastmail, a corporate Exchange/IMAP host, or a self-signed internal server — without depending on any vendor API.
It runs locally over stdio (typically launched with uvx mcp-email-server@latest stdio) and is configured per account via environment variables prefixed MCP_EMAIL_SERVER_ or a TOML file at ~/.config/zerolib/mcp_email_server/config.toml. Multiple accounts are supported, and you can omit the SMTP block to run in read-only mode (send/compose tools are then hidden).
Useful touches include optional attachment download, automatic saving of sent mail to the IMAP Sent folder (with auto-detection of common Sent folder names), reply threading via in_reply_to/references headers, and toggles for SSL/STARTTLS and certificate verification for self-signed setups. It ships on PyPI and as a Docker image (ghcr.io/ai-zerolab/mcp-email-server).
Tools & capabilities (4)
get_emails_contentRead, list, search and page through messages from a configured IMAP account
send_emailCompose and send a message over SMTP (hidden when SMTP is not configured)
download_attachmentDownload a message attachment to local disk (when attachment download is enabled)
save_to_mailboxSave a message into an IMAP folder, e.g. the Sent folder after sending
When to use it
- Use it when you want an agent to read and search a mailbox without granting OAuth access to a cloud provider
- Use it when you need to send or reply to email from any standard IMAP/SMTP account, including self-hosted ones
- Use it when you work with ProtonMail Bridge or a corporate Exchange server that exposes IMAP/SMTP
- Use it when you need multiple email accounts available to one assistant at once
- Use it when you want a strictly read-only email integration (configure IMAP only, leave SMTP off)
- Use it when your mail server uses self-signed certificates and you need to disable cert verification
Quick setup
- 1Install with `uvx mcp-email-server@latest stdio`, `pip install mcp-email-server`, or pull the Docker image
- 2Gather your IMAP (and optionally SMTP) host/port/SSL settings and an app password for your mailbox
- 3Configure an account via MCP_EMAIL_SERVER_* environment variables or the TOML file at ~/.config/zerolib/mcp_email_server/config.toml
- 4Add the server to your MCP client (e.g. Claude Desktop) with command `uvx` and args `["mcp-email-server@latest", "stdio"]`
- 5Restart the client and confirm the email tools appear
- 6Verify by asking the agent to list recent messages, then test a send if SMTP is configured
Security notes
Stores mailbox usernames and passwords (or app passwords) in a plaintext TOML config (~/.config/zerolib/mcp_email_server/config.toml) or env vars — use provider app-passwords rather than your primary password and protect that file. Omit the SMTP host to keep an account strictly read-only.
Email MCP Server (IMAP/SMTP) FAQ
Which email providers does it support?
Any provider that speaks standard IMAP and SMTP. Gmail and ProtonMail (via Bridge) are documented examples, but Fastmail, Outlook/Exchange over IMAP, and self-hosted servers all work.
How do I authenticate with Gmail?
Use an app-specific password generated in your Google account rather than your normal password, since Gmail blocks basic-auth logins on accounts with 2FA. There is no OAuth flow — it logs in with username/password over IMAP/SMTP.
Can I run it read-only?
Yes. Configure only the IMAP settings and leave SMTP unset; the send and compose tools are then hidden so the agent can only read and search mail.
It can't find or save to my Sent folder — why?
The server auto-detects common Sent folder names, but providers vary. Set MCP_EMAIL_SERVER_SENT_FOLDER_NAME to your provider's exact folder name (e.g. "[Gmail]/Sent Mail").
Does it work with self-signed certificates?
Yes. Set the IMAP/SMTP VERIFY_SSL options to false (and adjust SSL/STARTTLS flags) to connect to internal servers with self-signed certs.
Alternatives to Email MCP Server (IMAP/SMTP)
Compare all alternatives →Connect your personal WhatsApp: search, read and send messages and media locally
Powerful Slack MCP with stdio/SSE/HTTP, DMs, group DMs and no-admin token auth
Full Telegram user-account MCP via MTProto: read chats, manage groups, send messages
Compare Email MCP Server (IMAP/SMTP) with: