# your-mail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/wildsurfer/your-mail-mcp  
**GitHub Stars:** 21  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/your-mail-mcp

## Description
Read-only, self-hosted MCP access to IMAP email, mirrored locally and indexed by notmuch.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/wildsurfer/your-mail-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
docker compose up -d
```

2. Configure:

```sh
mkdir your-mail && cd your-mail
```

3. Configure:

```sh
curl -fsSLO https://raw.githubusercontent.com/wildsurfer/your-mail-mcp/main/compose.yaml
```

4. Configure:

```sh
curl -fsSL https://raw.githubusercontent.com/wildsurfer/your-mail-mcp/main/accounts.example.json -o accounts.json
```

5. Check the setup:

```sh
docker compose logs -f     # watch the first sync
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/your-mail-mcp/readme_

