# imap-mcp-server

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.

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

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add imap-mcp-server -- npx -y imap-mcp-server
```

### Codex

**Platform CLI**
```bash
codex mcp add imap-mcp-server -- npx -y imap-mcp-server
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "imap-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "imap-mcp-server"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "imap-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "imap-mcp-server"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add imap-mcp-server npx -y imap-mcp-server
```

## When to use it
- 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
- 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.

## 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
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74559
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433

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