Server data from the Official MCP Registry
IMAP/SMTP MCP server to search, read, organize, send, reply & forward email for AI assistants
IMAP/SMTP MCP server to search, read, organize, send, reply & forward email for AI assistants
Valid MCP server (2 strong, 1 medium validity signals). 2 known CVEs in dependencies Package registry verified. Imported from the Official MCP Registry. Trust signals: 3 highly-trusted packages.
3 files analyzed ยท 3 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-nikolausm-imap-mcp-server": {
"args": [
"-y",
"imap-mcp-server"
],
"command": "npx"
}
}
}From the project's GitHub README.
A powerful Model Context Protocol (MCP) server that provides seamless IMAP email integration with secure account management and connection pooling.
Once published to npm, you can run the server directly without cloning or building anything โ npx downloads the prebuilt package and runs it:
npx -y imap-mcp-server
This is the easiest way to use the server in an MCP client (see Configuration for ready-to-paste npx configs).
curl -fsSL https://raw.githubusercontent.com/nikolausm/imap-mcp-server/main/install.sh | bash
iwr -useb https://raw.githubusercontent.com/nikolausm/imap-mcp-server/main/install.ps1 | iex
git clone https://github.com/nikolausm/imap-mcp-server.git
cd imap-mcp-server
npm install
npm run build
Accounts are stored encrypted in ~/.imap-mcp/accounts.json. This file is shared by all run modes โ whether you start the server via npx, a global install, or a local clone, they all read the same accounts. So you only need to set up your accounts once.
If you run the server via npx (no clone), you have two ways to add accounts:
Option A โ Run the setup wizard directly via npx (no install needed):
npx -p imap-mcp-server imap-setup
This launches the same web-based wizard described below and writes to ~/.imap-mcp/accounts.json, which your npx-configured MCP server then picks up automatically.
Option B โ Add accounts straight from your AI client:
Once the MCP server is configured, just ask your assistant to add an account โ it uses the imap_add_account tool. For example:
"Add my IMAP account: host imap.gmail.com, port 993, user me@gmail.com, password โฆ"
No separate setup step required.
After installation, run the setup wizard:
npm run setup
Or if installed globally:
imap-setup
Or directly via npx without installing:
npx -p imap-mcp-server imap-setup
This will:
The setup wizard includes pre-configured settings for:
claude mcp add imap -- npx -y imap-mcp-server
This always runs the latest published version and requires no local build.
If you use Claude Code in the terminal, add the MCP server with a single command:
Step 1: Make sure you have built the project first (see Manual Installation).
Step 2: Run this command in your terminal:
claude mcp add imap -- node /absolute/path/to/imap-mcp-server/dist/index.js
Important: Replace
/absolute/path/to/imap-mcp-serverwith the actual path where you cloned the repository. For example:# macOS/Linux example: claude mcp add imap -- node /Users/yourname/imap-mcp-server/dist/index.js # Windows example: claude mcp add imap -- node C:\Users\yourname\imap-mcp-server\dist\index.js
Step 3: Verify it was added:
claude mcp list
You should see imap in the list of configured MCP servers. That's it โ the IMAP tools are now available in your Claude Code sessions.
Tip: If you want to remove the server later, run:
claude mcp remove imap
Add the IMAP MCP server to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Option A โ via npx (recommended, no clone/build needed):
{
"mcpServers": {
"imap": {
"command": "npx",
"args": ["-y", "imap-mcp-server"],
"env": {}
}
}
}
Option B โ from a local clone:
{
"mcpServers": {
"imap": {
"command": "node",
"args": ["/path/to/imap-mcp-server/dist/index.js"],
"env": {}
}
}
}
Once configured, the IMAP MCP server provides the following tools in Claude:
Choosing an account. For the email and folder tools,
accountIdis optional and backward-compatible. You may instead passaccountName, and if you only have a single account configured you can omit both โ that account is used by default. With multiple accounts and no selector, the tool returns a clear error listing your options (imap_list_accounts).
imap_add_account: Add a new IMAP account
Parameters:
- name: Friendly name for the account
- host: IMAP server hostname
- port: Server port (default: 993)
- user: Username
- password: Password
- tls: Use TLS/SSL (default: true)
imap_list_accounts: List all configured accounts
imap_remove_account: Remove an account
Parameters:
- accountId: ID of the account to remove
imap_connect: Connect to an account
Parameters:
- accountId OR accountName: Account identifier
imap_disconnect: Disconnect from an account
Parameters:
- accountId: Account to disconnect
imap_search_emails: Search for emails
Parameters:
- accountId: Account ID
- folder: Folder name (default: INBOX)
- from, to, subject, body: Search criteria
- since, before: Date filters
- seen, flagged: Status filters
- limit: Max results (default: 50)
imap_get_email: Get full email content
Parameters:
- accountId: Account ID
- folder: Folder name
- uid: Email UID
- maxContentLength: Max characters for text/html body (default: 10000)
- includeAttachmentText: Include text attachment previews (default: true)
- maxAttachmentTextChars: Max characters per text attachment (default: 100000)
imap_get_latest_emails: Get recent emails
Parameters:
- accountId: Account ID
- folder: Folder name (default: INBOX)
- count: Number of emails (default: 10)
imap_mark_as_read/unread: Change email read status
Parameters:
- accountId: Account ID
- folder: Folder name
- uid: Email UID
imap_delete_email: Delete an email
Parameters:
- accountId: Account ID
- folder: Folder name
- uid: Email UID
imap_move_email: Move an email from one folder to another
Parameters:
- accountId: Account ID
- folder: Source folder name (default: INBOX)
- uid: Email UID
- targetFolder: Destination folder name
- createDestinationIfMissing: Create the destination folder if it does not exist (default: false)
imap_find_thread_messages: Find inbox messages that belong to the same conversation threads as messages already sorted into another folder. Uses RFC 3501 HEADER search on In-Reply-To and References โ works on any IMAP server.
Parameters:
- accountId: Account ID
- sourceFolder: Folder containing the already-sorted thread messages
- searchFolder: Folder to search for related messages (default: INBOX)
- searchReferences: Also match the References header for multi-level threads (default: true)
imap_download_attachment: Download an email attachment (returns images inline, extracts text from PDFs, or saves to downloads directory)
Parameters:
- accountId: Account ID
- folder: Folder name (default: INBOX)
- uid: Email UID
- filename: Attachment filename or contentId
- savePath: Optional file path to save the attachment to
- extractText: For PDFs, extract and return text content inline (default: true)
imap_bulk_delete: Delete multiple emails at once with chunking and auto-reconnection
Parameters:
- accountId: Account ID
- folder: Folder name (default: INBOX)
- uids: Array of email UIDs to delete
- chunkSize: Emails to delete per batch (default: 50)
imap_bulk_delete_by_search: Search for emails matching criteria and delete them all
Parameters:
- accountId: Account ID
- folder: Folder name (default: INBOX)
- from, to, subject: Search criteria (optional)
- before, since: Date filters (optional)
- chunkSize: Emails to delete per batch (default: 50)
- dryRun: Preview what would be deleted without deleting (default: false)
imap_send_email: Send a new email
Parameters:
- accountId: Account ID to send from
- to: Recipient email address(es)
- subject: Email subject
- text: Plain text content (optional)
- html: HTML content (optional)
- cc: CC recipients (optional)
- bcc: BCC recipients (optional)
- replyTo: Reply-to address (optional)
- attachments: Array of attachments (optional)
- filename: Attachment filename
- content: Base64 encoded content
- path: File path to attach
- contentType: MIME type
imap_reply_to_email: Reply to an existing email
Parameters:
- accountId: Account ID
- folder: Folder containing the original email
- uid: UID of the email to reply to
- text: Plain text reply content (optional)
- html: HTML reply content (optional)
- replyAll: Reply to all recipients (default: false)
- attachments: Array of attachments (optional)
imap_forward_email: Forward an existing email
Parameters:
- accountId: Account ID
- folder: Folder containing the original email
- uid: UID of the email to forward
- to: Forward to email address(es)
- text: Additional text to include (optional)
- includeAttachments: Include original attachments (default: true)
imap_list_folders: List all folders
Parameters:
- accountId: Account ID
imap_folder_status: Get folder information
Parameters:
- accountId: Account ID
- folder: Folder name
imap_create_folder: Create a new IMAP folder/mailbox. Most servers also create any missing parent folders. Returns success even if the folder already exists.
Parameters:
- accountId: Account ID
- folder: Full folder path to create (e.g. "Archives/2026/2026-05" or "INBOX.Archive")
imap_get_unread_count: Count unread emails
Parameters:
- accountId: Account ID
- folders: Specific folders (optional)
~/.imap-mcp/.key~/.imap-mcp/accounts.jsonnpm run dev
npm run build
src/
โโโ index.ts # MCP server entry point
โโโ services/
โ โโโ imap-service.ts # IMAP connection management
โ โโโ smtp-service.ts # SMTP service for sending emails
โ โโโ account-manager.ts # Account configuration
โโโ tools/
โ โโโ index.ts # Tool registration
โ โโโ account-tools.ts # Account management tools
โ โโโ email-tools.ts # Email operation tools (including send/reply/forward)
โ โโโ folder-tools.ts # Folder operation tools
โโโ types/
โโโ index.ts # TypeScript type definitions
Add an account: "Add my Gmail account with username john@gmail.com"
Check new emails: "Show me the latest 5 emails from my Gmail account"
Search emails: "Search for emails from boss@company.com in the last week"
Send an email: "Send an email to client@example.com with subject 'Project Update'"
Reply to emails: "Reply to the latest email from my boss"
Forward emails: "Forward the email with subject 'Meeting Notes' to team@company.com"
Move an email: "Move the invoice email from INBOX to my Taxes folder"
Manage folders: "List all folders in my email account and show unread counts"
The server automatically configures SMTP settings based on your IMAP provider. If you need custom SMTP settings, you can specify them when adding an account:
{
"smtp": {
"host": "smtp.example.com",
"port": 587,
"secure": false
}
}
Gmail:
Outlook/Hotmail:
Yahoo:
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
Be the first to review this server!
by Toleno ยท Developer Tools
Toleno Network MCP Server โ Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace ยท Developer Tools
Create, build, and publish Python MCP servers to PyPI โ conversationally.
by Microsoft ยท Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption