Your Mail MCP logo

Your Mail MCP

Read-only, self-hosted email search over locally mirrored IMAP accounts, indexed with notmuch and exposed through MCP.

Install Your Mail MCP

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

Setup steps from the project

your-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. Start the server
    docker compose up -d
    
  2. 2. Configure
    mkdir your-mail && cd your-mail
    
  3. 3. Configure
    curl -fsSLO https://raw.githubusercontent.com/wildsurfer/your-mail-mcp/main/compose.yaml
    
  4. 4. Configure
    curl -fsSL https://raw.githubusercontent.com/wildsurfer/your-mail-mcp/main/accounts.example.json -o accounts.json
    
  5. 5. Check the setup
    docker compose logs -f     # watch the first sync
    

Overview

your-mail-mcp mirrors one or more IMAP accounts into a local maildir, indexes the messages with notmuch, and serves read-only MCP requests against that index. It supports local stdio connections for clients such as Claude Code, Codex, Cursor, and Claude Desktop, plus HTTPS access for connector-based apps. Use it to search email across accounts, inspect recent arrivals, retrieve thread context, or check synchronization progress without giving an agent a path to send, delete, or move messages.

Use cases

  • Search several IMAP accounts for booking references and receipts
  • Summarize overnight arrivals after junk filtering
  • Extract requirements and commitments from an email thread
  • Check whether an initial mailbox synchronization has finished

Key features

  • Read-only IMAP mailbox mirroring
  • Cross-account full-text search with notmuch
  • Local stdio and HTTPS MCP access
  • Synchronization progress reporting
  • Password commands for external secret storage
  • No send, delete, or move operations

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.

16/16 checks healthy over the last 88d

Adoption & maintenance

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

GitHub stars21Stargazers on the source repository.
Last commit8d agoMost recent push to the default branch.

How Your Mail MCP works

What your-mail-mcp does

your-mail-mcp turns one or more IMAP mailboxes into a local, searchable source for MCP clients. It pulls messages into a maildir with mbsync, builds a notmuch index, and answers read-only requests from that local data. Multiple accounts can be combined into one index, making searches span work and personal mail.

Typical queries include finding booking references, extracting details from an old conversation, collecting a thread in chronological order, or identifying messages that arrived overnight. The server can also report synchronization progress through its status tool, which is useful while an initial archive is being downloaded.

The design is intentionally read-only. The process has no route for sending, deleting, or moving messages, and its IMAP connection uses LIST to identify junk and trash folders rather than selecting mailboxes or fetching messages directly.

How it works

A Docker container runs the mail synchronization, indexing, and MCP service. mbsync pulls mail from each configured IMAP account into local storage. notmuch indexes that mirror, and MCP clients query the resulting index rather than querying the provider for every request.

Local clients start a stdio bridge into the running container with Docker. Each client session uses the same stored mail and synchronization state. For remote or mobile access, the service exposes an HTTPS MCP endpoint protected by an OAuth-style passphrase flow. A tunnel such as Tailscale Funnel can provide the public HTTPS address without opening a listener on the home network.

Setup and configuration

Docker is the installation prerequisite. Create a directory containing compose.yaml and an accounts.json file, then start the stack with docker compose up -d. Each account entry includes a name, IMAP host, username, and either a password reference or a pass_cmd that prints the secret at connection time.

Password placeholders in accounts.json are resolved from environment variables passed to the container. Keep the account file, .env, and any secret material out of version control and backups that leave the machine. A command-based secret can instead read from a Docker secret or the local system keychain.

Gmail requires an app password with two-step verification enabled. iCloud expects the short account name before @icloud.com rather than the full address. The initial synchronization makes the current INBOX searchable within minutes, while older mail continues downloading according to provider limits.

For phone or web connector access, set PUBLIC_URL to the exact HTTPS address clients will use and set a long OAUTH_PASSPHRASE, then restart the stack. Add the MCP URL at <PUBLIC_URL>/mcp through the connector settings in Claude or Claude Desktop; the mobile app can then use the connector already configured on the web.

Tools and capabilities

  • Search full-text email across all configured accounts through natural-language MCP requests.
  • Retrieve messages and conversation context from the local notmuch index.
  • Examine recent incoming mail for triage and summaries.
  • Check synchronization progress with the status tool.
  • Connect through stdio or an HTTPS MCP endpoint.
  • Keep the data path read-only with no send, delete, or move operation.

Limitations and notes

The local index must be synchronized before messages can be found. Current INBOX mail usually appears within minutes, but a complete history can take much longer. Gmail limits IMAP downloads to roughly 2.5 GB per day, so a large account may require days for its first mirror; SYNC_TIMEOUT can be increased for that initial run.

Remote access places the MCP endpoint on a public HTTPS address, so protect it with a long passphrase and ensure PUBLIC_URL matches the address entered in the client. The server is intended for read-only access: it cannot change provider-side mail, but the local mirror and index still contain the downloaded messages and require appropriate filesystem protection.

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 Your Mail MCP

your-mail-mcp is an MCP server that connects to one or more IMAP email accounts through a local mbsync mirror and notmuch index. Its main tools let AI clients search and retrieve email context across accounts and check synchronization status. It is read-only, with no operations for sending, deleting, or moving messages.

Install it with Docker by creating `compose.yaml` and `accounts.json`, adding account credentials, and running `docker compose up -d`. The container image is available for amd64 and arm64. Connect local clients through the provided Docker stdio command after the first sync begins.

Yes, your-mail-mcp works with Cursor through stdio. Once the Docker stack is running, add the server using Cursor's MCP installation flow or configure a command that executes `docker exec -i your-mail-mcp your-mail-mcp stdio`. Cursor then uses the shared local index.

Yes, phone access works through an HTTPS connector configured in Claude or ChatGPT. Set `PUBLIC_URL` and `OAUTH_PASSPHRASE`, expose the service through a tunnel such as Tailscale Funnel, and add `<PUBLIC_URL>/mcp` from the web connector settings before enabling it in the phone app.

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