pylos-mcp
Provides email management for Gmail accounts, including searching, reading, drafting, and optionally sending and organizing messages.
Provides email management for GMX accounts, including searching, reading, drafting, and optionally sending and organizing messages.
Provides email management for iCloud Mail accounts, including searching, reading, drafting, and optionally sending and organizing messages.
Provides email management for mailbox.org accounts, including searching, reading, drafting, and optionally sending and organizing messages.
Provides email management for Proton Mail accounts via Proton Bridge, including searching, reading, drafting, and optionally sending and organizing messages.
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., "@pylos-mcpfind emails from my manager this week"
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.
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.
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.
Why this one
A typical email MCP server | pylos-mcp |
Raw HTML straight to the model | Plain text only, invisible characters stripped |
| No |
Send enabled out of the box | Send off by default, until an allowlist says who may be addressed |
Message text and instructions arrive mixed | Every message fenced as data, with suspicion warnings |
Delete means delete | Trash-only, no expunge |
Related MCP server: imap-mcp
Quick start
Add the server to your MCP client's config. For Claude Desktop that file is claude_desktop_config.json.
{
"mcpServers": {
"pylos-mcp": {
"command": "npx",
"args": ["-y", "pylos-mcp"],
"env": {
"PROVIDER": "mailbox.org",
"EMAIL_USER": "you@example.com",
"EMAIL_PASSWORD": "your-app-password"
}
}
}
}Use an app password rather than your account's regular login password, the table below 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.
Provider setup
Gmail, iCloud, Yahoo and Fastmail refuse regular account passwords over IMAP, so an app password is the only way in. mailbox.org, GMX and Posteo accept the account password, though a dedicated app password is still the wiser choice. Each provider's account settings cover creating one.
Provider |
| App password |
Gmail |
| Required, and Google only offers them once 2-Step Verification is on. |
iCloud |
| Required, needs two-factor authentication on the Apple ID. |
Yahoo |
| Required. |
GMX |
| Optional. |
Fastmail |
| Required. |
mailbox.org |
| Optional. |
Posteo |
| Optional. |
Proton Mail (via Bridge) | leave unset, set | Not an app password. Use the address Bridge tells you to use as the username and the password from 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, export it and point |
Self-hosted | leave unset, set | Whatever your server's own auth setup requires. For a private CA, point |
Capabilities
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 rather than merely refused, so a model never even learns a disabled tool exists.
Tier | Default | Tools |
| always on |
|
| on |
|
| off |
|
| off |
|
| off |
|
| off |
|
Enable more with a comma-separated list, for example CAPABILITIES=drafts,manage,delete.
Suspicion warnings
The server also tells you what is suspicious about a message. Three 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.
Warnings: hidden_text (412 hidden characters via display:none), encoded_blob (base64 run of 600 characters)Hidden text. Text concealed with the common CSS tricks,
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 rather than 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=truedrops it instead, with a note of how much was dropped.Instruction patterns. A deliberately small set of phrases that address an AI as an instruction target, like "ignore previous instructions". Small so that an inbox merely talking about AI stays quiet. Extend it with
FLAG_EXTRA_PATTERNS, pipe-separated phrases matched as case-insensitive literals.Encoded blobs. Long contiguous base64 or hex runs in the body, reported with their length and never decoded.
Warnings annotate, they never withhold. The message always comes back, and each detector has its own toggle in the reference below.
What this can never do
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.
No raw HTML ever reaches the model. Bodies come from the plain-text part when one exists or are converted to text otherwise, and invisible characters that could hide instructions from a human reader while staying readable to a model are stripped along the way.
Untrusted content is fenced. Everything that came from a mailbox, bodies, subjects, sender names, folder listings, Sieve script text, is wrapped in a labeled delimiter before the model sees it, and the delimiter sequence is neutralized wherever it appears inside the content, so a malicious email cannot forge a closing marker and write instructions outside the fence. The few lines that live outside the fence (the metadata line above a message, the one-sentence confirmations a tool returns after it acts, the Warnings line) are server-authored, stripped of hidden characters, collapsed onto a single line and length-capped, and the Warnings line never carries message content at all.
No
bccfield exists anywhere, not on drafts and not on sent mail. A bcc recipient receives a full copy of a message while appearing nowhere in it, and that invisibility is exactly what an injected email would want, a silent extra recipient that no review of the draft or of the sent copy could ever catch. The field is absent rather than guarded, so there is nothing to talk the model into.Deleting a message moves it to Trash. There is no expunge and no permanent-delete option, and the tool result never claims a permanence this server does not offer.
Sieve access is read-only, permanently. Server-side filter rules can forward, auto-reply and notify, each an exfiltration channel that survives revoking the app password or uninstalling this server. Scanning uploaded scripts for dangerous commands would only be safe if this project's parser agreed with the mail server's parser exactly, and any disagreement between the two is a bypass, so write access is left out entirely rather than defended.
Sending is the other risky door, so it starts closed even once the send capability is on. Until SEND_ALLOWLIST says who may be addressed, every send is refused, and the refusal names the two ways to open the gate. Choosing 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 rather than ground truth.
Configuration reference
All configuration is environment variables, validated at startup. Invalid configuration fails immediately with an actionable message, never partway through a conversation.
Variable | Default | Notes |
| none | One of |
| required | Account login. |
| none | App password. Either this or |
| none | Command whose stdout is the password, such as a keychain lookup or |
| preset / | Explicit values for self-hosted servers. Set either to override the preset. |
| preset / | Required only when |
|
| Used only when |
|
| Comma-separated list of tiers beyond |
|
| Message body truncation limit. |
|
| Attachment size cap, checked against the size the server declares before any bytes are downloaded. |
|
| Where |
|
| Successful |
|
| Append a copy of each sent message to the Sent folder, marked read. Turn off for providers that already file sent mail server-side (Gmail does), which would otherwise show duplicates. |
| none (sending closed) | Comma-separated addresses or |
|
| When |
|
| Warn when message HTML hides text with inline styles or |
|
| Warn when the body contains phrases addressing an AI as an instruction target. |
|
| Warn on long contiguous base64 or hex runs in the body. |
|
| Drop detected hidden text from the body instead of only warning, with a note of how much was dropped. Requires |
| none | Pipe-separated phrases added to the instruction-pattern set, matched as case-insensitive literal substrings. |
| none | Path to a PEM CA certificate added as an extra trust anchor, for self-hosted servers with a private CA. Certificate verification cannot be turned off, this only extends what is trusted. Setting it trusts Node's bundled root store plus this file, which means anchors added through |
Maintenance expectations
pylos-mcp is built for the author's own daily use and maintained on that basis. Issues and pull requests are welcome, and CONTRIBUTING.md carries a wishlist of directions that would genuinely help. The scope stays narrow on purpose, so if you need something wider than the security posture allows, fork away. The codebase is deliberately small enough to make that pleasant.
Development
npm install
npm test # unit and MCP-layer tests, entirely offline
npm run test:integration # starts a disposable local Dovecot container, tests against it, tears it down
npm run buildNo test in this project connects to a real mailbox, in development or in CI. npm test runs in-process fakes, and npm run test:integration brings up its own local Dovecot container over Docker, seeded with synthetic fixture messages, and removes it when the run finishes.
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 Servers
- Flicense-qualityCmaintenanceLocal IMAP/SMTP MCP server that lets Claude read, search, draft, send, flag, and move mail across multiple IMAP mailboxes. Credentials stay on your machine.Last updated
- Alicense-qualityBmaintenanceAn MCP server that gives Claude access to plain IMAP mailboxes, enabling reading, searching, moving, and forwarding emails with safety controls configured via config files.Last updatedMIT
- AlicenseAqualityCmaintenanceAn MCP server that lets Claude read, search, and send email over standard IMAP/SMTP.Last updated6MIT
- Alicense-qualityAmaintenanceA safe-by-default MCP server that gives Claude access to your Proton Mail through Proton Mail Bridge's localhost IMAP/SMTP. Sending requires human approval and destructive operations are limited.Last updatedMIT
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
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/adamVass/pylos-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server