Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables email management for Proton Mail accounts through the Proton Mail Bridge, supporting reading, sending, replying, and organizing emails via natural language.

README.md

Proton MCP Server

A complete TypeScript Model Context Protocol (MCP) server for Proton Mail integration via Proton Mail Bridge.

What This Does

This MCP server provides full email management capabilities through Claude Code by connecting to Proton Mail Bridge running locally. It allows you to:

  • List and browse mailbox folders
  • List, search, and read emails
  • Send new emails and replies
  • Move and delete emails
  • Access full message content with attachments

Prerequisites

  1. Proton Mail Bridge running and accessible on localhost:
  • IMAP server on port 1143 (STARTTLS)
  • SMTP server on port 1025 (STARTTLS)
  1. Node.js 18 or higher
  2. A valid Proton Mail account with Bridge credentials

Setup

1. Install Dependencies

npm install

2. Configure Environment

Copy the environment template and add your Proton credentials:

cp .env.example .env

Edit .env with your settings:

PROTON_IMAP_HOST=127.0.0.1
PROTON_IMAP_PORT=1143
PROTON_SMTP_HOST=127.0.0.1
PROTON_SMTP_PORT=1025
PROTON_USER=your-proton-email@protonmail.com
PROTON_PASS=your-bridge-password

3. Build

npm run build

4. Run Locally (Development)

npm run dev

Or run the compiled version:

npm start

Usage with Claude Code

Add this MCP server to your Claude settings (~/.claude/settings.json):

{
  "mcpServers": {
    "proton": {
      "command": "node",
      "args": ["/path/to/proton-mcp-server/dist/index.js"],
      "env": {
        "PROTON_USER": "your-email@protonmail.com",
        "PROTON_PASS": "your-bridge-password",
        "PROTON_IMAP_HOST": "127.0.0.1",
        "PROTON_IMAP_PORT": "1143",
        "PROTON_SMTP_HOST": "127.0.0.1",
        "PROTON_SMTP_PORT": "1025"
      }
    }
  }
}

Or with TypeScript/tsx:

{
  "mcpServers": {
    "proton": {
      "command": "npx",
      "args": ["tsx", "/path/to/proton-mcp-server/src/index.ts"]
    }
  }
}

Available Tools

Reading Tools (Read-Only)

  • proton_list_folders — List all mailbox folders with message and unread counts
  • proton_list_emails — List emails in a folder with pagination (newest first)
  • proton_search_emails — Advanced search with filters (from, to, subject, date range, body content, unread status)
  • proton_read_email — Read the complete email content including headers, body, and attachment list

Writing Tools

  • proton_send_email — Send a new email (plain text or HTML)
  • proton_reply_email — Reply to an email with proper threading headers
  • proton_move_email — Move email to another folder
  • proton_delete_email — Delete email (move to Trash)

Project Structure

proton-mcp-server/
├── src/
│   ├── index.ts              # Main entry point
│   ├── constants.ts          # Configuration constants
│   ├── types.ts              # TypeScript interfaces
│   ├── schemas/
│   │   └── index.ts          # Zod input schemas
│   ├── services/
│   │   ├── imap.ts           # IMAP client wrapper
│   │   └── smtp.ts           # SMTP client wrapper
│   └── tools/
│       ├── folders.ts        # proton_list_folders
│       ├── list.ts           # proton_list_emails
│       ├── search.ts         # proton_search_emails
│       ├── read.ts           # proton_read_email
│       ├── send.ts           # proton_send_email
│       ├── reply.ts          # proton_reply_email
│       ├── move.ts           # proton_move_email
│       └── delete.ts         # proton_delete_email
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
└── README.md (this file)

Implementation Notes

IMAP Connection

  • Uses imapflow library with STARTTLS on port 1143
  • Proton Bridge uses self-signed certificates, so tls.rejectUnauthorized: false
  • All connections are properly closed with logout() in finally blocks

SMTP Connection

  • Uses nodemailer with STARTTLS on port 1025
  • Supports plain text and HTML email bodies
  • Properly sets In-Reply-To and References headers for email threading

Message Parsing

  • Uses mailparser to extract full message content
  • Supports text, HTML, and attachment handling
  • Returns attachment metadata (filename, content type, size)

Pagination

  • Email list pagination uses offset and limit parameters
  • Results are always newest first
  • Search results also support pagination

Troubleshooting

Connection Issues

  • Ensure Proton Mail Bridge is running: protonmail-bridge --cli
  • Check localhost connectivity: telnet 127.0.0.1 1143 (IMAP) and 1025 (SMTP)
  • Verify credentials in .env file

Email Issues

  • Some email clients may not recognize replies without proper Message-ID headers
  • HTML emails are parsed to text; use the raw HTML body for better formatting
  • Large attachments may take time to process

Build Issues

  • Ensure Node.js 18+ is installed: node --version
  • Clear node_modules and reinstall: npm clean-install
  • Check TypeScript compilation: npm run build

Dependencies

  • @modelcontextprotocol/sdk — MCP protocol implementation
  • imapflow — IMAP client for email reading
  • nodemailer — SMTP client for sending emails
  • mailparser — Email parsing and content extraction
  • zod — Input validation schemas
  • dotenv — Environment variable loading

License

MIT

Support

For issues with Proton Mail Bridge, see: https://proton.me/support/bridge

For MCP protocol documentation, see: https://modelcontextprotocol.io

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Communication servers.