# Email Smtp Imap MCP

> Email Smtp Imap MCP is an open-source MCP server for communication. Local MCP server to search, read, send and organise email across many SMTP/IMAP accounts. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/samihalawa/email-smtp-imap-mcp
- **MCP Registry name:** io.github.samihalawa/email-smtp-imap-mcp
- **Categories:** [communication](https://ai-powered.com/categories/communication), [productivity](https://ai-powered.com/categories/productivity)
- **Listing updated:** 2026-11-23

## About

Everything is configured through one JSON value, `EMAIL_ACCOUNTS_JSON`, which holds any number of named accounts with their SMTP and IMAP hosts and credentials. Tools take an optional `account_name`; leave it out and the server uses the default account or the first one listed. A single-account setup can use plain SMTP_* and IMAP_* variables instead.

The server runs locally over stdio, with no hosted relay. Both connections require TLS 1.2 or newer and a valid certificate, and when `secure` is false STARTTLS is mandatory before authentication, so plaintext-only relays are not supported. The README gives settings for Gmail and iCloud Mail, which use app passwords, and says any standard provider works.

Six tools cover the everyday mailbox: listing accounts without exposing credentials, finding messages, sending with attachments, replying or forwarding by UID, changing flags or folders, and listing folders with counts. It is MIT licensed and published on npm.

## Features

- **Unlimited named accounts:** Add work, personal or client inboxes and switch between them with an account name.
- **Advanced message search:** Filter by text, sender, recipient, subject, date, read or flag state, and attachments.
- **Send with attachments:** Send plain-text or HTML mail with CC, BCC, sender aliases and base64 attachments.
- **Reply and forward by UID:** Reply, reply-all or forward with threading and optional original attachments.
- **Flag and move messages:** Mark read or unread, flag, unflag or move messages to another folder.
- **Enforced TLS:** Connections need TLS 1.2 or newer and a valid certificate, with mandatory STARTTLS when not using implicit TLS.

## Good for

- Triage unread mail across several inboxes from one chat
- Draft and send replies from a chosen sender alias
- Forward a message with its attachments to a colleague
- Review folder unread counts for a client mailbox
- Archive or flag messages matching a search

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add email-smtp-imap-mcp --env EMAIL_ACCOUNTS_JSON='<EMAIL_ACCOUNTS_JSON>' -- npx -y email-smtp-imap-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add email-smtp-imap-mcp --env EMAIL_ACCOUNTS_JSON='<EMAIL_ACCOUNTS_JSON>' -- npx -y email-smtp-imap-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.email-smtp-imap-mcp]
command = "npx"
args = ["-y", "email-smtp-imap-mcp"]
env = { EMAIL_ACCOUNTS_JSON = "<EMAIL_ACCOUNTS_JSON>" }
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Or run: gemini mcp add -s user -e EMAIL_ACCOUNTS_JSON='<EMAIL_ACCOUNTS_JSON>' email-smtp-imap-mcp npx -- -y email-smtp-imap-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "email-smtp-imap-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "email-smtp-imap-mcp"
      ],
      "env": {
        "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>"
      }
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 6 tools change data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `accounts_list` (name suggests: reads): List every configured account and identify the default without exposing credentials.
- `emails_find` (name suggests: reads): Search by text, sender, recipient, subject, date, read state, flag state or attachments.
- `email_send` (name suggests: changes): Send plain-text or HTML email with CC, BCC, sender aliases and base64 attachments.
- `email_respond`: Reply, reply-all or forward by email UID with threading.
- `emails_modify` (name suggests: changes): Mark read or unread, flag or unflag, or move messages to another folder.
- `folders_list` (name suggests: reads): List folders with optional total and unread counts.

## FAQ

### Is there a limit on how many accounts I can add?

No. The README says there is no application-level account-count limit.

### Does Email Smtp Imap MCP work with Gmail or iCloud?

Yes, using an app password or app-specific password with the provider's SMTP and IMAP hosts.

### How does the server get my credentials?

From the EMAIL_ACCOUNTS_JSON variable, either in an .env file referenced by EMAIL_ENV_FILE or set directly in the client's env block.

### Does Email Smtp Imap MCP need a hosted service?

No. It runs locally over stdio, with no hosted relay or control panel.

### Is Email Smtp Imap MCP free?

Yes. Email Smtp Imap MCP is open source, so you can use and self-host it for free.

### How do I add Email Smtp Imap MCP to Claude Code?

Run this command in your terminal: claude mcp add email-smtp-imap-mcp --env EMAIL_ACCOUNTS_JSON='<EMAIL_ACCOUNTS_JSON>' -- npx -y email-smtp-imap-mcp

### What are the best alternatives to Email Smtp Imap MCP?

The closest alternatives to Email Smtp Imap MCP are TrendRadar, Ha MCP, Concord MCP, TryPost and Open Sunsama.

## 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.
- [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.
- [TryPost](https://ai-powered.com/mcp/trypost): TryPost is a paid MCP server for marketing and seo.
- [Open Sunsama](https://ai-powered.com/mcp/open-sunsama): Open Sunsama is an open-source MCP server for productivity.
- [Discord MCP](https://ai-powered.com/mcp/discord-mcp): Discord MCP is an open-source MCP server for communication.
- [Gmail MCP](https://ai-powered.com/mcp/gmail-mcp-3): Gmail MCP is an open-source MCP server for communication.
- [Dayfile.app](https://ai-powered.com/mcp/dayfile-app): Dayfile.app is an open-source MCP server for productivity.

---
Source: https://ai-powered.com/mcp/email-smtp-imap-mcp
