IMAP Mini MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/florianbuetow/imap-mini-mcp
cd imap-mini-mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "IMAP_HOST=${IMAP_HOST}" -e "IMAP_USER=${IMAP_USER}" -e "IMAP_PASS=${IMAP_PASS}" imap-mini-mcp -- node "<FULL_PATH_TO_IMAP_MINI_MCP>/dist/index.js"

Replace <FULL_PATH_TO_IMAP_MINI_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:IMAP_HOSTIMAP_USERIMAP_PASS+ 4 optional
README.md

A lightweight MCP server for reading IMAP email and creating draft replies.

IMAP Mini MCP

A lightweight MCP (Model Context Protocol) server for reading IMAP email and creating draft replies. Works with any standard IMAP server (Gmail, Outlook, Fastmail, etc.) and local bridges like ProtonMail Bridge.

Agents can read, search, move, star, and organize emails, and compose drafts — but cannot send or delete emails.

See CHANGELOG.md for recently added features.

Workflow Recommendation

I highly recommend using a speech-to-text tool (e.g. SuperWhisper on Mac or Whisperflow on Windows) and connecting your AI desktop application (Claude, Codex, etc.) to this MCP server. That way you can converse with your email inbox using speech, which will dramatically speed up your workflow.

How to Use

Agent configuration

Add to your MCP client config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "imap-mini-mcp": {
      "command": "node",
      "args": ["/path/to/imap-mini-mcp/dist/index.js"],
      "env": {
        "IMAP_HOST": "imap.example.com",
        "IMAP_USER": "you@example.com",
        "IMAP_PASS": "your-password"
      }
    }
  }
}

The args path must point to the built dist/index.js. Add any optional variables to the env block as needed.

Environment variables

Variable Required Default Description
IMAP_HOST yes IMAP server hostname (e.g. imap.gmail.com)
IMAP_USER yes Email address or username
IMAP_PASS yes Password or app-specific password
IMAP_PORT no 993 IMAP server port
IMAP_SECURE no true Use TLS for the connection
IMAP_STARTTLS no true Upgrade to TLS via STARTTLS (when IMAP_SECURE=false)
IMAP_TLS_REJECT_UNAUTHORIZED no true Reject self-signed TLS certificates

For most providers (Gmail, Outlook, Fastmail), the defaults work — just set host, user, and password.

For ProtonMail Bridge — all five settings below are required (the bridge listens on localhost without TLS, uses a self-signed certificate, and does not support STARTTLS):

IMAP_HOST=127.0.0.1
IMAP_PORT=1143
IMAP_SECURE=false
IMAP_STARTTLS=false
IMAP_TLS_REJECT_UNAUTHORIZED=false

Or as MCP client config:

{
  "mcpServers": {
    "imap-mini-mcp": {
      "command": "node",
      "args": ["/path/to/imap-mini-mcp/dist/index.js"],
      "env": {
        "IMAP_HOST": "127.0.0.1",
        "IMAP_PORT": "1143",
        "IMAP_SECURE": "false",
        "IMAP_STARTTLS": "false",
        "IMAP_TLS_REJECT_UNAUTHORIZED": "false",
        "IMAP_USER": "you@proton.me",
        "IMAP_PASS": "your-bridge-password"
      }
    }
  }
}

Tools

Every email is identified by a composite id (YYYY-MM-DDTHH:mm:ss.<Message-ID>) that is globally unique and stable across folder moves. Use the id returned by find_emails to fetch content, download attachments, move emails, or create reply drafts. Action tools accept an optional mailbox hint for faster lookup; if omitted, all folders are searched.

`find_emails`

Search and filter emails. All parameters are optional — calling with no parameters returns all emails from INBOX, sorted newest-first.

Parameter Type Default Description
after string Only emails after this time. Relative ("30m", "2h", "7d") or ISO date ("2026-02-20")
before string Only emails before this time. Same formats as after
from string Substring match on sender address (e.g. "alice@example.com", "@stripe.com")
subject string Substring match on subject line
unread_only boolean false Only return unread emails
has_attachment boolean false Only return emails with attachments
folder string "INBOX" Folder to search
limit number Maximum number of results (newest first)

Examples:

Use case Parameters
Last 24 hours {after: "24h"}
Last 7 days, max 10 {after: "7d", limit: 10}
Unread emails {unread_only: true}
From a domain {from: "@stripe.com"}
With attachments, last month {after: "30d", has_attachment: true}
Specific sender, in Sent folder {from: "alice@example.com", folder: "Sent"}

Other tools

Tool Description Key parameters
list_starred_emails Starred emails across all folders
fetch_email_content Full email content by id id, mailbox?
fetch_email_attachment Download an attachment id, attachment_id, mailbox?
list_folders List all folders
create_folder Create a new folder path
move_email Move an email to another folder `i

Tools (7)

find_emailsSearch and filter emails.
list_starred_emailsList starred emails across all folders.
fetch_email_contentRetrieve full email content by id.
fetch_email_attachmentDownload an attachment from an email.
list_foldersList all available email folders.
create_folderCreate a new email folder.
move_emailMove an email to another folder.

Environment Variables

IMAP_HOSTrequiredIMAP server hostname
IMAP_USERrequiredEmail address or username
IMAP_PASSrequiredPassword or app-specific password
IMAP_PORTIMAP server port
IMAP_SECUREUse TLS for the connection
IMAP_STARTTLSUpgrade to TLS via STARTTLS
IMAP_TLS_REJECT_UNAUTHORIZEDReject self-signed TLS certificates

Configuration

claude_desktop_config.json
{"mcpServers": {"imap-mini-mcp": {"command": "node", "args": ["/path/to/imap-mini-mcp/dist/index.js"], "env": {"IMAP_HOST": "imap.example.com", "IMAP_USER": "you@example.com", "IMAP_PASS": "your-password"}}}}

Try it

Find all unread emails from @stripe.com in my inbox.
List my email folders and move the latest email from my boss to the 'Work' folder.
Fetch the content of the most recent email with an attachment.
Search for emails received in the last 24 hours and summarize them.

Frequently Asked Questions

What are the key features of IMAP Mini MCP?

Read and search IMAP email accounts. Organize mailboxes by moving emails and creating folders. Fetch full email content and download attachments. Compose draft replies. Compatible with standard IMAP providers and local bridges like ProtonMail Bridge.

What can I use IMAP Mini MCP for?

Voice-controlled email management using speech-to-text tools. Automated sorting and organization of incoming emails into specific folders. Quickly retrieving and summarizing recent communications from specific domains. Drafting email responses using AI assistance without leaving the chat interface.

How do I install IMAP Mini MCP?

Install IMAP Mini MCP by running: node /path/to/imap-mini-mcp/dist/index.js

What MCP clients work with IMAP Mini MCP?

IMAP Mini MCP 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 IMAP Mini MCP 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