IMAP
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.
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
Maintainer
Works with
Installation
Manual Installation
npx imapConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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_mcpInstall dependencies
Install the Node.js dependencies for the MCP server.
npm installBuild the server
Compile the TypeScript source to JavaScript.
npm run buildConfigure 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_passwordAdd 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"
}
}
}
}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.
IMAP Alternatives — Similar Communication Servers
Looking for alternatives to IMAP? Here are other popular communication servers you can use with Claude, Cursor, and VS Code.
Slack
★ 86.1kEnables interaction with Slack workspaces through comprehensive channel management, messaging, user management, file uploads, and Block Kit formatting. Features secure credential storage via macOS Keychain and supports all major Slack operations incl
LibreChat
★ 37.3kEnhanced ChatGPT Clone: Features Agents, MCP, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenA
Note Gen
★ 11.9kA cross-platform Markdown AI note-taking software.
DeepChat
★ 5.8k🐬DeepChat - A smart assistant that connects powerful AI to your personal world
WhatsApp MCP
★ 5.7kConnects AI assistants to the official Meta WhatsApp Cloud API for managing conversations and sending various message types through natural language. It provides tools for media management, template messages, and real-time webhook processing without
Apple
★ 3.1kEnables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
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.
Set Up IMAP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.