# email-smtp-imap-mcp

email-smtp-imap-mcp — an MCP server for Claude Code and Cursor that connects to multiple inboxes via SMTP and IMAP. Runs on every request to search, send, or read emails.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 25 repo stars
- Author: samihalawa
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/samihalawa/email-smtp-imap-mcp
- Updated: 2026-11-02
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/email-smtp-imap-mcp

## What it does

This MCP server manages an unlimited number of work and personal email accounts through a single local integration. The agent uses the tools to search messages, send plain text or HTML, reply, forward, and handle attachments. It connects to Gmail, iCloud Mail, and standard mail servers over SMTP and IMAP protocols. The setup requires credentials and environment variables such as `EMAIL_ACCOUNTS_JSON`.

The server runs via standard input and output using `npx` without any hosted relay. Configuration files map out host addresses, ports, and app-specific passwords for each mailbox. Without valid authentication details and environment variables, the server fails to connect to the mail providers.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `EMAIL_ACCOUNTS_JSON`, `DEFAULT_EMAIL_ACCOUNT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env EMAIL_ACCOUNTS_JSON=<EMAIL_ACCOUNTS_JSON> --env DEFAULT_EMAIL_ACCOUNT=<DEFAULT_EMAIL_ACCOUNT> --transport stdio email-smtp-imap-mcp -- npx -y email-smtp-imap-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add email-smtp-imap-mcp --env EMAIL_ACCOUNTS_JSON=<EMAIL_ACCOUNTS_JSON> --env DEFAULT_EMAIL_ACCOUNT=<DEFAULT_EMAIL_ACCOUNT> -- npx -y email-smtp-imap-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "email-smtp-imap-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "email-smtp-imap-mcp"
            ],
            "env": {
                "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>",
                "DEFAULT_EMAIL_ACCOUNT": "<DEFAULT_EMAIL_ACCOUNT>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "email-smtp-imap-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "email-smtp-imap-mcp"
            ],
            "env": {
                "EMAIL_ACCOUNTS_JSON": "<EMAIL_ACCOUNTS_JSON>",
                "DEFAULT_EMAIL_ACCOUNT": "<DEFAULT_EMAIL_ACCOUNT>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e EMAIL_ACCOUNTS_JSON=<EMAIL_ACCOUNTS_JSON> -e DEFAULT_EMAIL_ACCOUNT=<DEFAULT_EMAIL_ACCOUNT> email-smtp-imap-mcp npx -y email-smtp-imap-mcp
```
Replace <…> with your own values

## When to use it
- search through messages by sender, date, or text
- send plain text and HTML emails with attachments
- reply to messages and forward email threads
- manage folder structures and read statuses

## Example prompts
- List my configured email accounts
- Send a plain-text email from my work account

## Similar
- [Email (IMAP/SMTP)](https://affpapa.org/en/nevibecode/mcp/email-imapsmtp.md) — MCP server · ★ 14 repo stars
- [email-smtp-send](https://affpapa.org/en/nevibecode/skills/email-smtp-send.md) — skill · 6800 installs
- [email-imap-fetch](https://affpapa.org/en/nevibecode/skills/email-imap-fetch.md) — skill · 376 installs
- [email-mcp](https://affpapa.org/en/nevibecode/mcp/email-mcp.md) — MCP server · ★ 161 repo stars
- [better-email-mcp](https://affpapa.org/en/nevibecode/mcp/n24q02m-better-email-mcp.md) — MCP server · ★ 38 repo stars
- [email-security-auditor-cpp](https://affpapa.org/en/nevibecode/skills/email-security-auditor-cpp.md) — skill · 484 installs

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