Skip to main content
MCP server CX Codex

mailbox-mcp — Claude Code MCP server: what it does, how to install

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

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add mailbox-mcp -e MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> -- npx -y mailbox-mcp
Open on GitHub

What mailbox-mcp 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.

What it helps with

  • 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 for the agent

  • 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

How to install mailbox-mcp

Platform CLI

claude mcp add mailbox-mcp -e MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> -- npx -y mailbox-mcp

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about mailbox-mcp

How do I install mailbox-mcp in Claude Code?

Run claude mcp add mailbox-mcp -e MAILBOX_MCP_PASSPHRASE=<MAILBOX_MCP_PASSPHRASE> -- npx -y mailbox-mcp with your chosen encryption passphrase.

What does mailbox-mcp do?

It connects email providers such as Gmail, IMAP, and JMAP to your AI agent. Tools allow searching, reading, drafting messages, and organizing labels.

How does mailbox-mcp prevent prompt injection attacks?

It strips hidden HTML elements and invisible unicode characters before returning data. Untrusted email bodies are enclosed in random nonces, and outbound actions to unseen addresses trigger confirmation checks.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor