IMAP Server
Enables comprehensive interaction with IMAP email accounts through 38 tools for reading, searching, and organizing messages. It supports advanced features like real-time mailbox monitoring via IDLE watch and automated email archiving.
What is IMAP Server?
IMAP Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables comprehensive interaction with imap email accounts through 38 tools for reading, searching, and organizing messages. it supports advanced features like real-time mailbox monitoring via idle wa...
Enables comprehensive interaction with IMAP email accounts through 38 tools for reading, searching, and organizing messages. It supports advanced features like real-time mailbox monitoring via IDLE watch and automated email archiving.
This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables comprehensive interaction with IMAP email accounts t
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx imap-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use IMAP Server
The IMAP MCP server gives AI assistants comprehensive access to any IMAP-compatible email account through 38 specialized tools, covering folder management, message listing and reading (text, HTML, and attachments), message actions (move, delete, flag, mark read/unread), reply drafting with proper threading, cross-folder search, and real-time mailbox monitoring via the IMAP IDLE protocol. It supports multiple authentication methods including OAuth2, making it compatible with Gmail, Outlook, Fastmail, and any standard IMAP provider. Email-heavy workflows — inbox triage, thread summarization, automated archiving, and drafting replies — become conversational tasks with this server connected.
Prerequisites
- Python 3.10 or later installed
- uv package manager installed (pip install uv)
- An IMAP-compatible email account (Gmail, Outlook, Fastmail, or any standard IMAP provider)
- For Gmail: OAuth2 credentials from Google Cloud Console (client_id, client_secret, refresh_token) — or an App Password if using basic auth
- An MCP-compatible client such as Claude Desktop
Clone the repository and install dependencies
Clone the imap-mcp repository and install all dependencies using uv.
git clone https://github.com/non-dirty/imap-mcp.git
cd imap-mcp
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"Create the configuration file
Create a config.yaml file in the project directory with your IMAP server details and authentication credentials. For Gmail with OAuth2, include your client_id, client_secret, and refresh_token.
# config.yaml example for Gmail with OAuth2
imap:
host: imap.gmail.com
port: 993
username: [email protected]
auth_type: oauth2
oauth2:
client_id: your_client_id
client_secret: your_client_secret
refresh_token: your_refresh_tokenSet up OAuth2 tokens (Gmail users)
Run the token setup helper to generate or refresh OAuth2 credentials for your Gmail account.
uv run imap_mcp.auth_setup refresh-token --config config.yamlConfigure the MCP client
Add the IMAP server to your claude_desktop_config.json pointing to the uv Python environment and config file.
{
"mcpServers": {
"imap": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/imap-mcp", "run", "imap_mcp.server", "--config", "/absolute/path/to/imap-mcp/config.yaml"]
}
}
}Restart Claude Desktop and test
Restart Claude Desktop and ask it to list your inbox folders. If you see your email folders returned, the IMAP connection is working correctly.
IMAP Server Examples
Client configuration
claude_desktop_config.json block for the IMAP MCP server using uv.
{
"mcpServers": {
"imap": {
"command": "uv",
"args": [
"--directory", "/absolute/path/to/imap-mcp",
"run", "imap_mcp.server",
"--config", "/absolute/path/to/imap-mcp/config.yaml"
]
}
}
}Prompts to try
Example prompts that use the IMAP MCP server to manage email.
- "List the 10 most recent unread emails in my inbox and summarize each one in a single sentence."
- "Search all folders for emails from [email protected] received in the last 7 days."
- "Read the full content of email UID 12345 in my INBOX folder."
- "Move all emails from [email protected] to my 'Newsletters' folder."
- "Draft a reply to the last email from my manager, thanking them for the feedback and confirming I'll have the report done by Friday."Troubleshooting IMAP Server
Connection refused or IMAP authentication fails
For Gmail, ensure you have enabled IMAP access in Gmail Settings → See all settings → Forwarding and POP/IMAP. If using OAuth2, verify your refresh_token is valid by running the auth_setup helper again. For basic auth, use an App Password if 2FA is enabled on your Google account.
OAuth2 token expired or refresh_token is invalid
Run 'uv run imap_mcp.auth_setup refresh-token --config config.yaml' to obtain fresh tokens. OAuth2 refresh tokens can expire if unused for 6 months or if the Google Cloud project's consent screen is in test mode with user limits.
uv run fails with 'command not found' or environment errors
Ensure uv is installed ('pip install uv' or 'brew install uv') and that you cloned the repository to the exact path specified in the --directory argument. Use absolute paths throughout the config to avoid working-directory ambiguity.
Frequently Asked Questions about IMAP Server
What is IMAP Server?
IMAP Server is a Model Context Protocol (MCP) server that enables comprehensive interaction with imap email accounts through 38 tools for reading, searching, and organizing messages. it supports advanced features like real-time mailbox monitoring via idle watch and automated email archiving. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install IMAP Server?
Follow the installation instructions on the IMAP Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with IMAP Server?
IMAP Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is IMAP Server free to use?
Yes, IMAP Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
IMAP Server Alternatives — Similar Communication Servers
Looking for alternatives to IMAP Server? 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 Server 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 Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.