IMAP Server

v1.0.0Communicationstable

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.

imap-mcp-servermcpai-integration
Share:
55
Stars
0
Downloads
0
Weekly
0/5

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

Read, search, and organize emails with 38 tools. Monitor mailboxes in real-time with IDLE and automate email archiving.
non-dirty

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMay 9, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx imap-mcp-server

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 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
1

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]"
2

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_token
3

Set 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.yaml
4

Configure 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"]
    }
  }
}
5

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.

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-mcp-server": { "command": "npx", "args": ["-y", "imap-mcp-server"] } } }

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

Read the full setup guide →

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.

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