Labsco
mexican75 logo

simple-email-mcp

β˜… 2

from mexican75

Dead-simple multi-account email MCP server β€” IMAP/SMTP, attachments, HTML, calendar invites, optional send gate. Works with any provider.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

simple-email-mcp

A provider-agnostic MCP server for email (IMAP/SMTP). Works with any email provider β€” Purelymail, Gmail, Outlook, DomainFactory, or any standard IMAP/SMTP server.

Built for Claude Desktop, Claude Code, and any MCP-compatible client.

Features

  • Multi-account β€” manage multiple email accounts from different providers
  • Read, search, list β€” full IMAP support with folder browsing
  • Send emails β€” plain text, HTML, or both (multipart/alternative)
  • Attachments β€” send via file path or base64-encoded inline data
  • Download attachments β€” extract attachments from received emails as base64
  • Calendar invites β€” send proper ICS invitations with Accept/Decline buttons
  • Save to Sent β€” automatically saves sent emails to the Sent folder via IMAP
  • Optional send gate β€” configurable confirmation code to prevent accidental sends
  • International folders β€” handles UTF-7 encoded folder names (German, etc.)
  • Compact MCP surface β€” one email tool with lazy action discovery to reduce client context use

Tools

Version 2 exposes a single MCP tool named email. Call it with only an action to discover that action's parameters, then call it again with params.

{"action": "send"}
{
  "action": "send",
  "params": {
    "account": "work",
    "to": "recipient@example.com",
    "subject": "Hello",
    "body": "Message body"
  }
}
ActionDescription
validate_configValidate config without logging into IMAP/SMTP
list_accountsList configured accounts
list_foldersList IMAP folders for an account
list_emailsList recent emails in a folder
searchSearch emails using IMAP criteria
readRead full email content by UID
get_attachmentDownload an attachment as base64
prepare_attachmentsInspect local attachment paths before sending
save_attachmentSave an attachment directly to disk (preferred for large files)
sendSend an email (text, HTML, attachments, calendar invites)
replyReply to an email (auto-sets recipient, subject, threading, quotes body)
reply_allReply all (sender to To, other recipients to CC, quotes body)
forwardForward an email with original attachments
moveMove an email between folders
markMark as read/unread/flagged/unflagged

list_accounts returns the exact account names plus any configured send_as, display_name, and description, so clients can use the explicit account token instead of guessing partial matches.

Configuration validation

Use validate_config after editing accounts.json or environment variables. It checks required fields, email-like addresses, ports, SMTP security, providers, and placeholder hosts without exposing passwords or logging into IMAP/SMTP.

{
  "action": "validate_config",
  "params": {}
}

Migrating from v1

Most users do not need to change their MCP client configuration. Keep the same simple-email-mcp command and restart the client after upgrading.

The breaking change only affects clients or scripts that call exact v1 tool names such as email_send_email or email_read_email. In v2, use the single email tool with an action instead:

v1 toolv2 action
email_list_accountsemail with action: "list_accounts"
email_send_emailemail with action: "send"
email_read_emailemail with action: "read"
email_search_emailsemail with action: "search"
email_forwardemail with action: "forward"
email_reply_allemail with action: "reply_all"

Sending with attachments

Preflight metadata only (recommended before send):

attachments: "/path/to/file.pdf, /path/to/doc.xlsx"

Call prepare_attachments first to verify resolved paths, file names, sizes, MIME types, and missing files without loading contents into context.

File path (when the MCP server has filesystem access):

attachments: "/path/to/file.pdf, /path/to/doc.xlsx"

Base64 inline (when the caller is in a sandbox):

attachments_inline: [{"filename": "report.pdf", "content_base64": "JVBERi0...", "content_type": "application/pdf"}]

Sending calendar invites

Pass raw ICS content via calendar_ics. The email is structured as multipart/alternative so clients display Accept/Decline buttons:

calendar_ics: "BEGIN:VCALENDAR\r\nVERSION:2.0\r\n..."

Send confirmation gate

If send_code is set in accounts.json, the AI must show the email draft to the user and wait for them to provide the code before sending. This is useful as a workflow checkpoint to reduce accidental sends.

Important: this is not a hard security boundary if the MCP process and the AI runtime can both read the same config source. In that setup, the AI may be able to read the code from accounts.json or environment variables. Remove or clear send_code to disable the checkpoint.

Testing

Run the regression suite from the repo root:

.venv/bin/python -m unittest discover -s tests -v

Security

  • Passwords are stored in accounts.json β€” add it to .gitignore
  • The send_code gate is a user-intent checkpoint, not a hard secret, unless the AI cannot read the config source that contains it
  • No passwords are exposed via the list_accounts action
  • File attachments: The attachments parameter reads files from paths the AI provides. If the MCP server runs with broad filesystem access, the AI could theoretically attach and send any readable file. Use attachments_inline (base64) in sandboxed environments, or restrict filesystem access at the OS/container level.
  • Saving attachments: save_attachment fails if the target file already exists unless overwrite=true is set explicitly.

Provider Notes

Gmail

Use an App Password (not your Google password). Enable IMAP in Gmail settings.

Outlook / Microsoft 365

Use an App Password or enable basic auth for IMAP/SMTP.

Purelymail

Use your Purelymail account password directly.

License

MIT β€” see LICENSE

Authors