Get the FREE Ultimate OpenClaw Setup Guide →

imap

A powerful Model Context Protocol (MCP) server for IMAP email integration with Claude

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nikolausm-imap-mcp-server node /path/to/ImapClient/dist/index.js

How to use

This MCP server provides a comprehensive IMAP integration with secure account management, multiple account handling, and full email operations. It exposes tools for managing IMAP accounts, performing email searches, retrieving full messages, sending emails via SMTP, and manipulating folders and unread counts. After configuring the server in your Claude Desktop or runtime environment, you can use commands such as imap_add_account to add new accounts, imap_search_emails to search your inbox, imap_get_email to fetch full content, and imap_send_email to compose and send messages. The server also supports advanced actions like replying to and forwarding emails, marking read/unread, and listing folders with unread counts. The web-based setup wizard helps you pre-configure providers (Gmail, Outlook, Yahoo, and more) and automatically configures SMTP settings based on the chosen IMAP provider.

How to install

Prerequisites:

  • Node.js and npm installed on your host
  • Git installed for cloning the repository (optional if using the quick install script)

Quick Install (Recommended):

Manual Installation:

  1. Clone the repository: git clone https://github.com/nikolausm/imap-mcp-server.git cd imap-mcp-server

  2. Install dependencies: npm install

  3. Build the project: npm run build

Optional post-install steps:

  • Run the web-based setup wizard to configure accounts: npm run setup // or globally installed: imap-setup

Notes:

  • The setup wizard provides pre-configured account providers and automates SMTP settings derivation.
  • Ensure network access to the chosen IMAP/SMTP servers and that any required app passwords or OAuth permissions are configured in your provider accounts.

Additional notes

Tips and common issues:

  • Encryption: Credentials are AES-256-CBC encrypted; the key is stored separately at ~/.imap-mcp/.key. Keep this key secure.
  • Account configurations are stored at ~/.imap-mcp/accounts.json. Do not share this file.
  • If you encounter connection issues, verify that IMAP is enabled for the account and that the provider allows app-specific passwords or OAuth access.
  • For sending emails, ensure your account has SMTP access enabled or uses the provider's recommended SMTP settings; the setup wizard can auto-configure SMTP when possible.
  • The CLI tools support multiple accounts and folders; use imap_list_accounts and imap_list_folders to understand your setup before performing actions.
  • If running in Claude Desktop, ensure the mcpServers entry matches your local path to the built server script.

Related MCP Servers

Sponsor this space

Reach thousands of developers