# mailbox-mcp

Connects Gmail, IMAP, and JMAP mailboxes to your AI workflow. Reads threads, drafts replies, and filters hidden prompt injections.

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

## What it does

mailbox-mcp exposes mail accounts to MCP clients without running separate processes for each inbox. It handles standard Gmail API connections alongside generic IMAP/SMTP setups and JMAP providers such as Fastmail. The suite includes 49 tools covering search, attachments, filters, drafts, and label management.

Reading messages exposes models to untrusted inputs, so the server wraps raw email content in nonced boundaries. Hidden styles, zero-size fonts, off-screen text, and control characters are stripped before reaching the model. If content was deleted, the server warns about the character count. Outbound traffic is constrained by default to 10 sends per minute and 100 per day.

Stored credentials rely on AES-256-GCM encryption, meaning `MAILBOX_MCP_PASSPHRASE` is mandatory at startup. For strict security, accounts can run in `draftsOnly` mode or require confirmation in an interactive terminal via `/dev/tty`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `MAILBOX_MCP_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 mailbox-mcp -e MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> -- npx -y mailbox-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mailbox-mcp --env MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> -- npx -y mailbox-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mailbox-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "mailbox-mcp"
            ],
            "env": {
                "MAILBOX_MCP_PASSPHRASE": "<MAILBOX_MCP_PASSPHRASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mailbox-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mailbox-mcp"
            ],
            "env": {
                "MAILBOX_MCP_PASSPHRASE": "<MAILBOX_MCP_PASSPHRASE>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> mailbox-mcp npx -y mailbox-mcp
```
Replace <…> with your own values

## When to use it
- search across work and personal inboxes inside terminal workflows
- draft contextual email responses without leaving the editor
- strip concealed prompt injections and invisible characters from incoming mail
- enforce manual confirmation on outbound mail to unknown recipients

## Example prompts
- Find all unread invoices received this week across my configured accounts
- Draft a reply to the latest client thread in my Fastmail mailbox
- Summarize recent unread notifications and apply the archive label

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