# your-mail-mcp

A local read-only server that searches your IMAP mailboxes. It surfaces old invoices, agreements, and credentials directly into your AI assistant session.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 18
- Author: wildsurfer
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/wildsurfer/your-mail-mcp
- Updated: 2026-10-05
- HTML: https://affpapa.org/en/nevibecode/mcp/your-mail-mcp

## What it does

The server mirrors IMAP accounts into a local maildir using `mbsync` and builds a full-text search index with `notmuch`. It answers tool calls entirely from this offline data. The AI reads email history without sending data to external hosted search engines.

Safety is enforced at the process level. The tool has no logic to send or delete messages. Its Go codebase contacts mail providers solely with the IMAP `LIST` command to detect spam and trash folder names, leaving message bodies untouched.

Docker is the only system requirement. Provider quirks need attention: Gmail requires an app password with two-factor authentication enabled, while iCloud rejects the full address and requires just the account name.

## Requirements
- Needs: Docker
- Environment variables: `PUBLIC_URL`, `OAUTH_PASSPHRASE` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env PUBLIC_URL=<PUBLIC_URL> --env OAUTH_PASSPHRASE=<OAUTH_PASSPHRASE> --transport stdio your-mail-mcp -- docker run -i --rm -e PUBLIC_URL -e OAUTH_PASSPHRASE ghcr.io/wildsurfer/your-mail-mcp:0.4.0
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add your-mail-mcp --env PUBLIC_URL=<PUBLIC_URL> --env OAUTH_PASSPHRASE=<OAUTH_PASSPHRASE> -- docker run -i --rm -e PUBLIC_URL -e OAUTH_PASSPHRASE ghcr.io/wildsurfer/your-mail-mcp:0.4.0
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "your-mail-mcp": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "PUBLIC_URL",
                "-e",
                "OAUTH_PASSPHRASE",
                "ghcr.io/wildsurfer/your-mail-mcp:0.4.0"
            ],
            "env": {
                "PUBLIC_URL": "<PUBLIC_URL>",
                "OAUTH_PASSPHRASE": "<OAUTH_PASSPHRASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "your-mail-mcp": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "-e",
                "PUBLIC_URL",
                "-e",
                "OAUTH_PASSPHRASE",
                "ghcr.io/wildsurfer/your-mail-mcp:0.4.0"
            ],
            "env": {
                "PUBLIC_URL": "<PUBLIC_URL>",
                "OAUTH_PASSPHRASE": "<OAUTH_PASSPHRASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e PUBLIC_URL=<PUBLIC_URL> -e OAUTH_PASSPHRASE=<OAUTH_PASSPHRASE> your-mail-mcp docker run -i --rm -e PUBLIC_URL -e OAUTH_PASSPHRASE ghcr.io/wildsurfer/your-mail-mcp:0.4.0
```
Replace <…> with your own values

## When to use it
- locate booking references and Wi-Fi credentials across older messages
- pull project requirements from an email thread directly into a coding task
- track chronological agreements between parties in a message chain
- review unread incoming mail from multiple inboxes without write access

## Example prompts
- Look up the confirmation code for the hotel reservation I made last month.
- Extract the client design specifications from the recent email exchange.
- Give me a summary of incoming work messages received overnight.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
