Selfhost Remote Mail MCP logo

Selfhost Remote Mail MCP

by Self-hosted-MCP

Self-hosted email access for AI apps with IMAP/SMTP reading, drafting, attachments, and explicit send approval.

Install Selfhost Remote Mail MCP

Run the project’s own setup commands, in order.

Setup steps from the project

Self-hosted-MCP/Selfhost-Remote-Mail-MCP installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    uv tool install git+https://github.com/Self-hosted-MCP/Selfhost-Remote-Mail-MCP
    
  2. 2. Configure
    selfhost-remote-mail-mcp setup
    
  3. 3. Add to Claude Code
    claude mcp add -s user mail -- selfhost-remote-mail-mcp stdio
    

Overview

Self-hosted-MCP/Selfhost-Remote-Mail-MCP connects AI applications to IMAP and SMTP mailboxes that you operate, including providers such as Gmail, iCloud, Fastmail, Yahoo, and Zoho. It lets an AI read, search, sort, inspect attachments, and create drafts while keeping credentials and mail on your own computer or server. Sending is a separate user-approved action, and uploaded chat files can be added to drafts as attachments. Reach for it when you want email assistance across desktop or phone without routing mailbox access through a hosted intermediary.

Use cases

  • Search inboxes for urgent or recent messages
  • Draft replies without sending them immediately
  • Attach files dropped into an AI chat
  • Manage several mailboxes from an AI application
  • Review and send approved email on request

Key features

  • IMAP mailbox reading and search
  • SMTP email sending with draft-first safety
  • New emails, replies, reply-all, and forwards
  • Attachment viewing and chat file uploads
  • Support for up to five mailboxes
  • Self-hosted computer, cloud, or Docker deployment

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

9/9 checks healthy over the last 32d

How Selfhost Remote Mail MCP works

What Self-hosted-MCP/Selfhost-Remote-Mail-MCP does

Self-hosted-MCP/Selfhost-Remote-Mail-MCP gives MCP-compatible AI applications access to mailboxes through the standard IMAP and SMTP protocols. It supports common hosted providers and mailboxes on custom domains, with support for up to five mailboxes. The server runs under your control, so mailbox passwords, mail content, uploads, and application state stay within your deployment rather than being handled by a separate service operated by the project authors.

The email workflow is intentionally draft-first. An AI can inspect messages, prepare a new email, reply, reply to all, or forward a message, but the result is saved to the mailbox's normal Drafts folder. A separate instruction is required before the message is sent.

How it works

An AI application communicates with the server using MCP. The server then connects to the configured mailbox as a regular email client: IMAP is used for reading and searching, while SMTP handles outgoing mail. This arrangement allows the AI application to work with the mailbox without requiring a proprietary email integration.

Attachments can move in both directions. The AI can open images, PDFs, and text files from messages. A file dropped into a compatible chat can be uploaded to the server, attached to a draft, and presented for review before sending. The attachment workflow supports files up to 25 MB.

Setup and configuration

The project can run on a Mac, Windows, or Linux computer, on a hosting provider such as Railway or Render, or on another server using Docker. A computer deployment exposes a local settings page at localhost:8765; phone access requires the computer to remain on and use a tunnel. A hosted deployment is intended for continuous access from a phone or other remote client.

On Claude Desktop, the project provides an extension that can be downloaded, opened, and configured with a passphrase without using a terminal. Other deployment paths use a settings file or the hosting provider's variables interface. The server stores configuration and state separately; the documented computer locations are ~/.config/selfhost-remote-mail-mcp/.env for settings and ~/.config/selfhost-remote-mail-mcp/state for state. Docker and hosted deployments use /data for the data directory.

Each mailbox requires the provider's IMAP and SMTP details and credentials. Providers that require one, including Gmail, iCloud, and Yahoo, use an app password rather than the account's primary password. A server passphrase protects the settings page and is used when connecting an AI application over the internet.

Tools and capabilities

  • List and search folders with filters such as from:sam is:unread newer_than:7d.
  • Open complete conversations and inspect image, PDF, and text attachments.
  • Create new drafts, replies, reply-all messages, and forwards.
  • Apply mailbox signatures and saved templates to drafts.
  • Upload chat files and attach them to draft messages.
  • Send a reviewed message only after an explicit request.
  • Use multiple configured mailboxes, with access selected for each connected AI application.

Limitations and notes

The server depends on mailbox providers exposing compatible IMAP and SMTP services. Phone access from a computer deployment is available only while that computer is running and reachable through a tunnel. Files intended as programs are refused, and potentially risky files such as macro-enabled spreadsheets require confirmation. AI applications that cannot upload a dropped file use a link-based upload flow instead.

The project is licensed under AGPL-3.0. It is designed for self-hosting, so deployment, mailbox credentials, passphrase protection, and remote exposure remain part of the operator's responsibility.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Selfhost Remote Mail MCP

Self-hosted-MCP/Selfhost-Remote-Mail-MCP is an MCP server that connects AI applications to IMAP and SMTP mailboxes. Its main tools read, search, and inspect email, open attachments, create new messages or replies as drafts, attach uploaded files, and send messages only after the user explicitly requests sending.

You can run it on a Mac, Windows, or Linux computer, deploy it through Railway or Render, or use Docker on your own server. Claude Desktop also supports a downloadable extension that you open and configure with a passphrase.

Yes, Cursor is named as an AI application that can use the server, including the workflow for uploading a file from chat and attaching it to a draft.

No, sending is a separate user-approved action. The AI creates or updates a draft in the mailbox's normal Drafts folder first, and the message is sent only after you ask it to send.

It works with mailboxes that provide IMAP and SMTP access, including Gmail, iCloud, Fastmail, Yahoo, Zoho, and mailboxes on custom domains. Gmail, iCloud, and Yahoo require an app password.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewSelfhost Remote Mail MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/self-hosted-mcp-selfhost-remote-mail-mcp?style=directory)](https://allmcps.com/mcp/self-hosted-mcp-selfhost-remote-mail-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/self-hosted-mcp-selfhost-remote-mail-mcp"><img src="https://allmcps.com/api/badge/self-hosted-mcp-selfhost-remote-mail-mcp?style=directory" alt="Selfhost Remote Mail MCP on AllMCPs" /></a>