# pylos-mcp

> pylos-mcp is an open-source MCP server for communication. Email MCP server for Gmail, Outlook and IMAP that fences messages against prompt injection. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux
- **Repository:** https://github.com/adamvass/pylos-mcp
- **MCP Registry name:** io.github.adamVass/pylos-mcp
- **Categories:** communication, security
- **Listing updated:** 2026-11-15

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add pylos-mcp --env EMAIL_USER='<EMAIL_USER>' --env EMAIL_PASSWORD='<EMAIL_PASSWORD>' -- npx -y pylos-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "pylos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pylos-mcp"
      ],
      "env": {
        "EMAIL_USER": "<EMAIL_USER>",
        "EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "pylos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pylos-mcp"
      ],
      "env": {
        "EMAIL_USER": "<EMAIL_USER>",
        "EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "pylos-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "pylos-mcp"
      ],
      "env": {
        "EMAIL_USER": "<EMAIL_USER>",
        "EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "pylos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pylos-mcp"
      ],
      "env": {
        "EMAIL_USER": "<EMAIL_USER>",
        "EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "pylos-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pylos-mcp"
      ],
      "env": {
        "EMAIL_USER": "<EMAIL_USER>",
        "EMAIL_PASSWORD": "<EMAIL_PASSWORD>"
      }
    }
  }
}
```

## Tools

- `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.

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Agent Roast](https://ai-powered.com/mcp/agent-roast): Agent Roast is an open-source MCP server for developer tools.
- [Midplane](https://ai-powered.com/mcp/midplane): Midplane is an open-source MCP server for databases.
- [Leash](https://ai-powered.com/mcp/leash): Leash is a free MCP server for security.
- [Tinplate Edge AI Safety, Security & EU Compliance](https://ai-powered.com/mcp/tinplate-edge-ai-safety-security-and-eu-compliance): Tinplate Edge AI Safety, Security & EU Compliance is a freemium MCP server for security.
- [SecureCloud](https://ai-powered.com/mcp/securecloud): SecureCloud is a free MCP server for security.
- [BoardAgent](https://ai-powered.com/mcp/boardagent): BoardAgent is a free MCP server for community directories.
- [Callout](https://ai-powered.com/mcp/callout): Callout is a freemium MCP server for communication.

---
Source: https://ai-powered.com/mcp/pylos-mcp
