Email MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add mcp-server-email -- docker run --rm -e "EMAIL_ACCOUNTS=[{\"id\":\"main\",\"email\":\"user@example.com\",\"imap_host\":\"mail.example.com\",\"imap_port\":993,\"smtp_host\":\"mail.example.com\",\"smtp_port\":465,\"username\":\"user@example.com\",\"password\":\"app-password\"}]" ghcr.io/boutquin/mcp-server-email:latest
README.md

Multi-account IMAP/SMTP email MCP server with 22 tools

mcp-server-email

Multi-account email server for the Model Context Protocol. Gives LLMs full email access — read, send, search, organize — over IMAP/SMTP with connection pooling, rate limiting, and retry. Designed as the remote-email counterpart to apple-bridge (local Mail.app access).

Quick Start

  1. Install

    go install github.com/boutquin/mcp-server-email/cmd/mcp-server-email@latest
    
  2. Create a config file (~/.config/mcp-email/accounts.json)

    For well-known providers (Gmail, Outlook, Yahoo, iCloud, Fastmail, Zoho), host and port are auto-detected from the email domain — just provide credentials:

    [
      {
        "id": "hello",
        "email": "hello@gmail.com",
        "username": "hello@gmail.com",
        "password": "app-password-here"
      }
    ]
    

    For custom mail servers, specify host and port explicitly:

    [
      {
        "id": "work",
        "email": "hello@example.com",
        "imap_host": "mail.example.com",
        "imap_port": 993,
        "smtp_host": "mail.example.com",
        "smtp_port": 465,
        "username": "hello@example.com",
        "password": "app-password-here"
      }
    ]
    
    chmod 600 ~/.config/mcp-email/accounts.json
    
  3. Add to Claude Code (~/.claude.json)

    {
      "mcpServers": {
        "email": {
          "command": "mcp-server-email",
          "env": {
            "EMAIL_CONFIG_FILE": "~/.config/mcp-email/accounts.json"
          }
        }
      }
    }
    
  4. Restart Claude Code — the email_* tools are now available.

Installation

Go Install (recommended for Go developers)

go install github.com/boutquin/mcp-server-email/cmd/mcp-server-email@latest

Homebrew (macOS/Linux)

brew install boutquin/tap/mcp-server-email

Binary Download

Download pre-built binaries for your platform from GitHub Releases.

Available for: Linux (amd64, arm64), macOS (amd64, arm64), Windows (amd64, arm64).

Docker

docker run --rm \
  -e EMAIL_ACCOUNTS='[{"id":"main","email":"user@example.com","imap_host":"mail.example.com","imap_port":993,"smtp_host":"mail.example.com","smtp_port":465,"username":"user@example.com","password":"app-password"}]' \
  ghcr.io/boutquin/mcp-server-email:latest

MCP Bundle (Claude Desktop)

Download the .mcpb file from Releases and open in Claude Desktop.

Build from source

git clone https://github.com/boutquin/mcp-server-email.git
cd mcp-server-email
go build -o mcp-server-email ./cmd/mcp-server-email

Configuration

Accounts are loaded once at startup. Changes require a server restart.

Config file vs environment variable

Approach Best for
EMAIL_CONFIG_FILE — path to a JSON file Production use. File can be permission-locked (chmod 600)
EMAIL_ACCOUNTS — inline JSON in env var Testing, CI, or containerized deployments

If both are set, EMAIL_ACCOUNTS takes precedence.

Account JSON schema

[
  {
    "id": "hello",
    "email": "hello@example.com",
    "imap_host": "mail.example.com",
    "imap_port": 993,
    "smtp_host": "mail.example.com",
    "smtp_port": 465,
    "username": "hello@example.com",
    "password": "app-password-here"
  }
]
Field Required Description
id Yes Unique account identifier
email Yes Email address
imap_host No* IMAP server hostname
imap_port No* IMAP port (993 = implicit TLS, 143 = STARTTLS)
smtp_host No* SMTP server hostname
smtp_port No* SMTP port (465 = implicit TLS, 587 = STARTTLS)
username Yes Login username
password Yes** App password or account password
use_starttls No Override TLS auto-detection (true/false)
insecure_skip_verify No Skip TLS certificate verification (dev/testing)
auth_method No "password" (default) or "oauth2"
oauth_client_id No OAuth2 client ID (required when auth_method is "oauth2")
oauth_client_secret No OAuth2 client secret
oauth_token_file No Override token file path

*Host and port are a

Tools (5)

email_list_foldersList all available folders in an email account.
email_list_messagesList messages in a specific folder.
email_get_messageRetrieve the full content of a specific email message.
email_send_messageSend a new email message.
email_search_messagesSearch for messages based on query criteria.

Environment Variables

EMAIL_CONFIG_FILEPath to a JSON file containing account configurations.
EMAIL_ACCOUNTSInline JSON string containing account configurations.

Configuration

claude_desktop_config.json
{"mcpServers": {"email": {"command": "mcp-server-email", "env": {"EMAIL_CONFIG_FILE": "~/.config/mcp-email/accounts.json"}}}}

Try it

List the folders in my primary email account.
Search for the latest email from my bank and summarize the content.
Find unread emails in my inbox and list the subjects.
Draft and send a reply to the last email I received from John Doe.

Frequently Asked Questions

What are the key features of Email MCP Server?

Multi-account support for IMAP and SMTP protocols. Connection pooling for efficient server communication. Rate limiting and retry logic with backoff. OAuth2 device-code flow support. Auto-detection of host and port for major providers.

What can I use Email MCP Server for?

Automating email triage by having an LLM categorize incoming messages. Drafting and sending professional responses directly from the Claude interface. Searching through historical email archives to retrieve specific information. Managing multiple email identities within a single AI-powered workflow.

How do I install Email MCP Server?

Install Email MCP Server by running: go install github.com/boutquin/mcp-server-email/cmd/mcp-server-email@latest

What MCP clients work with Email MCP Server?

Email MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Email MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare