# IMAP mailbox

> IMAP mailbox is an open-source MCP server for communication. IMAP mailbox server that reads, searches and files mail but cannot send any. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Website:** https://imap-mcp.ni-c.de
- **Repository:** https://github.com/ni-c/imap-mcp
- **MCP Registry name:** io.github.ni-c/imap-mcp
- **Categories:** communication, productivity
- **Listing updated:** 2026-11-15

## About

The design premise is that an agent with private data, untrusted input and a way to reach the outside is exploitable by anyone who can put a message in the inbox. This server deliberately has the first two and not the third: save_draft writes a reply into your Drafts folder, and you send it from your own mail client.

Every message body arrives fenced between untrusted-content markers carrying a random nonce that is repeated on each line inside. Zero-width and directional-override characters are stripped, and markdown images are defused so a client cannot fetch a tracking pixel. Results also include SPF, DKIM and DMARC verdicts, flagged as forgeable unless you set IMAP_TRUSTED_AUTHSERV_ID, plus matches for prompt-injection patterns and mixed-script words. list_new_messages tracks what the assistant has seen with its own IMAP keyword, so reading here does not mark mail read in your client.

With only host, user and password set, it registers six read tools. Setting IMAP_READ_ONLY=false adds the writes, up to eleven tools in all, and deletes, moves, copies and folder deletion ask a person first through MCP elicitation. IMAP_ALLOW_TOOLS and IMAP_DENY_TOOLS trim the set further. It is published on npm and as a container image.

## Features

- **Fenced untrusted content:** Wraps every message body in nonce-marked boundaries.
- **No send capability:** Saves drafts only; you send from your own client.
- **Read-only by default:** Registers only read tools until writes are enabled.
- **Human approval for destructive actions:** Deletes, moves, copies and folder removal prompt a person.
- **New-mail tracking:** Uses a dedicated IMAP keyword to know what the assistant has seen.
- **Authentication verdicts:** Reports SPF, DKIM and DMARC results with a forgeable flag.
- **Tool allow and deny lists:** Filtered tools are not registered at all.

## Good for

- Ask an assistant what new mail arrived
- Search a mailbox for an invoice or thread
- Draft a reply into the Drafts folder for review
- Sort mail into folders with approval for risky steps
- Save an attachment to a chosen directory

## Install

### Claude Code (Terminal)

```sh
claude mcp add imap-mcp --env IMAP_HOST='<IMAP_HOST>' --env IMAP_USER='<IMAP_USER>' --env IMAP_PASSWORD='<IMAP_PASSWORD>' -- npx -y @ni-c/imap-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "IMAP_USER": "<IMAP_USER>",
        "IMAP_PASSWORD": "<IMAP_PASSWORD>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "IMAP_USER": "<IMAP_USER>",
        "IMAP_PASSWORD": "<IMAP_PASSWORD>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "imap-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "IMAP_USER": "<IMAP_USER>",
        "IMAP_PASSWORD": "<IMAP_PASSWORD>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "IMAP_USER": "<IMAP_USER>",
        "IMAP_PASSWORD": "<IMAP_PASSWORD>"
      }
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ni-c/imap-mcp"
      ],
      "env": {
        "IMAP_HOST": "<IMAP_HOST>",
        "IMAP_USER": "<IMAP_USER>",
        "IMAP_PASSWORD": "<IMAP_PASSWORD>"
      }
    }
  }
}
```

## Tools

- `list_new_messages`: List messages the assistant has not yet seen
- `save_draft`: Write a reply into the Drafts folder
- `list_mailboxes`: List mailbox folders by path and display name

## FAQ

### Can it send email?

No. It can save a draft, and you send it yourself.

### Which mail providers work?

Any IMAP mailbox, since it speaks IMAP rather than a vendor API.

### What credentials are required?

IMAP_HOST, IMAP_USER and IMAP_PASSWORD, which can be an app password.

### Are write tools on by default?

No. IMAP_READ_ONLY defaults to true and must be set to false.

### How can a web client use it?

Through mcp-hub, which serves stdio servers over Streamable HTTP with OAuth 2.1.

### Is IMAP mailbox free?

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

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

Run this command in your terminal: claude mcp add imap-mcp --env IMAP_HOST='<IMAP_HOST>' --env IMAP_USER='<IMAP_USER>' --env IMAP_PASSWORD='<IMAP_PASSWORD>' -- npx -y @ni-c/imap-mcp

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

The closest alternatives to IMAP mailbox are Ha MCP, Concord MCP, note1, BoardAgent and Callout.

## Alternatives

- [Ha MCP](https://ai-powered.com/mcp/ha-mcp): Ha MCP is an open-source MCP server for productivity.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.
- [note1](https://ai-powered.com/mcp/note1): note1 is an MCP server for productivity.
- [BoardAgent](https://ai-powered.com/mcp/boardagent): BoardAgent is a free MCP server for community directories.
- [Callout](https://ai-powered.com/mcp/callout): Callout is a freemium MCP server for communication.
- [CalderFlow](https://ai-powered.com/mcp/calderflow): CalderFlow is a free MCP server for design and media.
- [nicemails](https://ai-powered.com/mcp/nicemails): nicemails is a freemium MCP server for communication.
- [SOMMON Office](https://ai-powered.com/mcp/sommon-office): SOMMON Office is a paid MCP server for communication.

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