Mcp4mail logo

Mcp4mail

Read, search, and optionally organize IMAP mail through MCP, with per-mailbox permissions and human-approved sending.

Install Mcp4mail

Pick your client, then add it in one click or paste the config.

Streamable HTTP (Remote)
Server URL
https://mcp4mail.online/mcp

Remote servers are added in the app, not the config file: Customize → Connectors → Add custom connector, then paste this URL.

Claude Code command
claude mcp add --transport http mcp4mail https://mcp4mail.online/mcp

Run in your terminal, then run /mcp in Claude Code to sign in if the server asks.

Overview

mcp4mail connects MCP clients to IMAP mailboxes for account and folder discovery, message search, reading, attachments, and contact lookup. It is available as a hosted endpoint or can be self-hosted with Docker, using OAuth 2.1 for authorization and encrypted mailbox-password storage. Mailboxes are read-only by default, while individual write permissions can enable flags, moves, folders, drafts, trash, and approved sending. Reach for it when an AI assistant needs controlled access to one or more IMAP accounts without granting unrestricted mailbox changes.

Use cases

  • Search an IMAP mailbox by sender, subject, date, or attachment name
  • Read messages and retrieve relevant attachments through an AI client
  • Find contacts from previous email correspondence
  • Organize mail with explicitly enabled flags, moves, folders, and Trash actions
  • Prepare drafts and send approved email

Key features

  • IMAP account and folder discovery
  • Message and contact search
  • Message and attachment retrieval
  • Per-mailbox write permissions
  • Human-approved email sending
  • Hosted or Docker-based self-hosting

Tools14

What Mcp4mail lets your agent do. Expand a tool for its parameters.

Self-reported~231 tokens of context

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.

14/14 checks healthy over the last 52d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit3d agoMost recent push to the default branch.
Tools exposed14Callable tools this server registers over MCP.

How Mcp4mail works

What mcp4mail does

mcp4mail exposes an IMAP mailbox through the Model Context Protocol. Connected clients can list available accounts and folders, search messages by subject, participants, attachment name, or date, and retrieve message content. The server can also find contacts based on previous correspondence and provide access to attachments through short-lived links or inline file content up to 5 MB.

Mailbox changes are supported but gated. Each account starts in read-only mode, and an owner must enable AI changes and select the permitted operations. Available write actions include changing flags and read status, moving messages, creating folders, moving mail to Trash, saving drafts, and preparing outgoing messages. Sending requires a separate human approval step after the message is prepared.

How it works

The hosted service uses the MCP endpoint at https://mcp4mail.online/mcp; self-hosted deployments use their own /mcp URL. An MCP client connects to the endpoint after the user signs in and selects the connected mail account. Tools resolve accounts within the authenticated user’s scope, so an account identifier belonging to another user is rejected.

Mail is accessed over IMAP with a username and password. The server opens folders for inspection without marking messages as seen. It also stores message headers—such as sender, recipients, subject, date, flags, and size—in its database and refreshes them every 15 minutes to support searching.

Setup and configuration

For the hosted option, create an account at mcp4mail.online, connect an IMAP mailbox, and add the MCP URL to a compatible client. To run the application yourself, copy .env.example to .env, provide the configuration values, and start the services with Docker Compose:

bash
cp .env.example .env
docker compose up -d

Self-hosted production deployments need a public URL whose value matches HITCH_RESOURCE_URI exactly. Mailbox passwords are encrypted at rest with Rails Active Record Encryption. Production keys can be supplied through encrypted credentials or the ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY, ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY, and ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT variables.

Use an app-specific password when the mail provider supports one. Gmail, iCloud, Fastmail, Outlook.com, and Yahoo are listed as examples; Gmail accounts require two-step verification and an app password. Google Workspace administrators may restrict IMAP or app-password use.

Tools and capabilities

The 14 MCP tools cover:

  • Account and folder discovery with list_mail_accounts, get_mail_account, and list_folders.
  • Message search and retrieval with search_messages and get_message.
  • Attachment retrieval with get_attachment.
  • Contact lookup through search_contacts.
  • Delivery checks through get_outgoing_status.
  • Controlled mailbox changes with set_flags, move_message, trash_message, create_folder, and create_draft.
  • Human-approved outgoing mail through send_message.

Limitations and notes

Write tools are refused unless the mailbox owner enables the corresponding permission. send_message prepares an email but does not send it automatically; the message is released only after the owner approves it. Inline attachment responses are limited to 5 MB, while other attachments are represented by short-lived download links.

Reading mail still exposes its contents to the connected AI client, so only trusted clients should be authorized. The service applies a limit of 120 requests per minute for each user and client pair.

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 Mcp4mail

mcp4mail is an MCP server that connects AI clients to IMAP mailboxes. Its main tools list accounts and folders, search and read messages, retrieve attachments, find contacts, manage selected mailbox items, save drafts, and prepare email for human-approved sending.

Use the hosted endpoint or self-host it with Docker Compose. For self-hosting, copy `.env.example` to `.env`, fill in the configuration, and run `docker compose up -d`; the MCP endpoint is your instance’s `/mcp` URL.

Add `https://mcp4mail.online/mcp` for the hosted service, or the `/mcp` URL of your self-hosted instance. Then sign in, connect an IMAP account, and configure the endpoint in the client.

No. `send_message` only prepares an email, and the message is sent after a human approves it. Mailbox owners must also enable AI changes and the relevant sending permission for that account.

Yes. Every mailbox starts read-only, and write tools are refused until the owner enables mailbox changes and selects the matching permission. Reading uses IMAP folder inspection that does not mark messages as seen.

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 PreviewMcp4mail AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp4mail?style=directory)](https://allmcps.com/mcp/mcp4mail)
HTML Embed
<a href="https://allmcps.com/mcp/mcp4mail"><img src="https://allmcps.com/api/badge/mcp4mail?style=directory" alt="Mcp4mail on AllMCPs" /></a>