Read-focused, prompt-injection-hardened email MCP server for any IMAP provider
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Read-focused, prompt-injection-hardened email MCP server for any IMAP provider.
Anyone in the world can put text in your inbox, and the moment an AI assistant reads that inbox, anyone in the world can put text in front of your assistant. pylos-mcp is an email MCP server built around that fact. It lets Claude, or any MCP client, search, read and draft your mail while treating every message as what it really is, input from a stranger. Mailbox content is fenced as data before the model sees it, and there is no bcc field for an injected email to quietly copy someone with.
It runs on your machine and speaks plain IMAP, so it works with Gmail, iCloud, Yahoo, GMX, Fastmail, mailbox.org, Posteo, Proton via Bridge, or anything self-hosted, and your credentials never leave home. Out of the box it can read and draft. Anything riskier, moving, sending, deleting, is a separate switch that stays off until you flip it.
Mail is attacker-controlled text, so the hard limits live in the architecture rather than in a prompt. No message can talk the server out of any of these.
bcc field exists anywhere, on drafts or sent mail. A bcc recipient receives a full copy of a message while appearing nowhere in it, exactly the invisibility an injected email wants. The field is absent rather than guarded, so there is nothing to talk the model into.Sending is the other risky door, so it starts closed even with the send capability on. Until SEND_ALLOWLIST says who may be addressed, every send is refused, and the refusal names the two ways to open the gate. SEND_ALLOWLIST=* allows anyone, visibly and on purpose.
Fencing reduces prompt-injection risk, nothing eliminates it. The model still reads text written by strangers, so treat every response that includes message content as untrusted input, not ground truth. The finer design notes live in SECURITY.md.
Add the server to your MCP client's config. For Claude Desktop that file is claude_desktop_config.json.
Use an app password, not your account's regular login password. The next section says which providers insist on one. Restart the client and the read and draft tools appear. Later config changes need the same treatment, a newly enabled capability only registers its tools after a full client restart, and in Claude Desktop toggling the server off and on is not always enough.
Set PROVIDER to one of gmail, icloud, yahoo, gmx, fastmail, mailbox.org or posteo and the matching IMAP, SMTP and Sieve hosts and ports fill themselves in.
Gmail, iCloud, Yahoo and Fastmail refuse regular account passwords over IMAP, so an app password is the only way in. Google only offers one once 2-Step Verification is on, and iCloud wants two-factor authentication on the Apple ID first. mailbox.org, GMX and Posteo accept the account password, though an app password is still the wiser choice.
Proton Mail goes through Bridge. Leave PROVIDER unset and set IMAP_HOST and IMAP_PORT to what Bridge shows. The username is the address Bridge tells you to use, and the password is the one in Bridge's Mailbox details, IMAP section, not your Proton account password. Bridge defaults to STARTTLS while this server only speaks implicit TLS, so switch Bridge to SSL in its Advanced Settings. Bridge's certificate is self-signed, so export it and point TLS_CA_FILE at it.
Self-hosted servers also leave PROVIDER unset. Set IMAP_HOST, plus SMTP_HOST or SIEVE_HOST when those optional tiers are enabled, and authenticate however your server requires. For a private CA, point TLS_CA_FILE at the CA certificate. Verification itself always stays on, this only adds a trust anchor.
Capabilities are independent switches, not a ladder. Reading is always on, drafting starts on, everything else stays off until you list it in CAPABILITIES. A switched-off tier has its tools left out of the tool list entirely, not merely refused, so a model never learns a disabled tool exists.
| Tier | Default | Tools |
|---|---|---|
read | always on | search_emails, get_email, get_attachment, list_folders |
drafts | on | create_draft |
manage | off | move_email, set_flags |
send | off | send_email |
delete | off | delete_email |
sieve-read | off | list_sieve_scripts, get_sieve_script |
Enable more with a comma-separated list, for example CAPABILITIES=drafts,manage,delete.
The server also tells you what is suspicious about a message. Four detectors annotate get_email results with a line above the content, written entirely in the server's own words and never quoting the content that tripped them.
display:none, invisible or one-pixel fonts, matching text and background colors, off-screen positioning, aria-hidden. It covers inline styles and attributes, a tripwire, not a rendering engine. Newsletters legitimately hide short preview text, so the warning fires only past a threshold, unless the hidden text itself contains an instruction-like phrase or an encoded run, which warns at any length. The text stays in the body by default. STRIP_HIDDEN_TEXT=true drops it instead, with a note of how much was dropped.FLAG_EXTRA_PATTERNS, pipe-separated phrases matched as case-insensitive literals.Warnings annotate, they never withhold. The message always comes back, and each detector has its own toggle in the reference below.
All configuration is environment variables, validated at startup. Invalid configuration fails immediately with an actionable message, never partway through a conversation. An empty value counts as unset, since bundle managers fill optional fields users leave blank with empty strings.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pylos-mcp)<a href="https://allmcps.com/mcp/pylos-mcp"><img src="https://allmcps.com/api/badge/pylos-mcp?style=directory" alt="Pylos MCP on AllMCPs" /></a>