Skip to main content
MCP server CX Codex

imap-mcp — Claude Code MCP server: save IMAP email drafts

imap-mcp is a Claude Code MCP server that connects to mailboxes to save draft messages over IMAP. It places prepared emails into the drafts folder without sending them immediately.

MIT ★ 15 updated 2026-11-19

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env IMAP_HOST=<IMAP_HOST> --env IMAP_PORT=<IMAP_PORT> --env IMAP_USERNAME=<IMAP_USERNAME> --env IMAP_PASSWORD=<IMAP_PASSWORD> --env IMAP_USE_SSL=<IMAP_USE_SSL> --transport stdio imap-mcp -- npx -y imap-mcp
Open on GitHub

What imap-mcp does

The server connects an assistant to standard IMAP mailboxes, such as Gmail or Outlook. Through its single create-draft tool, the model populates the recipient, subject line, and body, then writes the message directly into Drafts or INBOX.Drafts. The sender field defaults to the configured mailbox username when omitted.

Running the tool requires Node.js and explicit IMAP credentials. Connection details pass through environment variables for host, port, username, password, and SSL flag. The server solely handles draft generation and does not read incoming mail or send messages out.

What it helps with

  • saving IMAP email drafts
  • save draft messages without sending them immediately
  • prepare email body and subject line for manual review
  • connect Gmail or Outlook mailboxes to an AI assistant

Example prompts for the agent

How to install imap-mcp

Platform CLI

claude mcp add --env IMAP_HOST=<IMAP_HOST> --env IMAP_PORT=<IMAP_PORT> --env IMAP_USERNAME=<IMAP_USERNAME> --env IMAP_PASSWORD=<IMAP_PASSWORD> --env IMAP_USE_SSL=<IMAP_USE_SSL> --transport stdio imap-mcp -- npx -y imap-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 imap-mcp

How do I install imap-mcp in Claude Code?

Run claude mcp add imap-mcp -e IMAP_HOST=<IMAP_HOST> -e IMAP_USERNAME=<IMAP_USERNAME> -e IMAP_PASSWORD=<IMAP_PASSWORD> -- npx -y imap-mcp.

Which mailbox folder receives the generated messages?

The tool inspects your server hierarchy and saves drafts to either Drafts or INBOX.Drafts.

What is required to run imap-mcp?

You need Node.js with npx, access to an IMAP mailbox, and credentials supplied via IMAP_HOST, IMAP_PORT, IMAP_USERNAME, IMAP_PASSWORD, and IMAP_USE_SSL.

Similar MCP servers

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

Project sponsors

Companies that keep this analytics open