ExplainerUpdated November 5, 2026
IMAP MCP vs hosted MCP server for email: which is safer?
The difference is what your agent's tool holds. A password-based IMAP MCP server signs in to your mail provider with your mailbox password or an app password, while a hosted MCP server that uses OAuth gives your agent a revocable token with the permissions you approved[9]. IMAP with a password still makes sense for providers without an API and for setups that should stay on one machine, but Google and Microsoft have largely closed that route for their accounts[5][6][7][8].
Below you will find what a well-built local IMAP server can restrict today, using mcp-email-server as the example[1][3], how such a server fits with Claude and Docker[17][18], why "hosted" does not always mean "no password"[10], and how to choose.
Contents
- Your agent signs in twice
- A local IMAP MCP server in practice
- What handing over a mailbox password means
- Which providers still accept IMAP with a password
- IMAP MCP with Claude and Docker
- How to judge an IMAP MCP server
- What a hosted MCP server changes
- How to choose
- Where Command Mail fits
- Connect Command Mail to your agent
- Review status
- Frequently asked questions
- Sources
01Your agent signs in twice
An email MCP server sits between your AI client and your mailbox, and each side has its own sign-in. Claude, ChatGPT, Cursor or another client first connects to the MCP server. The server then fetches mail from Gmail, Outlook.com, Fastmail or whichever provider holds it.
The MCP specification makes authorization optional for the first sign-in, and the current 2026-07-28 revision keeps it that way; where it is supported, the rules depend on transport. Where an implementation supports authorization over HTTP, it should follow the specification's flow, which is based on OAuth 2.1, and servers that run locally over stdio should not, taking credentials from the environment instead[9]. A stdio server is simply a program on your computer that trusts whoever starts it.
For the second sign-in there are four routes: IMAP and SMTP with a password or app password, IMAP and SMTP with OAuth, the provider's own API with OAuth (Gmail API, Microsoft Graph), or no sign-in to the original mailbox at all because mail arrives by forwarding. Google and Microsoft both support IMAP with OAuth[6][7]. Asking "IMAP MCP or hosted MCP" mixes these two layers. A hosted server can speak IMAP with an app password behind the scenes, and a local server can use OAuth.
02A local IMAP MCP server in practice
mcp-email-server is an open-source, BSD-3-licensed[15] server that reads, searches, organizes and sends mail over IMAP and SMTP on Windows, macOS and Linux[1]. It is actively maintained; version 1.14.0 shipped on 2026-11-03[19]. Setup starts with an email address and password, and the interface suggests common server settings from the domain[1]. Its configuration, tools and transport documents describe no OAuth sign-in for the mailbox[2][3][4].
The password stays on your machine and travels only to your provider. In managed mode the project stores credentials as plain-text values in a dedicated table of a private, access-restricted SQLite database on Linux and Windows, and in the system keyring on macOS[2][13]. Copies and backups of that database therefore contain the passwords too and need the same protection[13]. The command line takes passwords through masked input or standard input[2].
You can narrow what the agent may do. Write actions fall into five classes (draft, organize, delete, send, append); all five are allowed by default, and an empty list makes an account read-only[2][3]. Recipients are governed by an allowlist: when it is empty, sending, forwarding and general saves to a mailbox are denied, and only a pattern such as *@example.com or an explicit * opens it[2]. The project notes that this is the behavior since a fix; earlier implementations let any recipient through when the list was empty[13]. If you run an older installation, update it and check that list.
Version 1.13.0 added email_command, which runs short sequences of raw IMAP and SMTP commands for things the focused tools do not cover, such as copying, renaming or deleting whole mailboxes[3][19]. It is off by default for every account, never inherited and cannot be switched on over MCP. You enable it yourself, and the server only accepts it alongside compatible grants, for SMTP for example an explicit * recipient pattern[2][3]. Leave it off unless you need it.
The server also offers SSE and Streamable HTTP and checks Host and Origin headers by default to block DNS rebinding[4]. The project still recommends stdio for Claude Desktop and other local clients[4]. Its documentation is explicit that exposing a transport does not authenticate anyone; authentication and network access belong at the proxy or surrounding platform[4].
03What handing over a mailbox password means
With IMAP, a mailbox password or app password typically opens the entire mailbox, so any finer limit has to come from the MCP server. mcp-email-server provides exactly that through its permission classes and recipient lists[2][3]. Those limits live inside the server, though; anyone who obtains the stored credential can bypass them.
The project is candid about this. It calls its local management interface a single-user trust boundary and notes that a malicious process running as the same operating-system user can generally read or replace that user's files[13]. On a personal laptop that is a reasonable assumption; on a shared machine it is a weaker one.
Revoking access happens at the provider. You delete an app password in your provider account, or you change the mailbox password, which also disconnects every other app that used it.
04Which providers still accept IMAP with a password
Most large providers have stopped accepting username and password sign-in from other apps. This table shows what that means for an IMAP MCP server.
| Provider | Password-based IMAP for other apps (as of 2026-11-04) | Source |
|---|---|---|
| Gmail (personal) | Only with an app password; requires 2-Step Verification, and Google advises against it | [5] |
| Google Workspace | OAuth required since March 14, 2025, with app passwords as the exception | [6] |
| Microsoft 365 (Exchange Online) | Basic authentication for IMAP and POP disabled in all tenants | [7] |
| Outlook.com, Hotmail | Basic authentication no longer works since September 16, 2024 | [8] |
Google says app passwords are not recommended and unnecessary in most cases, and some accounts cannot create them at all, for example accounts with Advanced Protection or some work and school accounts[5]. Microsoft adds that switching off basic authentication also stops app passwords from working with apps that lack two-step verification support[7]. A password-only IMAP server therefore cannot reach Outlook.com or Microsoft 365.
For other providers, check their help pages to see whether password-based IMAP or app passwords are supported and under which conditions. We have not surveyed those providers individually here. Where your provider offers no suitable alternative interface, an IMAP MCP server is often the most direct option.
05IMAP MCP with Claude and Docker
There are two distinct ways to connect an IMAP MCP server to Claude, and they work differently. A local server such as mcp-email-server runs over stdio: Claude Desktop launches it as a program on your computer from the client's configuration, in this project's case with uvx mcp-email-server@latest stdio as the command[1][4]. Anthropic describes these local servers as a separate mechanism configured through claude_desktop_config.json that uses your local network but is not available in Cowork or claude.ai[17][18].
A Claude connector is something else. Anthropic says Claude connects to custom connectors from its own cloud infrastructure, in every client including Claude Desktop and the mobile apps, so the MCP server must be reachable over the public internet from Anthropic's IP ranges[17]. An IMAP MCP server reachable only on your laptop or through a private VPN cannot be used directly as a connector. To use it as a connector anyway, you would run it over HTTP on a reachable host and put your own authentication in front, because the server does not authenticate callers just because a transport is exposed[4]. Your mailbox password then lives on that host, and running and securing it is on you.
For Docker, the project has published official Linux images for amd64 and arm64 at ghcr.io/wh1isper/mcp-email-server since release 1.6.2[1]. A container does not change the underlying question: it needs the same credentials and the same permission settings as a local install.
06How to judge an IMAP MCP server
Without testing every server against your provider, a ranking of IMAP MCP servers would be guesswork. What you can check is whether a project supplies the limits a mailbox password lacks. We derived these points from the mcp-email-server documentation[2][3][4][13]:
- Read-only is explicit. A mode or permission list blocks every write action.
- Write rights are separate. Drafts, organizing, deleting and sending can be allowed one by one.
- Sending can be narrowed. An empty recipient list denies rather than allows, and you confirm that after every update.
- Raw access is off. Tools for free-form IMAP or SMTP commands are disabled by default and cannot be enabled by the agent.
- Credential storage is documented. Check separately whether passwords are encrypted or stored in plain text and who can read the store. In managed mode, mcp-email-server uses the system keyring on macOS, but stores plain-text values in an access-restricted SQLite database on Linux and Windows; backups contain those values too[13].
- HTTP is guarded. Localhost binding and Host and Origin checks by default, with authentication handled in front.
- OAuth where the provider demands it. Gmail without an app password and Microsoft accounts both need an OAuth route[6][7].
Our email MCP server comparison names the main options and applies criteria like these.
07What a hosted MCP server changes
A hosted MCP server runs at the vendor, and your agent connects over the internet, signing in with OAuth or an API key depending on the service[9][10]. With OAuth you approve the token's permissions when connecting and can revoke the connection later without touching your mailbox password. In exchange, a further company runs the server and handles whatever data passes through it.
Hosted does not automatically mean passwordless. MCP Emails, for instance, says it connects Gmail with a Google app password over IMAP, Outlook or Microsoft 365 with Microsoft sign-in over OAuth, and Fastmail, iCloud, Yahoo, Zoho and Yandex with app-specific passwords, and that it keeps one encrypted token or app password per inbox so it can make the next call[10]. It says it does not store the mail an agent reads, with scheduled sends and sends held for approval as the exceptions[10]. The app password then sits on the service's servers rather than your laptop.
Before choosing any hosted service, find out which credential for your mailbox it keeps, whether it stores mail, and whether sending can be switched off separately from reading.
08How to choose
Where your mail lives and who you are willing to trust with a credential matter more than the label local or hosted.
- One mailbox at a provider that allows password IMAP, and everything should stay local: a local password-based IMAP server such as mcp-email-server, with tight permission classes and a recipient allowlist[2][3].
- Gmail or Microsoft 365, and the agent should work in the original mailbox: a server that signs in to the provider with OAuth, through its API or IMAP with OAuth, self-hosted or hosted. Our guide to MCP servers for Google mailboxes covers the options there[6].
- Claude on the web, in Cowork or on your phone: a server reachable over the internet with OAuth sign-in; a local stdio server will not do there[17].
- No password leaves your hands, and addresses from several providers should share one inbox: an agent inbox that receives copies by forwarding.
09Where Command Mail fits
Command Mail is our product: a hosted MCP server that does not sign in to your original mailbox to read it. Your addresses forward copies to Command Mail, so receiving needs neither a mailbox password nor an app password[11]. Only if you set up sending for an address through your provider's SMTP server do you store an app password; Command Mail checks it with one sign-in and keeps it encrypted (app code, commit 60c8c3d). In that case Command Mail does hold an app password, for sending. Sending through Command Mail itself needs none. Forwarding is not a sync; when the agent sorts or archives mail, the change happens in Command Mail only[16].
Your agent connects over Streamable HTTP with OAuth 2.1, PKCE and dynamic client registration[11]. Access tokens last one hour and refresh tokens 30 days, and both can be revoked. OAuth offers the scopes mail:read, mail:draft, mail:send-approved, mail:send and mailboxes; the consent screen lets you untick any requested permission, and mail:send for sending without approval starts unticked[11] (app code, commit 60c8c3d). Sending without approval additionally requires the sending mailbox to be on the auto autonomy level, a send key per email and a daily limit[11][12].
There are trade-offs. Copies of your mail are held by another company, FYN Labs LLC in the USA, with the app and database at Cloudflare and attachments in Cloudflare's EU region[14]. Read access covers every mailbox in the account, and depending on the autonomy level mail:read also allows sorting[11]. The Free plan cannot send[11]. Forwarding alone does not turn an address into a sending address; from Pro, you set up sending for each sender address[16]. That happens only in the app under Settings → Connections, not through an agent: either your provider's SMTP server with an app password, so recipients see your own address, or sending through Command Mail, so the message comes from a Command Mail address and replies go to your address. Outlook.com and Hotmail only have the second route, because Microsoft requires an OAuth sign-in to send from them. According to the app code, the display name is the saved address label; without one, it is your account name, or your own address for approved agent drafts. The public docs do not describe the two routes or the block on agent tokens; we checked both against the app code on 2026-11-04.
10Connect Command Mail to your agent
You can connect Command Mail over MCP or through the directory listings, and you choose your agent's permissions yourself[11]:
- MCP address:
https://commandmail.app/mcpfor Claude Code, Codex, Cursor and other clients with remote MCP; sign-in uses OAuth 2.1[11]. - Plugin or connector: in ChatGPT as the official plugin from the plugin directory, in Claude as a community connector from the directory[11]. Because the server is hosted, it also works in claude.ai and Cowork[17].
- Permissions, not full access: every right can be switched off when you connect, sending without approval starts switched off, and an approved draft goes out only in exactly the version a person confirmed[11][12].
You can start for free and connect your agent without the send permission at first; for read-only use, also set its mailboxes to the read autonomy level. The permissions documentation covers every right and level.
11Review status
As of 2026-11-04. The mcp-email-server documents and releases, the Google, Microsoft, Anthropic and MCP pages and the MCP Emails site were retrieved again that day[1][10][17][19]. Statements about Command Mail were checked against llms.txt, the public docs and the app code at commit 60c8c3d (oauth.ts, oauth-scopes.ts, the consent page under src/routes/oauth/authorize, outbox.ts, agent-drafts.ts, and the sending setup in send-routes.ts, smtp-presets.ts and the api/addresses/[id]/sending route). We did not install any of the servers named here or test them with a real mailbox. New since the 2026-10-25 version: email_command and the note on empty recipient lists in older versions, Claude and Docker, the checklist for IMAP MCP servers, MCP Emails' provider list, the stored SMTP app password at Command Mail and the section on connecting.
Frequently asked questions
Is a password-based IMAP MCP server a security risk?
Not by itself. A local server such as mcp-email-server keeps the password on your machine and can restrict write actions and recipients. The catch is that a mailbox password or app password usually opens the whole mailbox, so every limit has to be enforced by the server.
Can I still use IMAP with a password for Gmail or Outlook?
For Gmail only with an app password, which requires 2-Step Verification, and Google itself advises against it. Outlook.com and Microsoft 365 no longer accept username-and-password sign-in, so an app needs OAuth there.
Can I add a local IMAP MCP server to Claude as a connector?
Not directly. Claude connects to custom connectors from Anthropic's cloud, so the server has to be reachable over the public internet. A local stdio server is configured in Claude Desktop and, according to Anthropic, is not available in Cowork or claude.ai. To use it as a connector anyway, you would have to expose it over HTTP and put your own authentication in front of it.
Does hosted mean no password is involved?
No. Hosted only says where the server runs. How your agent signs in and how the service reaches your mailbox are separate questions. Some hosted services still store an app password for IMAP mailboxes, just on their own servers.
What does my agent hold with a hosted OAuth MCP server?
An access token for the MCP server, carrying the permissions you approved when connecting. With Command Mail that token expires after one hour, is renewed with a refresh token and can be revoked; the agent never sees a mailbox password.
Do I need an IMAP MCP server for a mailbox at a small provider?
If the agent should work directly in the original mailbox and the provider has no other suitable interface, often yes, or a hosted service that speaks IMAP for you. Command Mail takes a different route and receives copies by forwarding, so receiving needs no mailbox password. You only need an app password if you want to send through your provider's SMTP server, and Command Mail then stores it encrypted.
Sources
- mcp-email-server: README
- mcp-email-server: Configuration
- mcp-email-server: MCP tools and mutation permissions
- mcp-email-server: Transports
- Google: Sign in with app passwords
- Google Workspace: Transition from less secure apps to OAuth
- Microsoft Learn: Deprecation of Basic authentication in Exchange Online
- Microsoft: Modern authentication now needed for Outlook.com in non-Microsoft email apps
- Model Context Protocol: Authorization (2026-07-28)
- MCP Emails: Hosted email MCP server
- Command Mail: plans, connection and permissions
- Command Mail: Permissions and autonomy
- mcp-email-server: Security
- Command Mail: Privacy policy
- GitHub API: mcp-email-server (license BSD-3-Clause)
- Command Mail: documentation on setup and sending
- Claude Help Center: Get started with custom connectors using remote MCP
- Claude Help Center: Getting started with local MCP servers on Claude Desktop
- mcp-email-server: Releases (1.14.0 on 2026-11-03, 1.13.0 adding email_command)