imap-mcp-server — Claude Code MCP server: email and setup
Give an AI assistant tools to search, read, sort and send email through IMAP and SMTP. Use it to handle mailbox tasks from your chat client.
claude mcp add imap-mcp-server -- npx -y imap-mcp-serverWhat imap-mcp-server does
The server can find and read messages, move them, mark them, delete them, and send email through SMTP, including replies and forwards. It also handles multiple accounts and can report folder names, mailbox status and unread counts.
A web wizard helps configure accounts with provider presets. Credentials are kept in encrypted form in ~/.imap-mcp/accounts.json; environment variables can supply replacement credentials for accounts already configured. Running the server through npx requires Node.js 22.12 or newer, so older Node versions will not meet the stated requirement.
In Claude Code, add the server with claude mcp add imap-mcp-server -- npx -y imap-mcp-server. The setup wizard listens on the local machine by default. For a remote host, the instructions recommend using an SSH tunnel.
What it helps with
- search a mailbox for a message
- read email and check unread counts
- move or mark messages
- send, reply to or forward an email
- inspect folders in a mail account
Example prompts for the agent
- Find the latest invoice in my mailbox and read it.
- Move the message from this sender to the right folder and mark it as read.
- Reply to the latest email and forward a copy to this address.
How to install imap-mcp-server
Platform CLI
claude mcp add imap-mcp-server -- npx -y imap-mcp-serverPlatform CLI
codex mcp add imap-mcp-server -- npx -y imap-mcp-serverConfig file
{
"mcpServers": {
"imap-mcp-server": {
"command": "npx",
"args": [
"-y",
"imap-mcp-server"
]
}
}
}Config file
{
"servers": {
"imap-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"imap-mcp-server"
]
}
}
}Platform CLI
gemini mcp add imap-mcp-server npx -y imap-mcp-serverStep 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-server
How do I install imap-mcp-server in Claude Code?
Run claude mcp add imap-mcp-server -- npx -y imap-mcp-server. The npx setup requires Node.js 22.12 or newer.
What does imap-mcp-server do?
It gives an assistant IMAP and SMTP tools for mailbox tasks, including finding and reading messages, sending replies and forwarding email.
How can I add a mail account?
Start the setup wizard with npx -p imap-mcp-server imap-setup, or ask the assistant to add an account using imap_add_account. Account settings are stored in ~/.imap-mcp/accounts.json.