Skip to main content
Glama
MCP Mail Manager

MCP Mail Manager

by artik0din

MCP Mail Manager

npm version License: MIT Node.js

A comprehensive Model Context Protocol (MCP) server for email management. Supports all major email providers with secure credential encryption and multi-account management.

πŸš€ Features

  • πŸ“§ Universal Email Support - Gmail, Outlook, Yahoo, iCloud, ProtonMail, and any IMAP/SMTP server

  • πŸ” Secure Authentication - Password and OAuth2 support with encrypted credential storage

  • πŸ‘₯ Multi-Account Management - Manage multiple email accounts simultaneously

  • πŸ” Advanced Search - Search emails by sender, date, content, attachments

  • πŸ“¨ Send & Receive - Full email composition and thread management

  • πŸ”’ End-to-End Encryption - Local AES-256-GCM encryption for stored credentials

  • 🌍 Provider Auto-Detection - Automatic configuration for major email providers

  • ⚑ High Performance - Efficient IMAP/SMTP connections with connection pooling

Related MCP server: IMAP MCP Server

πŸ“¦ Quick Start

Install and Run

# Install globally
npm install -g @artik0din/mcp-mail-manager

# Or run directly with npx
npx @artik0din/mcp-mail-manager

Basic Setup (Password Authentication)

Most email providers support password or app-password authentication:

# Add a Gmail account (use App Password, not regular password)
add_email_account email="user@gmail.com" password="YOUR_APP_PASSWORD_HERE" name="Personal Gmail"

# Add any other provider (auto-detected)
add_email_account email="user@yahoo.com" password="YOUR_PASSWORD_HERE" name="Yahoo Mail"

Advanced Setup (OAuth2)

For advanced Gmail/Outlook integration, set up OAuth2:

export GMAIL_CLIENT_ID="your_oauth_client_id"
export GMAIL_CLIENT_SECRET="YOUR_OAUTH_CLIENT_SECRET"

πŸ› οΈ MCP Client Setup

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mail-manager": {
      "command": "npx",
      "args": ["@artik0din/mcp-mail-manager"],
      "env": {
        "MCP_MASTER_KEY": "your_encryption_key"
      }
    }
  }
}

Other MCP Clients

The server communicates via stdio and follows the MCP protocol. Configure according to your client's requirements.

πŸ“‹ Available Tools

πŸ”‘ Account Management

Tool

Description

Parameters

add_email_account

Add new email account

email, password, name?, provider?, imap_host?, imap_port?, smtp_host?, smtp_port?, test_connection?

list_email_accounts

List configured accounts

None

remove_email_account

Remove an account

account_id, confirm

πŸ“§ Email Operations

Tool

Description

Parameters

list_emails

List emails from inbox

account_id, folder?, limit?, unread_only?

search_emails

Search emails with filters

account_id, query?, from?, to?, since?, before?, has_attachment?, limit?

get_email_thread

Get full email conversation

account_id, message_id, include_body?

send_email

Send or draft email

account_id, to[], subject, body, cc?, bcc?, html?, reply_to_message_id?, draft?

🌐 Supported Email Providers

Major Providers (Auto-Configured)

Provider

Domains

Auth Methods

Notes

Gmail

gmail.com, googlemail.com

Password (App Password), OAuth2

Requires 2FA + App Password

Outlook

outlook.com, hotmail.com, live.com

Password, OAuth2

Microsoft 365 supported

Yahoo

yahoo.com, ymail.com

Password

App Password recommended

iCloud

icloud.com, me.com, mac.com

Password

App Password required

ProtonMail

protonmail.com, proton.me

Password

Requires ProtonMail Bridge

Fastmail

fastmail.com, fastmail.fm

Password

App Password supported

Zoho

zoho.com

Password

Business accounts supported

AOL

aol.com

Password

App Password recommended

Custom IMAP/SMTP

Any email provider with IMAP/SMTP access:

add_email_account email="user@example.com" password="YOUR_PASSWORD_HERE" provider="custom" imap_host="mail.example.com" smtp_host="mail.example.com"

πŸ’‘ Usage Examples

Account Setup

# Gmail with App Password
add_email_account email="user@gmail.com" password="XXXX_XXXX_XXXX_XXXX" name="Work Gmail"

# Custom business email
add_email_account email="user@yourcompany.com" password="YOUR_PASSWORD_HERE" provider="custom" imap_host="mail.company.com" smtp_host="mail.company.com"

# List all accounts
list_email_accounts

Email Management

# List recent emails
list_emails account_id="you-gmail-com"

# List only unread emails
list_emails account_id="you-gmail-com" unread_only=true

# Search for emails from a specific sender
search_emails account_id="you-gmail-com" from="boss@company.com"

# Search by keyword and date range
search_emails account_id="you-gmail-com" query="project alpha" since="2024-01-01" limit=50

Sending Emails

# Simple email
send_email account_id="you-gmail-com" to=["colleague@company.com"] subject="Project Update" body="Here's the latest status..."

# Email with CC and HTML
send_email account_id="you-gmail-com" to=["client@company.com"] cc=["manager@company.com"] subject="Proposal" body="Please see attached proposal." html="<p>Please see <strong>attached</strong> proposal.</p>"

# Reply to an email (preserves threading)
send_email account_id="you-gmail-com" to=["original@sender.com"] subject="Re: Original Subject" body="Thanks for your email!" reply_to_message_id="<original-message-id>"

πŸ”’ Security & Privacy

  • Local Credential Storage: All credentials encrypted and stored locally in ~/.mcp-mail-manager/

  • AES-256-GCM Encryption: Military-grade encryption for sensitive data

  • No Cloud Dependencies: All data stays on your machine

  • App Password Support: Secure authentication for 2FA-enabled accounts

  • Minimal Permissions: Only requests necessary IMAP/SMTP access

Setting Up App Passwords

  • Gmail: Enable 2FA β†’ Google Account β†’ Security β†’ App passwords

  • Yahoo: Account Info β†’ Account security β†’ Generate app password

  • iCloud: Sign-In and Security β†’ App-Specific Passwords

πŸ—οΈ Development

# Clone and setup
git clone https://github.com/artik0din/mcp-mail-manager.git
cd mcp-mail-manager
npm install

# Development mode
npm run dev

# Build for production
npm run build

πŸ“„ License

MIT Β© 2026 Kevin Valfin

🀝 Contributing

Contributions welcome! Please read the contributing guidelines and submit PRs to the main branch.

πŸ› Issues

Found a bug? Please file an issue on GitHub with:

  • Node.js version

  • Email provider

  • Error messages/logs

  • Steps to reproduce

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to work with multiple email accounts over IMAP and SMTP: search, read, send, reply, forward, move, mark, and bulk-delete messages, plus list folders and check unread counts. Credentials are stored with AES-256 encryption and connections are pooled, with auto-configured settings for Gmail, Outlook, Yahoo, and other providers.
      1,009 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to manage email over IMAP and SMTP: searching, reading, sending, replying, forwarding, organizing and bulk-deleting messages across multiple accounts with AES-256-encrypted credentials. It also supports folder listing, unread counts, and connection pooling for Gmail, Outlook, Yahoo, iCloud and other providers.
      1,009 npm
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to securely manage multiple email accounts via IMAP and SMTP, including searching, reading, sending, replying, forwarding, organizing folders, marking, and bulk deleting messages.
      1,009 npm
      MIT