Connector guide8-minute read10 MCP tools7 languages

How to Connect Email (IMAP/SMTP) to Claude via MCP

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.

HCBy HelpCode teamUpdated 8 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Email (IMAP/SMTP)

Email (IMAP/SMTP)

Connect any mailbox over IMAP and SMTP: list folders, search and read mail with attachments, mark, flag, move and delete to Trash, save drafts and send or reply. Works with IONOS, Strato, GMX, web.de, T-Online, Gmail (app password), Fastmail, Hetzner, all-inkl, Aruba and self-hosted servers.

tools

10

Region

INTL

Category

Email

Authentication

Basic Auth

Required env vars

EMAIL_IMAP_HOSTEMAIL_IMAP_PORTEMAIL_SMTP_HOSTEMAIL_SMTP_PORTEMAIL_USERNAMEEMAIL_PASSWORD
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

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.

Start free trial

AnythingMCP is listed in Claude's connector directory: add it to Claude in one click (opens in a new tab), then sign in and choose which MCP servers Claude may use.

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.

Email (IMAP/SMTP) · live via MCP
Share
Opus 4.7

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) + Claude

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.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

EMAIL_IMAP_HOST, EMAIL_IMAP_PORT, EMAIL_SMTP_HOST, EMAIL_SMTP_PORT, EMAIL_USERNAME, EMAIL_PASSWORD

Step 1 — Get credentials

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.

  1. 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).
  2. Fill in EMAIL_IMAP_HOST, EMAIL_IMAP_PORT, EMAIL_SMTP_HOST, EMAIL_SMTP_PORT, EMAIL_USERNAME (almost always the full e-mail address) and EMAIL_PASSWORD.
  3. Leave EMAIL_IMAP_SECURITY and EMAIL_SMTP_SECURITY empty: the port decides (993 and 465 use SSL/TLS, 143 and 587 use STARTTLS). Set them to tls or starttls only for a server on a non-standard port.
  4. Install the connector and run imap_smtp_list_folders to check the login.
ProviderIMAP serverIMAP portSMTP serverSMTP portPassword
IONOS (1&1)imap.ionos.de993smtp.ionos.de465mailbox password
Stratoimap.strato.de993smtp.strato.de465mailbox password
GMXimap.gmx.net993mail.gmx.net587account password; first enable "POP3/IMAP" in the GMX mail settings
web.deimap.web.de993smtp.web.de587account password; first enable "POP3/IMAP" in the web.de mail settings
T-Onlinesecureimap.t-online.de993securesmtp.t-online.de465the separate e-mail password from the Telekom e-mail settings
Gmail / Google Workspaceimap.gmail.com993smtp.gmail.com465app password
Yahoo Mailimap.mail.yahoo.com993smtp.mail.yahoo.com465app password
iCloud Mailimap.mail.me.com993smtp.mail.me.com587app-specific password
Fastmailimap.fastmail.com993smtp.fastmail.com465app password
Hetzner (konsoleH)mail.your-server.de993mail.your-server.de587mailbox password
all-inklyour server, e.g. w0123456.kasserver.com (shown in KAS)993the same server465mailbox password
Arubaimaps.aruba.it993smtps.aruba.it465mailbox password
Self-hosted (Dovecot/Postfix)your mail host993your mail host587mailbox 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_USERNAME is 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).

Step 2 — Install the adapter

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

Step 3 — Add the connector in Claude

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Recommended path: works on claude.ai web without editing any config file.

  1. In Claude, open Customize → Connectors.
  2. Click +, then Add custom connector.
  3. Enter a name, e.g. Email (IMAP/SMTP), and the remote MCP server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID, then click Add.
  4. Click Connect and sign in to AnythingMCP (OAuth) to allow access.

All tools below appear in your chat: start typing prompts.

Available tools

ToolWhat it does
imap_smtp_guideHow 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_foldersList the folders of the Email (IMAP/SMTP) mailbox with their role (inbox, sent, drafts, trash, junk, archive), message count and unread…
imap_smtp_search_messagesSearch one folder of the Email (IMAP/SMTP) mailbox, newest first
imap_smtp_get_messageRead one message: sender, recipients, date, subject, Message-ID, the body as plain text (HTML converted to text) and the list of…
imap_smtp_get_attachmentDownload one attachment of a message by the index get_message listed
imap_smtp_set_flagsMark messages as read or unread, and flag (star) or unflag them
imap_smtp_move_messagesMove messages to another folder (for example an archive or a project folder)
imap_smtp_delete_messagesMove messages to the Trash folder
imap_smtp_save_draftSave a message in the Drafts folder without sending it, so a person can review and send it from their mail client
imap_smtp_send_messageSend 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."

FAQ

Does it work with Claude Code as well as Claude Desktop? Yes, point both at https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID.

Next steps

Was this guide helpful?

Your Email agent is one click away.

Install the connector, paste the key, prompt Claude. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Email (IMAP/SMTP) to ChatGPT via MCP

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.

Connectors

How to Connect Email (IMAP/SMTP) to Microsoft Copilot via MCP

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.

Connectors

How to Connect Email (IMAP/SMTP) to Cursor via MCP

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.

Connectors

How to Connect Email (IMAP/SMTP) to Gemini via MCP

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.

Connectors

How to Connect Email (IMAP/SMTP) to Meta Muse via MCP

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.

Connectors

Email (IMAP/SMTP) to MCP: Search, Read, Sort and Send Mail from any Mailbox in any AI Agent

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.