# IMAP Mail

> IMAP Mail is an open-source MCP server for communication. Read and search IMAP mailboxes and create drafts, with sending and deleting left out. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** self-hosted, CLI
- **Repository:** https://github.com/buzzer/imap-mcp
- **MCP Registry name:** io.github.buzzer/imap-mcp
- **Categories:** [communication](https://ai-powered.com/categories/communication)
- **Listing updated:** 2026-11-18

## About

This is a small personal project, published as-is and meant for a trusted home network. It was written for a Hetzner mailbox and an iCloud account on a Raspberry Pi but works with any IMAP server reachable over IMAPS on port 993.

The design is deliberately cautious. Messages are fetched without marking them read, only the Seen flag can be changed on existing mail, and sending is impossible: a draft lands in the drafts folder for you to review and send from your own mail client. Drafts can carry PDF, PNG or JPEG attachments from one configured folder, and senders are limited to the account address plus configured aliases. At most 2 MB of a message is loaded and a truncation flag is reported.

The README warns that the assistant can see everything in each configured mailbox and that mail content can carry prompt injection, so use an app-specific password and review drafts yourself. Connection options are SSH stdio, an authenticated HTTPS service on the LAN, or a Docker image.

## Features

- **Multi-account reading:** Lists folders and messages and reads mail across several configured accounts.
- **Mailbox search:** Searches messages in a chosen account and folder.
- **Draft creation:** Stores drafts for you to review and send yourself.
- **No sending or deleting:** The server has no way to send or remove mail.
- **Alias limits:** Senders are limited to the account address and configured aliases.
- **Optional attachments:** Drafts can include PDF, PNG or JPEG files from one folder.
- **Peek reads:** Reading does not mark mail as read unless enabled.

## Good for

- Summarise unread mail from a Hetzner or iCloud inbox
- Search an old mailbox for a specific thread
- Draft a reply that you check and send yourself
- Prepare a draft with an attached PDF

## Install

### Claude Code (Terminal)

```sh
claude mcp add imap-mcp --env IMAP_HOST='<IMAP_HOST>' --env MAIL_USER='<MAIL_USER>' --env MAIL_PASSWORD='<MAIL_PASSWORD>' -- docker run -i --rm -e IMAP_HOST -e MAIL_USER -e MAIL_PASSWORD ghcr.io/buzzer/imap-mcp:0.2.1
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "IMAP_HOST",
        "-e",
        "MAIL_USER",
        "-e",
        "MAIL_PASSWORD",
        "ghcr.io/buzzer/imap-mcp:0.2.1"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "MAIL_USER": "<MAIL_USER>",
        "MAIL_PASSWORD": "<MAIL_PASSWORD>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "IMAP_HOST",
        "-e",
        "MAIL_USER",
        "-e",
        "MAIL_PASSWORD",
        "ghcr.io/buzzer/imap-mcp:0.2.1"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "MAIL_USER": "<MAIL_USER>",
        "MAIL_PASSWORD": "<MAIL_PASSWORD>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "imap-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "IMAP_HOST",
        "-e",
        "MAIL_USER",
        "-e",
        "MAIL_PASSWORD",
        "ghcr.io/buzzer/imap-mcp:0.2.1"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "MAIL_USER": "<MAIL_USER>",
        "MAIL_PASSWORD": "<MAIL_PASSWORD>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "IMAP_HOST",
        "-e",
        "MAIL_USER",
        "-e",
        "MAIL_PASSWORD",
        "ghcr.io/buzzer/imap-mcp:0.2.1"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "MAIL_USER": "<MAIL_USER>",
        "MAIL_PASSWORD": "<MAIL_PASSWORD>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "IMAP_HOST",
        "-e",
        "MAIL_USER",
        "-e",
        "MAIL_PASSWORD",
        "ghcr.io/buzzer/imap-mcp:0.2.1"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "MAIL_USER": "<MAIL_USER>",
        "MAIL_PASSWORD": "<MAIL_PASSWORD>"
      }
    }
  }
}
```

## Tools

- `list_accounts`: Lists configured mail accounts.
- `list_folders`: Lists folders in an account.
- `list_messages`: Lists messages in a folder.
- `search_messages`: Searches messages.
- `read_message`: Reads one message.
- `mark_read`: Sets the Seen flag.
- `create_draft`: Stores a draft in the drafts folder.

## FAQ

### Can it send email?

No. Sending is deliberately not possible; it only creates drafts.

### Which servers work?

Any IMAP server that supports IMAPS on port 993.

### Is it safe for the internet?

The README says it is meant for a trusted home network and the HTTP transport should not be exposed to the internet.

### How is it packaged?

As a Docker image at ghcr.io/buzzer/imap-mcp for amd64 and arm64.

### Is IMAP Mail free?

Yes. IMAP Mail is open source, so you can use and self-host it for free.

### How do I add IMAP Mail to Claude Code?

Run this command in your terminal: claude mcp add imap-mcp --env IMAP_HOST='<IMAP_HOST>' --env MAIL_USER='<MAIL_USER>' --env MAIL_PASSWORD='<MAIL_PASSWORD>' -- docker run -i --rm -e IMAP_HOST -e MAIL_USER -e MAIL_PASSWORD ghcr.io/buzzer/imap-mcp:0.2.1

### What are the best alternatives to IMAP Mail?

The closest alternatives to IMAP Mail are TrendRadar, Getmitra, Discord, Zoom and Email Spam Tester.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [TrendRadar](https://ai-powered.com/mcp/trendradar): TrendRadar is an open-source MCP server for communication.
- [Getmitra](https://ai-powered.com/mcp/getmitra): Getmitra is an MCP server for communication.
- [Discord](https://ai-powered.com/mcp/discord-2): Discord is a freemium MCP server for communication.
- [Zoom](https://ai-powered.com/mcp/zoom): Zoom is a freemium MCP server for communication.
- [Email Spam Tester](https://ai-powered.com/mcp/email-spam-tester): Email Spam Tester is a free MCP server for communication.
- [Slack_connect](https://ai-powered.com/mcp/slack-connect): Slack_connect is a freemium MCP server for communication.
- [Postmark](https://ai-powered.com/mcp/postmark): Postmark is a freemium MCP server for communication.
- [Gmail](https://ai-powered.com/mcp/gmail-5): Gmail is a freemium MCP server for communication.

---
Source: https://ai-powered.com/mcp/imap-mail
