Skip to main content
Open Source

SecureMessage Mail MCP

Give your AI assistant full access to your email — search, read, send, reply, organize — all through the Model Context Protocol.

22 Tools, One Server

A complete MCP server for IMAP/SMTP email operations. Works with Windsurf, Claude, Cursor, and any MCP-compatible AI assistant.

Search & Read

Unified search with 12+ filters across all mailboxes. Full messages, threads, and attachments.

Send & Reply

Compose emails, reply with quoted originals, create drafts for review. CC/BCC, HTML, attachments.

Organize

Move between folders, mark read/unread, set flags and labels, create mailboxes.

Multi-Account

Personal, work, shared mailboxes in one config. Switch at runtime or target per-tool.

OAuth / XOAUTH2

Gmail, Google Workspace, Microsoft 365. Authorize once, connect silently forever.

Single-File Deploy

One 187 KB PHAR. No Composer, no Node.js, no ext-imap. Just PHP 8.4.

Quick Start

1. Download

curl -LO https://pacyworld.dev/pacyworld/mail-mcp/releases/download/v1.0.1/mail-mcp.phar
chmod +x mail-mcp.phar

2. Configure

mkdir -p ~/.config/mail-mcp
cat > ~/.config/mail-mcp/instances.json << 'EOF'
{
    "default": "personal",
    "instances": {
        "personal": {
            "imap_host": "imap.example.com",
            "imap_port": 993,
            "smtp_host": "smtp.example.com",
            "smtp_port": 465,
            "username": "user@example.com",
            "password": "your-app-password",
            "tls": true
        }
    }
}
EOF

3. Add to Your AI Assistant

{
    "mail": {
        "command": "php",
        "args": ["/path/to/mail-mcp.phar"]
    }
}

Requirements

  • PHP 8.4+ with openssl, curl, iconv, ctype, phar
  • Any IMAP/SMTP mail account
  • No Composer, Node.js, or external libraries

Documentation

BSD 2-Clause License — View License