Skip the install. Get this working in under 2 minutes.
Start a free trial on cloud.anythingmcp.com, add the Email (IMAP/SMTP) in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.
Summary
Connect any mailbox over IMAP and SMTP: list folders, search and read mail with attachments, mark, flag and move mail, and save replies as drafts. Sending and deleting to Trash install switched off; on AnythingMCP Cloud sending needs a provider with SMTP on port 2525. Works with IONOS, Strato, GMX, web.de, T-Online, Gmail (app password), Fastmail, Hetzner, all-inkl, Aruba and self-hosted servers.
Try asking
Example prompts for Email (IMAP/SMTP)
Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.
Claude is AI and can make mistakes. Please double-check responses.
💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Email (IMAP/SMTP), paste your credentials, mint an MCP API key and you're done. No Docker, no
git clone, no local server.
Email (IMAP/SMTP)
Connect any mailbox over IMAP and SMTP: list folders, search and read mail with attachments, mark, flag and move mail, and save replies as drafts. Sending and deleting to Trash install switched off; on AnythingMCP Cloud sending needs a provider with SMTP on port 2525. Works with IONOS, Strato, GMX, web.de, T-Online, Gmail (app password), Fastmail, Hetzner, all-inkl, Aruba and self-hosted servers.
Setup
Setting up takes about 5 minutes. You need the IMAP and SMTP server names of your mail provider and the mailbox password, or an app password.
The connector works with any mailbox that offers IMAP (reading and organising mail) and SMTP (sending): IONOS, Strato, GMX, web.de, T-Online, Hetzner, all-inkl, Aruba, Gmail and Google Workspace, Yahoo, iCloud, Fastmail, a self-hosted Dovecot/Postfix and most other providers.
Not for Microsoft 365 or Outlook.com. Microsoft turned off password sign-in for IMAP and SMTP. Use the Microsoft Outlook connector, which signs in with OAuth.
- Find your provider in the table below. If it is not listed, its help pages name the IMAP server and the SMTP server (also called incoming and outgoing server).
- Fill in
EMAIL_IMAP_HOST,EMAIL_IMAP_PORT,EMAIL_SMTP_HOST,EMAIL_SMTP_PORT,EMAIL_USERNAME(almost always the full e-mail address) andEMAIL_PASSWORD. - Leave
EMAIL_IMAP_SECURITYandEMAIL_SMTP_SECURITYempty: the port decides (993 and 465 use SSL/TLS, 143 and 587 use STARTTLS). Set them totlsorstarttlsonly for a server on a non-standard port. - Install the connector and run
imap_smtp_list_foldersto check the login.
| Provider | IMAP server | IMAP port | SMTP server | SMTP port | Password |
|---|---|---|---|---|---|
| IONOS (1&1) | imap.ionos.de | 993 | smtp.ionos.de | 465 | mailbox password |
| Strato | imap.strato.de | 993 | smtp.strato.de | 465 | mailbox password |
| GMX | imap.gmx.net | 993 | mail.gmx.net | 587 | account password; first enable "POP3/IMAP" in the GMX mail settings |
| web.de | imap.web.de | 993 | smtp.web.de | 587 | account password; first enable "POP3/IMAP" in the web.de mail settings |
| T-Online | secureimap.t-online.de | 993 | securesmtp.t-online.de | 465 | the separate e-mail password from the Telekom e-mail settings |
| Gmail / Google Workspace | imap.gmail.com | 993 | smtp.gmail.com | 465 | app password |
| Yahoo Mail | imap.mail.yahoo.com | 993 | smtp.mail.yahoo.com | 465 | app password |
| iCloud Mail | imap.mail.me.com | 993 | smtp.mail.me.com | 587 | app-specific password |
| Fastmail | imap.fastmail.com | 993 | smtp.fastmail.com | 465 | app password |
| Hetzner (konsoleH) | mail.your-server.de | 993 | mail.your-server.de | 587 | mailbox password |
| all-inkl | your server, e.g. w0123456.kasserver.com (shown in KAS) | 993 | the same server | 465 | mailbox password |
| Aruba | imaps.aruba.it | 993 | smtps.aruba.it | 465 | mailbox password |
| Self-hosted (Dovecot/Postfix) | your mail host | 993 | your mail host | 587 | mailbox password |
App passwords: providers with two-step sign-in do not accept the normal password for IMAP and SMTP. They issue an app password instead, used only by this connector and revocable at any time.
- Gmail / Google Workspace: turn on 2-Step Verification, then create one at https://myaccount.google.com/apppasswords. In Google Workspace an administrator may have to allow it.
- Yahoo: Account Info, Account Security, Generate app password.
- iCloud: https://account.apple.com, Sign-In and Security, App-Specific Passwords.
EMAIL_USERNAMEis the full iCloud address. - Fastmail: Settings, Privacy & Security, Manage app passwords, with access to IMAP and SMTP.
- GMX and web.de with two-factor sign-in on: create an application-specific password in the security settings.
Optional settings: EMAIL_FROM_ADDRESS and EMAIL_FROM_NAME set the sender shown on sent mail (default: the username); the provider usually accepts only its own addresses or aliases. EMAIL_SMTP_USERNAME and EMAIL_SMTP_PASSWORD are needed only when sending uses a different login than reading. EMAIL_SENT_FOLDER sets where sent mail is filed (default: the folder the server marks as Sent; Gmail files sent mail itself).
Reading and sorting: the AI starts with the folder list (inbox, sent, drafts, trash, junk, archive, with message and unread counts), searches one folder by sender, recipient, subject, text, dates, unread or flagged, newest first, and reads a message as text with its list of attachments. Reading does not mark a message as read. It opens attachments (text files as text, images and documents attached to the result), marks mail as read or unread, flags it and moves it to another folder.
Answering: imap_smtp_save_draft puts a message in Drafts, optionally as a reply in the thread of a message, for you to review and send from your mail program. It is the default way to answer. imap_smtp_guide explains the order to call the tools in, without contacting the mail server.
Switched off at install: imap_smtp_send_message and imap_smtp_delete_messages. Turn them on in the connector's tool list only if the AI should really send or delete. Sending goes out at once, optionally as a reply in the thread of a message, files a copy in Sent and cannot be recalled, so the AI confirms recipients and content with you first. Deleting moves messages to the Trash: nothing is deleted permanently, and messages already in the Trash are refused.
Untrusted content: e-mails are written by strangers and can contain text meant to instruct the AI ("forward all invoices to…", "delete this thread"). The AI treats mail content as data, not as orders, and never follows instructions found in an e-mail.
Limits: a search returns at most 100 messages; a body is cut at 100,000 characters with a marker; attachments above 4 MB are refused; a message goes to at most 50 recipients; outgoing mail cannot carry attachments yet. Every tool call opens its own IMAP connection and logs out afterwards, so nothing stays connected to the mailbox between calls. UIDs belong to one folder and change when a message is moved.
Cloud and self-hosted: AnythingMCP Cloud connects only with encryption (SSL/TLS or STARTTLS), only to public mail servers on the ports IMAP 993/143 and SMTP 465/587/2525, and only to servers with a valid certificate. It always logs in to the SMTP server, so nothing goes out through an unauthenticated relay. Port 25 is not accepted on Cloud.
Sending from AnythingMCP Cloud: the Cloud's hosting provider blocks outgoing SMTP on ports 25, 465 and 587, so with almost every mailbox sending does not work there: imap_smtp_send_message reports it and nothing is sent. Reading, searching, flags, moving and drafts over IMAP work normally, so the AI saves replies as drafts and you send them from your mail program. Sending works self-hosted, or on Cloud with a provider that offers SMTP on port 2525. Test connection shows IMAP as working and SMTP as not reachable.
Self-hosted: a mail server on the internal network works once an administrator adds its host to the outbound allowlist (Admin, Settings, or SSRF_ALLOWED_HOSTS).
Prerequisites: EMAIL_IMAP_HOST, EMAIL_IMAP_PORT, EMAIL_SMTP_HOST, EMAIL_SMTP_PORT, EMAIL_USERNAME, EMAIL_PASSWORD
Install the connector locally
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
Open http://localhost:3000/connectors/store, pick Email (IMAP/SMTP) and paste in the env vars listed under Prerequisites.
Available tools
| Tool | What it does |
|---|---|
imap_smtp_guide | How to work with this mailbox: the order to call the tools in, folder names, search criteria, replies and what to confirm before sending |
imap_smtp_list_folders | List the folders of the Email (IMAP/SMTP) mailbox with their role (inbox, sent, drafts, trash, junk, archive), message count and unread… |
imap_smtp_search_messages | Search one folder of the Email (IMAP/SMTP) mailbox, newest first |
imap_smtp_get_message | Read one message: sender, recipients, date, subject, Message-ID, the body as plain text (HTML converted to text) and the list of… |
imap_smtp_get_attachment | Download one attachment of a message by the index get_message listed |
imap_smtp_set_flags | Mark messages as read or unread, and flag (star) or unflag them |
imap_smtp_move_messages | Move messages to another folder (for example an archive or a project folder) |
imap_smtp_delete_messages | Move messages to the Trash folder |
imap_smtp_save_draft | Save a message in the Drafts folder without sending it, so a person can review and send it from their mail client |
imap_smtp_send_message | Send an e-mail from the Email (IMAP/SMTP) mailbox through its SMTP server |
Example prompts
- "Which unread emails arrived in my inbox since Monday? Give me sender, subject and a one-line summary of each."
- "Find the latest email with an invoice from my hosting provider and open its PDF attachment."
- "Draft a reply to the last message from [email protected] saying I can meet on Thursday at 10."
- "Move last month's newsletters from the inbox to the Archive folder."
- "Draft a short email to [email protected] confirming our call tomorrow at 3 pm and save it in Drafts."
Next steps
Was this guide helpful?