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
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-mcpWhat 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
- Draft an email to [email protected] with the subject Release Report and a short summary of changes
- Save a draft response to [email protected] confirming tomorrow's meeting
- Prepare a draft reminder for [email protected] regarding the budget review
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-mcpReplace <…> with your own values
Platform CLI
codex mcp add imap-mcp --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> -- npx -y imap-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"imap-mcp": {
"command": "npx",
"args": [
"-y",
"imap-mcp"
],
"env": {
"IMAP_HOST": "<IMAP_HOST>",
"IMAP_PORT": "<IMAP_PORT>",
"IMAP_USERNAME": "<IMAP_USERNAME>",
"IMAP_PASSWORD": "<IMAP_PASSWORD>",
"IMAP_USE_SSL": "<IMAP_USE_SSL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"imap-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"imap-mcp"
],
"env": {
"IMAP_HOST": "<IMAP_HOST>",
"IMAP_PORT": "<IMAP_PORT>",
"IMAP_USERNAME": "<IMAP_USERNAME>",
"IMAP_PASSWORD": "<IMAP_PASSWORD>",
"IMAP_USE_SSL": "<IMAP_USE_SSL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e IMAP_HOST=<IMAP_HOST> -e IMAP_PORT=<IMAP_PORT> -e IMAP_USERNAME=<IMAP_USERNAME> -e IMAP_PASSWORD=<IMAP_PASSWORD> -e IMAP_USE_SSL=<IMAP_USE_SSL> imap-mcp npx -y imap-mcpReplace <…> 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.