IMAP MCP Server
Allows managing 1&1 (IONOS) email accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing AOL Mail accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing Apple iCloud Mail accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing Gmail accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing GMX email accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing iCloud Mail accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing IONOS email accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing mailbox.org email accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing ProtonMail accounts via IMAP (requires ProtonMail Bridge), enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing WEB.DE email accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Allows managing Zoho Mail accounts via IMAP, enabling operations such as searching, reading, sending, moving, and deleting emails, as well as folder management.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@IMAP MCP ServerShow me my last 5 unread emails from today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
IMAP MCP Server
A powerful Model Context Protocol (MCP) server that provides seamless IMAP email integration with secure account management and connection pooling.
Features
🔐 Secure Account Management: Encrypted credential storage with AES-256 encryption
🚀 Connection Pooling: Efficient IMAP connection management
📧 Comprehensive Email Operations: Search, read, move, mark, delete, and bulk delete emails
✉️ Email Sending: Send, reply, and forward emails via SMTP
📁 Folder Management: List folders, check status, get unread counts
🔄 Multiple Account Support: Manage multiple IMAP accounts simultaneously
🛡️ Type-Safe: Built with TypeScript for reliability
🌐 Web-Based Setup Wizard: Easy account configuration with provider presets
📱 15+ Email Providers: Pre-configured settings for Gmail, Outlook, Yahoo, and more
🔗 Auto SMTP Configuration: Automatic SMTP settings based on IMAP provider
Installation
Quick Install (Recommended)
macOS/Linux:
curl -fsSL https://raw.githubusercontent.com/nikolausm/imap-mcp-server/main/install.sh | bashWindows (PowerShell as Administrator):
iwr -useb https://raw.githubusercontent.com/nikolausm/imap-mcp-server/main/install.ps1 | iexManual Installation
Clone the repository:
git clone https://github.com/nikolausm/imap-mcp-server.git
cd imap-mcp-serverInstall dependencies:
npm installBuild the project:
npm run buildAccount Setup
Web-Based Setup Wizard (Recommended)
After installation, run the setup wizard:
npm run setupOr if installed globally:
imap-setupThis will:
Start a local web server
Open your browser to the setup wizard
Guide you through adding email accounts with pre-configured settings
Supported Email Providers
The setup wizard includes pre-configured settings for:
Gmail / Google Workspace
Microsoft Outlook / Hotmail / Live
Yahoo Mail
Apple iCloud Mail
GMX
WEB.DE
IONOS (1&1)
ProtonMail (with Bridge)
Fastmail
Zoho Mail
AOL Mail
mailbox.org
Posteo
Custom IMAP servers
Configuration
Claude Code (CLI)
If you use Claude Code in the terminal, add the MCP server with a single command:
Step 1: Make sure you have built the project first (see Manual Installation).
Step 2: Run this command in your terminal:
claude mcp add imap -- node /absolute/path/to/imap-mcp-server/dist/index.jsImportant: Replace
/absolute/path/to/imap-mcp-serverwith the actual path where you cloned the repository. For example:# macOS/Linux example: claude mcp add imap -- node /Users/yourname/imap-mcp-server/dist/index.js # Windows example: claude mcp add imap -- node C:\Users\yourname\imap-mcp-server\dist\index.js
Step 3: Verify it was added:
claude mcp listYou should see imap in the list of configured MCP servers. That's it — the IMAP tools are now available in your Claude Code sessions.
Tip: If you want to remove the server later, run:
claude mcp remove imap
Claude Desktop (GUI App)
Add the IMAP MCP server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"imap": {
"command": "node",
"args": ["/path/to/imap-mcp-server/dist/index.js"],
"env": {}
}
}
}Usage
Once configured, the IMAP MCP server provides the following tools in Claude:
Account Management
imap_add_account: Add a new IMAP account
Parameters: - name: Friendly name for the account - host: IMAP server hostname - port: Server port (default: 993) - user: Username - password: Password - tls: Use TLS/SSL (default: true)imap_list_accounts: List all configured accounts
imap_remove_account: Remove an account
Parameters: - accountId: ID of the account to removeimap_connect: Connect to an account
Parameters: - accountId OR accountName: Account identifierimap_disconnect: Disconnect from an account
Parameters: - accountId: Account to disconnect
Email Operations
imap_search_emails: Search for emails
Parameters: - accountId: Account ID - folder: Folder name (default: INBOX) - from, to, subject, body: Search criteria - since, before: Date filters - seen, flagged: Status filters - limit: Max results (default: 50)imap_get_email: Get full email content
Parameters: - accountId: Account ID - folder: Folder name - uid: Email UID - maxContentLength: Max characters for text/html body (default: 10000) - includeAttachmentText: Include text attachment previews (default: true) - maxAttachmentTextChars: Max characters per text attachment (default: 100000)imap_get_latest_emails: Get recent emails
Parameters: - accountId: Account ID - folder: Folder name (default: INBOX) - count: Number of emails (default: 10)imap_mark_as_read/unread: Change email read status
Parameters: - accountId: Account ID - folder: Folder name - uid: Email UIDimap_delete_email: Delete an email
Parameters: - accountId: Account ID - folder: Folder name - uid: Email UIDimap_move_email: Move an email from one folder to another
Parameters: - accountId: Account ID - folder: Source folder name (default: INBOX) - uid: Email UID - targetFolder: Destination folder name - createDestinationIfMissing: Create the destination folder if it does not exist (default: false)imap_find_thread_messages: Find inbox messages that belong to the same conversation threads as messages already sorted into another folder. Uses RFC 3501 HEADER search on In-Reply-To and References — works on any IMAP server.
Parameters: - accountId: Account ID - sourceFolder: Folder containing the already-sorted thread messages - searchFolder: Folder to search for related messages (default: INBOX) - searchReferences: Also match the References header for multi-level threads (default: true)imap_download_attachment: Download an email attachment (returns images inline, extracts text from PDFs, or saves to downloads directory)
Parameters: - accountId: Account ID - folder: Folder name (default: INBOX) - uid: Email UID - filename: Attachment filename or contentId - savePath: Optional file path to save the attachment to - extractText: For PDFs, extract and return text content inline (default: true)imap_bulk_delete: Delete multiple emails at once with chunking and auto-reconnection
Parameters: - accountId: Account ID - folder: Folder name (default: INBOX) - uids: Array of email UIDs to delete - chunkSize: Emails to delete per batch (default: 50)imap_bulk_delete_by_search: Search for emails matching criteria and delete them all
Parameters: - accountId: Account ID - folder: Folder name (default: INBOX) - from, to, subject: Search criteria (optional) - before, since: Date filters (optional) - chunkSize: Emails to delete per batch (default: 50) - dryRun: Preview what would be deleted without deleting (default: false)imap_send_email: Send a new email
Parameters: - accountId: Account ID to send from - to: Recipient email address(es) - subject: Email subject - text: Plain text content (optional) - html: HTML content (optional) - cc: CC recipients (optional) - bcc: BCC recipients (optional) - replyTo: Reply-to address (optional) - attachments: Array of attachments (optional) - filename: Attachment filename - content: Base64 encoded content - path: File path to attach - contentType: MIME typeimap_reply_to_email: Reply to an existing email
Parameters: - accountId: Account ID - folder: Folder containing the original email - uid: UID of the email to reply to - text: Plain text reply content (optional) - html: HTML reply content (optional) - replyAll: Reply to all recipients (default: false) - attachments: Array of attachments (optional)imap_forward_email: Forward an existing email
Parameters: - accountId: Account ID - folder: Folder containing the original email - uid: UID of the email to forward - to: Forward to email address(es) - text: Additional text to include (optional) - includeAttachments: Include original attachments (default: true)
Folder Operations
imap_list_folders: List all folders
Parameters: - accountId: Account IDimap_folder_status: Get folder information
Parameters: - accountId: Account ID - folder: Folder nameimap_create_folder: Create a new IMAP folder/mailbox. Most servers also create any missing parent folders. Returns success even if the folder already exists.
Parameters: - accountId: Account ID - folder: Full folder path to create (e.g. "Archives/2026/2026-05" or "INBOX.Archive")imap_get_unread_count: Count unread emails
Parameters: - accountId: Account ID - folders: Specific folders (optional)
Security
Credentials are encrypted using AES-256-CBC encryption
Encryption keys are stored separately in
~/.imap-mcp/.keyAccount configurations are stored in
~/.imap-mcp/accounts.jsonNever commit or share your encryption key or account configurations
Development
Running in Development Mode
npm run devBuilding
npm run buildProject Structure
src/
├── index.ts # MCP server entry point
├── services/
│ ├── imap-service.ts # IMAP connection management
│ ├── smtp-service.ts # SMTP service for sending emails
│ └── account-manager.ts # Account configuration
├── tools/
│ ├── index.ts # Tool registration
│ ├── account-tools.ts # Account management tools
│ ├── email-tools.ts # Email operation tools (including send/reply/forward)
│ └── folder-tools.ts # Folder operation tools
└── types/
└── index.ts # TypeScript type definitionsExample Usage in Claude
Add an account: "Add my Gmail account with username john@gmail.com"
Check new emails: "Show me the latest 5 emails from my Gmail account"
Search emails: "Search for emails from boss@company.com in the last week"
Send an email: "Send an email to client@example.com with subject 'Project Update'"
Reply to emails: "Reply to the latest email from my boss"
Forward emails: "Forward the email with subject 'Meeting Notes' to team@company.com"
Move an email: "Move the invoice email from INBOX to my Taxes folder"
Manage folders: "List all folders in my email account and show unread counts"
Troubleshooting
Connection Issues
Ensure your IMAP server settings are correct
Check if your email provider requires app-specific passwords
Verify that IMAP is enabled in your email account settings
For sending emails, ensure your account has SMTP access enabled
SMTP Configuration
The server automatically configures SMTP settings based on your IMAP provider. If you need custom SMTP settings, you can specify them when adding an account:
{
"smtp": {
"host": "smtp.example.com",
"port": 587,
"secure": false
}
}Common IMAP Settings
Gmail:
Host: imap.gmail.com
Port: 993
Requires app-specific password
Outlook/Hotmail:
Host: outlook.office365.com
Port: 993
Yahoo:
Host: imap.mail.yahoo.com
Port: 993
Requires app-specific password
License
ISC
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolausm/imap-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server