IMAP MCP
Allows reading, searching, sending, and managing email messages in mailboxes hosted on cPanel-based mail servers over IMAP and SMTP.
Allows reading, searching, sending, and managing messages on self-hosted Dovecot IMAP and SMTP mail servers.
Allows reading, searching, sending, and managing email messages in mailboxes hosted on Plesk-based mail servers over IMAP and SMTP.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@IMAP MCPsearch my inbox for unread emails from my boss"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
IMAP MCP
An MCP server that gives Claude read, manage and send access to any IMAP mailbox, for the mail that Google and Microsoft connectors do not cover: hosting company mailboxes (xneelo, cPanel, Plesk), self hosted Dovecot, anything that speaks plain IMAP and SMTP.
Runs locally over stdio. Your password stays in a local .env file, and mail goes directly from this machine to your mail server.
What Claude gets
Tool | What it does |
| Configured mailboxes, and whether each password is set |
| Every folder, plus the detected Sent, Trash and Drafts folders |
| Search by sender, recipient, subject, text, date, unread, flagged. Newest first, header only by default |
| One message: headers, body as text, attachment list |
| Save one attachment to disk and return the path |
| Mark read or unread |
| seen, flagged, answered, draft, deleted |
| Move or archive to another folder |
| Move to Trash, or erase permanently after confirmation |
| Send new mail, after a preview and confirmation |
| Threaded reply, sender only or reply all, after a preview |
| Save a draft for you to send yourself |
Related MCP server: IMAP MCP Server
Safety rules built in
Reading never marks mail as read. Every fetch uses BODY.PEEK and folders open read only, so Claude browsing the mailbox does not change its state.
get_message(mark_seen=True)is the only exception and has to be asked for.Sending and permanent deletion take two steps. The first call returns the exact message or the exact target plus a
confirmation_tokenand does nothing. Only a second call withcommit=Trueand that token acts. Change any argument between the two calls and the token stops matching.Delete means Trash.
delete_messagesmoves to the Trash folder unless you passpermanent=True.Per account read_only. Set
"read_only": trueon an account and every write tool refuses, while reading keeps working.Sent mail is filed. SMTP does not copy what it sends, so after a send the same bytes are appended to the Sent folder, where your normal mail client expects them.
Attachments go to disk, never into the conversation.
Setup
Install:
uv venv --python 3.12 uv pip install -e ".[dev]"Copy
accounts.example.jsontoaccounts.jsonand fill in your mail server details. Ask your host for the IMAP and SMTP settings if you do not have them. Passwords do not go in this file.Copy
.env.exampleto.envand add one password per account. The variable name is the account name, uppercased, with anything that is not a letter or digit turned into an underscore: accountworkreadsIMAP_PASSWORD_WORK. AddSMTP_PASSWORD_<NAME>only if the SMTP password differs.Prove the account works before wiring it in:
.venv\Scripts\python.exe scripts\smoke.pyRegister the server with Claude Code:
claude mcp add --scope user imap -- "C:\Claude Projects\IMAP MCP\.venv\Scripts\python.exe" -m imap_mcp.serverRestart Claude Code and check
/mcp.
Account fields
Field | Default | Notes |
| required | How you refer to the account in a prompt |
| required | |
| required | Usually the full email address |
| 993 | 143 for starttls or none |
|
|
|
| none | Leave blank to disable sending |
| 587 | 465 for ssl |
|
|
|
|
| Only if it differs |
|
| The address mail is sent as |
| blank | Display name on outgoing mail |
| detected | Set these only if detection picks the wrong folder |
| false | Blocks every write tool for this account |
| true | Set false only for a host whose certificate is broken. The connection stays encrypted, the server identity stops being checked |
| 60 | Seconds |
Sent, Trash and Drafts are found from the server's SPECIAL-USE flags, falling
back to the usual names including the Dovecot style INBOX.Sent.
Shared hosting and certificates
Hosts like xneelo point mail.yourdomain.co.za at a shared server whose
certificate is issued for the server's own name, so strict TLS verification
fails on the vanity hostname even though the connection is fine. Find the real
server name and use that instead:
python -c "import socket; print(socket.gethostbyaddr(socket.gethostbyname('mail.yourdomain.co.za')))"That returns something like www12.cpt3.host-h.net, which its certificate does
cover. The tradeoff is that if the host migrates your mailbox to another server,
the hostname changes and login starts failing: rerun the line above and update
accounts.json. The alternative is keeping the vanity hostname with
"verify_tls": false.
Not supported
OAuth2, so Gmail and Microsoft 365 are out of scope: they have first party connectors already. Password authentication over TLS only. Gmail with an app password does work if you want it here anyway.
Tests
.venv\Scripts\python.exe -m pytest # 35 unit tests, no networkEnd to end against a throwaway mail server in Docker, which exercises all 12 tools including sending, moving and permanent deletion without touching a real mailbox:
docker run -d --rm --name imapmcp-greenmail -p 3143:3143 -p 3025:3025 ^
-e GREENMAIL_OPTS="-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled" ^
greenmail/standalone:2.1.0
.venv\Scripts\python.exe scripts\e2e_greenmail.py
docker stop imapmcp-greenmailTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Read, send, file and search email in any Gmail, Microsoft 365 or IMAP mailbox, plus its calendar.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.4060490MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to read, search, send, and manage emails across multiple IMAP/SMTP accounts via a single deployment.-
- FlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, draft, send, flag, and move email across multiple IMAP/SMTP mailboxes while keeping credentials local.-
- FlicenseNot gradedqualityDmaintenanceEnables Claude Code to manage email inboxes via IMAP, including reading, categorizing, phishing detection, archiving, junking, and sending emails with user permission.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/WEYERSK/imap-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server