Skip to content
MCP server

IMAP Mail

Read and search IMAP mailboxes and create drafts, with sending and deleting left out

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
self-hosted, CLI
Runs
Locally
Version
0.2.1
Listing updated
today

Similar MCP servers

About IMAP Mail

IMAP Mail is an open-source MCP server for communication. It runs locally on your machine and is started by your AI client.

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.

Install

Run in a 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

Add to claude_desktop_config.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>"
      }
    }
  }
}

Add to ~/.cursor/mcp.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>"
      }
    }
  }
}

Add to .vscode/mcp.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>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.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>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "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>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • IMAP_HOSTIMAP server host name (IMAPS), e.g. imap.example.comRequired
  • MAIL_USERIMAP login, usually the mail addressRequired
  • MAIL_PASSWORDIMAP password; an app-specific password where the provider requires oneRequired
  • IMAP_PORTIMAPS port
  • MAIL_ADDRESSOwn sender address, if it differs from the login
  • MAIL_FROM_NAMEDisplay name used as sender of drafts
  • MAIL_ALIASESAdditional allowed sender addresses, comma-separated; *@example.com allows a whole domain
  • DRAFTS_FOLDERDrafts folder, if it is not detected automatically
  • MARK_READ_ON_READread_message marks every message it returns as read
  • DRAFT_UNREADStore new drafts as unread, so they stand out in the mailbox
  • BCC_SELFAdd the sender address as Bcc to every draft

Tools this server provides (7)

Taken from the project documentation; the running server may differ.

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.

What it does

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

Pricing

Open source

Self-hosted personal project; no price

More servers for the same service

IMAP Mail 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.

How AIPoweredBot checks servers