MCP Hub
Back to servers

better-email-mcp

IMAP/SMTP MCP server for Email with composite tools. Multi-account, auto-discovery.

Registrynpm613/wk
Stars
1
Updated
Mar 6, 2026

Quick Install

npx -y @n24q02m/better-email-mcp

Better Email MCP

IMAP/SMTP MCP Server for Email - Optimized for AI Agents

CI codecov npm Docker License: MIT

TypeScript Node.js IMAP/SMTP semantic-release Renovate

Why "Better"?

5 composite tools that provide full email operations (search, read, send, reply, forward, organize) across multiple accounts using IMAP/SMTP with App Passwords.

Key Features

FeatureDescription
Multi-AccountManage 6+ email accounts simultaneously
App PasswordsNo OAuth2 setup required - clone and run in 1 minute
Auto-DiscoveryGmail, Outlook, Yahoo, iCloud, Zoho, ProtonMail auto-configured
Clean TextHTML stripped for LLM token savings
Thread SupportReply/forward maintains In-Reply-To and References headers
Composite Tools5 tools with 15 actions (not 15+ separate endpoints)

Quick Start

Prerequisites

Create App Passwords (NOT your regular password):

Option 1: Package Manager (Recommended)

{
  "mcpServers": {
    "better-email": {
      "command": "bun",
      "args": ["x", "@n24q02m/better-email-mcp@latest"],
      "env": {
        "EMAIL_CREDENTIALS": "user@gmail.com:abcd-efgh-ijkl-mnop"
      }
    }
  }
}

Alternatively, you can use npx, pnpm dlx, or yarn dlx:

Runnercommandargs
npxnpx["-y", "@n24q02m/better-email-mcp@latest"]
pnpmpnpm["dlx", "@n24q02m/better-email-mcp@latest"]
yarnyarn["dlx", "@n24q02m/better-email-mcp@latest"]

Option 2: Docker

{
  "mcpServers": {
    "better-email": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "--name", "mcp-email",
        "-e", "EMAIL_CREDENTIALS",
        "n24q02m/better-email-mcp:latest"
      ],
      "env": {
        "EMAIL_CREDENTIALS": "user@gmail.com:abcd-efgh-ijkl-mnop"
      }
    }
  }
}

Multiple Accounts

EMAIL_CREDENTIALS=user1@gmail.com:pass1,user2@outlook.com:pass2,user3@yahoo.com:pass3

Custom IMAP Host

EMAIL_CREDENTIALS=user@custom.com:password:imap.custom.com

Tools

ToolActions
messagessearch, read, mark_read, mark_unread, flag, unflag, move, archive, trash
folderslist
attachmentslist, download
sendnew, reply, forward
helpGet full documentation for any tool

Search Query Language

QueryDescription
UNREADUnread emails
FLAGGEDStarred emails
SINCE 2024-01-01Emails after date
FROM boss@company.comEmails from sender
SUBJECT meetingEmails matching subject
UNREAD SINCE 2024-06-01Compound filter
UNREAD FROM boss@company.comCompound filter

Token Optimization

Tiered descriptions for minimal context usage:

TierPurposeWhen
Tier 1Compressed descriptionsAlways loaded
Tier 2Full docs via help toolOn-demand
Tier 3MCP ResourcesSupported clients
{"name": "help", "tool_name": "messages"}

MCP Resources (Tier 3)

URIDescription
email://docs/messagesMessages tool docs
email://docs/foldersFolders tool docs
email://docs/attachmentsAttachments tool docs
email://docs/sendSend tool docs

Supported Providers

ProviderAuto-DiscoveryIMAPSMTP
Gmailimap.gmail.com:993TLSTLS (465)
Outlook/Hotmail/Liveoutlook.office365.com:993TLSSTARTTLS (587)
Yahooimap.mail.yahoo.com:993TLSTLS (465)
iCloud/Me.comimap.mail.me.com:993TLSSTARTTLS (587)
Zohoimap.zoho.com:993TLSTLS (465)
ProtonMailimap.protonmail.ch:993TLSTLS (465)
CustomVia email:pass:imap.host formatConfigurableAuto-derived

Build from Source

git clone https://github.com/n24q02m/better-email-mcp
cd better-email-mcp
mise run setup
bun run build

Requirements: Node.js 24+, Bun

Compatible With

Claude Desktop Claude Code Cursor VS Code Copilot Antigravity Gemini CLI OpenAI Codex OpenCode

Also by n24q02m

ServerDescriptionInstall
better-notion-mcpNotion API for AI agentsnpx -y @n24q02m/better-notion-mcp@latest
wet-mcpWeb search, content extraction, library docsuvx --python 3.13 wet-mcp@latest
mnemo-mcpPersistent AI memory with hybrid searchuvx mnemo-mcp@latest
better-godot-mcpGodot Engine for AI agentsnpx -y @n24q02m/better-godot-mcp@latest

Contributing

See CONTRIBUTING.md

License

MIT - See LICENSE

Reviews

No reviews yet

Sign in to write a review