IMAP

v1.0.0Communicationstable

An IMAP client MCP server for reading mail from Dovecot or Synology MailPlus mailboxes, with optional webhook triggers for new messages. It provides tools for managing emails and automates workflows by firing webhooks when matching messages arrive.

imapmcpai-integration
Share:
30
Stars
0
Downloads
0
Weekly
0/5

What is IMAP?

IMAP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to imap client mcp server for reading mail from dovecot or synology mailplus mailboxes, with optional webhook triggers for new messages. it provides tools for managing emails and automates workflows by f...

An IMAP client MCP server for reading mail from Dovecot or Synology MailPlus mailboxes, with optional webhook triggers for new messages. It provides tools for managing emails and automates workflows by firing webhooks when matching messages arrive.

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An IMAP client MCP server for reading mail from Dovecot or S

Use Cases

Read and manage emails from IMAP-compatible mailboxes via Claude.
Automate email workflows with webhook triggers for matching messages.
Integrate email data into AI agent tasks for communication automation.
aviman1109

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx imap

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use IMAP

imap-mcp is an IMAP client MCP server that gives AI assistants the ability to read, search, manage, and organize emails from any standard IMAP-compatible mailbox, including Dovecot and Synology MailPlus. Beyond basic email access, it supports configurable watch rules that poll the mailbox on a set interval and fire webhooks when matching messages arrive, making it useful for building email-triggered automation workflows that an AI assistant can monitor and respond to.

Prerequisites

  • Node.js 18+ installed for running the TypeScript-based server
  • IMAP account credentials: hostname, port, username, and password
  • IMAP server accessible from your machine (port 993 for IMAPS by default)
  • An MCP-compatible client such as Claude Desktop
  • Optional: a webhook endpoint URL if you want automated message triggering
1

Clone the repository

Clone the imap-mcp repository since it is not published to npm and must be built from source.

git clone https://github.com/aviman1109/imap_mcp.git
cd imap_mcp
2

Install dependencies

Install the Node.js dependencies for the MCP server.

npm install
3

Build the server

Compile the TypeScript source to JavaScript.

npm run build
4

Configure environment variables

Set the required IMAP connection variables. At minimum you need IMAP_HOST, IMAP_USERNAME, and IMAP_PASSWORD. IMAP_PORT defaults to 993 and IMAP_SSL defaults to true.

export IMAP_HOST=mail.example.com
export IMAP_PORT=993
export IMAP_SSL=true
export [email protected]
export IMAP_PASSWORD=your_password
5

Add the server to your MCP client config

Register imap-mcp in your Claude Desktop configuration, passing all required IMAP credentials as environment variables.

{
  "mcpServers": {
    "imap": {
      "command": "node",
      "args": ["/path/to/imap_mcp/dist/index.js"],
      "env": {
        "IMAP_HOST": "mail.example.com",
        "IMAP_PORT": "993",
        "IMAP_SSL": "true",
        "IMAP_USERNAME": "[email protected]",
        "IMAP_PASSWORD": "your_password",
        "IMAP_DEFAULT_MAILBOX": "INBOX",
        "POLL_INTERVAL_SECS": "30"
      }
    }
  }
}
6

Optionally configure watch rules for webhook triggers

Create a watches.json file specifying email matching rules and webhook URLs. Set WATCHES_FILE to point to it. When a matching message arrives during polling, the webhook is POSTed with the message payload.

IMAP Examples

Client configuration

Claude Desktop configuration for imap-mcp connecting to an IMAP mailbox over SSL.

{
  "mcpServers": {
    "imap": {
      "command": "node",
      "args": ["/path/to/imap_mcp/dist/index.js"],
      "env": {
        "IMAP_HOST": "mail.example.com",
        "IMAP_PORT": "993",
        "IMAP_SSL": "true",
        "IMAP_USERNAME": "[email protected]",
        "IMAP_PASSWORD": "your_password",
        "IMAP_DEFAULT_MAILBOX": "INBOX",
        "POLL_INTERVAL_SECS": "30",
        "PORT": "38105"
      }
    }
  }
}

Prompts to try

Example prompts for reading and managing email through the IMAP MCP server.

- "List all my unread emails in the INBOX"
- "Search for emails from [email protected] received this week"
- "Fetch the full content of email with ID 12345"
- "Mark all emails in my Promotions folder as read"
- "Move email 12345 to the Archive folder"
- "List all my mailbox folders and their message counts"

Troubleshooting IMAP

Connection refused or timeout when connecting to the IMAP server

Verify that IMAP_HOST and IMAP_PORT are correct. For SSL connections, port 993 is standard. For non-SSL connections, use port 143 and set IMAP_SSL=false. Test connectivity with: openssl s_client -connect mail.example.com:993.

Authentication fails with correct credentials

Some mail providers (Gmail, Outlook) require app-specific passwords or OAuth when 2FA is enabled. Generate an app password in your mail account security settings and use that as IMAP_PASSWORD instead of your login password.

Watch rules are not triggering webhooks

Ensure WATCHES_FILE points to a valid JSON file with correctly formatted watch rules. Check that POLL_INTERVAL_SECS is set and the webhook URL is reachable from the machine running imap-mcp. Review the get_status tool output to see watcher state and fire counts.

Frequently Asked Questions about IMAP

What is IMAP?

IMAP is a Model Context Protocol (MCP) server that imap client mcp server for reading mail from dovecot or synology mailplus mailboxes, with optional webhook triggers for new messages. it provides tools for managing emails and automates workflows by firing webhooks when matching messages arrive. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install IMAP?

Follow the installation instructions on the IMAP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with IMAP?

IMAP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is IMAP free to use?

Yes, IMAP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "imap": { "command": "npx", "args": ["-y", "imap"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use IMAP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides