Selfhost-Remote-Mail-MCP is a self-hosted mail MCP server used to connect a user's own mailbox to AI applications such as Claude, ChatGPT, and Codex. It communicates with AI applications via MCP (Model Context Protocol) and then connects to the mailbox using standard mail protocols (IMAP/SMTP), so no third-party cloud service is needed, and the author cannot see the user's email, passwords, or any data. The project uses the AGPL-3.0 open source license and can be freely used, modified, and distributed.
Main capabilities include: reading email (listing and searching all folders, supporting filters such as from:, is:unread, newer_than:, and opening full conversations and attachments); composing email (creating new messages, reply, reply all, and forward drafts, automatically adding signatures and templates, with drafts saved in the regular Drafts folder); attachment handling (drag and drop files in chat to send them as attachments, supporting files from other emails, local files, AI-generated files, or phone uploads, up to 25MB, rejecting program files, requiring confirmation for suspicious files, removing location information from photos, and removing author names from documents); organizing email (archiving, moving, deleting to Trash, marking as read/unread, pinning, marking as spam, and displaying unsubscribe links but not clicking them); cautious sending (only the two tools send_email and schedule_send can send, and it is recommended to set "always ask" in the AI application; scheduled sending is supported, with the time saved on the draft); contacts (finding frequent contacts from email history); calendar plugin (viewing via CalDAV, finding free time, adding/modifying/deleting events, with double confirmation before deletion, and no invitations or email notifications to others); multi-mailbox support (up to 5, each can be set to full, drafts-only, or read-only mode, and each AI application can be assigned accessible mailboxes); settings page (add mailboxes at /settings, test login, rename, manage AI application connections, privacy options, plugin toggles, view logged-in devices and AI change records); privacy protection (removing photo location and document author information before sending attachments, and the server does not load images or links in emails to prevent tracking); language support (the web page supports 20 languages and follows the browser); plugin system (calendar, invoices, scam warnings, etc., off by default, can be enabled with one click on the settings page, or enabled via command line); update notifications (can receive new version notifications or automatically update the official version).
Usage: Quick start (option 1, about 5 minutes) requires installing uv, then running uv tool install git+https://github.com/Self-hosted-MCP/Selfhost-Remote-Mail-MCP Install the server, then run selfhost-remote-mail-mcp setup to set a password and start it, add mailboxes on the settings page, and finally connect it in an AI application (e.g., Claude Code uses claude mcp add -s user mail -- selfhost-remote-mail-mcp stdio). You can also choose one-click deployment to Railway or Render (option 2), or download the extension for Claude Desktop and double-click to install. Docker hosting is supported.
Use cases: users who want an AI assistant to help handle personal or work email (e.g., summarizing the inbox, searching emails, drafting replies, sending attachments) but value privacy; teams or individuals who need multi-mailbox management; users of AI applications such as Claude, ChatGPT, Codex, and Cursor.
Limitations: Outlook.com, Hotmail, and Live accounts, as well as Microsoft 365 accounts that require Microsoft sign-in, are not currently supported; using Proton Mail via Proton Bridge is not currently supported; the calendar plugin does not currently support Google, Microsoft 365, or Outlook.com calendars (only CalDAV, such as iCloud, Fastmail, and Nextcloud). Sending is limited by default (at most 40 messages per mailbox per day and at most 3 per minute), and a recipient allowlist or read-only mode can be configured.