pylos-mcp
Email MCP server for Gmail, Outlook and IMAP that fences messages against prompt injection
- Pricing
- Open source
- Platforms
- CLI, macOS, Windows
- Runs
- Locally
- Version
- 1.4.0
- Listing updated
- 2 days ago
About pylos-mcp
pylos-mcp is an open-source MCP server for communication. It runs locally on your machine and is started by your AI client.
pylos-mcp treats every incoming message as input from a stranger. Each email reaches the assistant fenced, with a Warnings line flagging things like sender_mismatch, hidden_text, instruction_patterns, mixed_script and encoded_blob, plus Reply-To mismatches and failed DMARC checks. The README notes that fencing reduces prompt-injection risk but does not eliminate it.
Capabilities are separate switches. Reading is always on and drafts are on by default, while manage (move, flag), send, delete and sieve-read stay off until listed in CAPABILITIES; disabled tiers are left out of the tool list entirely. Sending requires a recipient allowlist, can ask for confirmation per message, and no tool attaches local files or adds forwarding rules.
It runs locally via npx on Node.js 22 or later and supports Gmail, Outlook and Microsoft 365 (browser sign-in), iCloud, Yahoo, GMX, Fastmail, mailbox.org, Posteo and generic IMAP, including several accounts at once. A --demo flag serves a sample inbox with no mail server.
Install
Run in a terminal
claude mcp add pylos-mcp --env EMAIL_USER='<EMAIL_USER>' --env EMAIL_PASSWORD='<EMAIL_PASSWORD>' -- npx -y pylos-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"pylos-mcp": {
"command": "npx",
"args": [
"-y",
"pylos-mcp"
],
"env": {
"EMAIL_USER": "<EMAIL_USER>",
"EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"pylos-mcp": {
"command": "npx",
"args": [
"-y",
"pylos-mcp"
],
"env": {
"EMAIL_USER": "<EMAIL_USER>",
"EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"pylos-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"pylos-mcp"
],
"env": {
"EMAIL_USER": "<EMAIL_USER>",
"EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"pylos-mcp": {
"command": "npx",
"args": [
"-y",
"pylos-mcp"
],
"env": {
"EMAIL_USER": "<EMAIL_USER>",
"EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"pylos-mcp": {
"command": "npx",
"args": [
"-y",
"pylos-mcp"
],
"env": {
"EMAIL_USER": "<EMAIL_USER>",
"EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
}
}
}
}Configuration
EMAIL_USERAccount login.RequiredEMAIL_PASSWORDApp password. Either this or EMAIL_PASSWORD_CMD is required, except with PROVIDER=outlook, which signs in through the browser.PROVIDEROne of gmail, outlook, icloud, yahoo, gmx, fastmail, mailbox.org, posteo. Fills in IMAP, SMTP and Sieve hosts and ports.IMAP_HOSTIMAP hostname for self-hosted or unlisted providers. Overrides the preset.CAPABILITIESComma-separated list of tiers beyond read, which is always included. Defaults to drafts.MS_CLIENT_IDWith PROVIDER=outlook only. Application ID of an app registered in your organization's tenant.MS_TENANTWith PROVIDER=outlook only. Tenant ID or domain, for a single-tenant MS_CLIENT_ID.ACCOUNTSNames of several accounts, separated by commas, each 1 to 16 lowercase letters or digits. Each account's settings then end in __ and its name in capitals, such as EMAIL_USER__WORK. Leave the unsuffixed account settings out.
Tools this server provides (12)
Taken from the project documentation; the running server may differ.
- search_emails
- Search by text, sender, recipient, subject, dates, unread or flagged status.
- get_email
- Read one message with its warnings.
- get_thread
- List the conversation a message belongs to.
- get_attachment
- Fetch an attachment.
- list_folders
- List mail folders.
- create_draft
- Create a draft, optionally threaded as a reply.
- move_email
- Move a message between folders.
- set_flags
- Set flags on messages.
- send_email
- Send a message to allowed recipients.
- delete_email
- Delete a message.
- list_sieve_scripts
- List Sieve filter scripts.
- get_sieve_script
- Read a Sieve script.
What it does
- Injection warnings
- Flags hidden text, AI-directed phrases, lookalike letters and DMARC failures.
- Tiered capabilities
- Read, drafts, manage, send, delete and sieve-read are separate switches.
- Send safeguards
- Sending is off by default and limited to allowed recipients.
- Many providers
- Gmail, Outlook, iCloud, Yahoo, GMX, Fastmail, mailbox.org, Posteo and IMAP.
- Multiple accounts
- Configure several named accounts side by side.
- Demo inbox
- Try it with sample mail and no sign-in.
Good for
- Ask what needs attention in your inbox today
- Summarise a long thread
- Draft replies without sending them
- Triage suspicious messages with warnings
Pricing
Open source
Free, runs locally
pylos-mcp FAQ
Can it send mail by default?
No. Sending starts off, drafts wait in your Drafts folder, and enabling sending needs a recipient allowlist.
What does it need to run?
Node.js 22 or later; for most providers an app password, and for Outlook a browser sign-in.
Can I try it without a mailbox?
Yes. Run it with --demo for a sample inbox.
Where do attachments go?
Attachments you request are saved to your Downloads folder.
Is pylos-mcp free?
Yes. pylos-mcp is open source, so you can use and self-host it for free.
How do I add pylos-mcp to Claude Code?
Run this command in your terminal: claude mcp add pylos-mcp --env EMAIL_USER='<EMAIL_USER>' --env EMAIL_PASSWORD='<EMAIL_PASSWORD>' -- npx -y pylos-mcp
What are the best alternatives to pylos-mcp?
The closest alternatives to pylos-mcp are REA, Agent Roast, Midplane, Leash and Tinplate Edge AI Safety, Security & EU Compliance.
Alternatives to pylos-mcp

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools
Agent Roast
MCP serverOffline review that flags agent changes which weaken tests, assertions or CI
Runs locally- Open source
- 4 Hacker News points
- Developer tools

Midplane
MCP serverPostgres gateway for AI agents with table grants, column masking and approval for writes
Runs locally- Open source
- 5 GitHub stars
- Databases

Leash
MCP serverReview what your AI touched, approve risky actions and undo supported changes
- 1 tool
- Remote
- Free
- 1 GitHub star
- Security
Zero-log MCP server with 49 tools for AI guardrails, secret scanning and EU compliance
- 49 tools
- Remote
- Freemium
- Security

SecureCloud
MCP serverSentinelOne and IT security catalog, prices, quotes and checkout links for Israel
- 7 tools
- Remote
- Free
- Security