protonmail
MCP server for protonmail written in rust
claude mcp add --transport stdio tensortemplar-protonmail-mcp-server protonmail-mcp-server \ --env IMAP_HOST="127.0.0.1" \ --env IMAP_PORT="1143" \ --env IMAP_PASSWORD="your-bridge-password" \ --env IMAP_USERNAME="your@email.com" \ --env MCP_TRANSPORT="http or stdio" \ --env MCP_AUTH_TOKEN="your-secret-token (required for http)" \ --env MCP_SSE_KEEPALIVE="true (default) or false for older Python SDK"
How to use
This ProtonMail MCP Server provides MCP (Model Context Protocol) tools backed by an unofficial IMAP bridge to ProtonMail via the Bridge. It exposes mailbox operations as MCP tools, enabling your AI assistants to list mailboxes, fetch inbox items, search emails, and retrieve full message contents through a local Bridge connection. Available tools include listing mailboxes, getting inbox items, searching emails with keyword support, fetching full emails, and managing tags and attachments. The HTTP transport variant supports per-session IMAP connections with bearer token authentication and SSE streaming for responses, while the standard binary/stdio mode offers a local transport path. To operate, configure the required IMAP Bridge credentials and set a transport mode, then run the server binary or configured entry point. The tools are exposed under the MCP interface, and can be invoked by clients using standard MCP RPC payloads.
How to install
Prerequisites:
- Rust toolchain (cargo) or prebuilt binaries for ProtonMail MCP Server
- Access to the ProtonMail Bridge and an IMAP-compatible bridge host/port
- Optional: Git to clone from source
Install options:
- Via prebuilt binaries (recommended):
- Linux curl -LO https://github.com/TensorTemplar/protonmail-mcp-server/releases/latest/download/protonmail-mcp-server-x86_64-unknown-linux-gnu.tar.gz tar xzf protonmail-mcp-server-x86_64-unknown-linux-gnu.tar.gz chmod +x protonmail-mcp-server sudo mv protonmail-mcp-server /usr/local/bin/
- macOS (Apple Silicon) curl -LO https://github.com/TensorTemplar/protonmail-mcp-server/releases/latest/download/protonmail-mcp-server-aarch64-apple-darwin.tar.gz tar xzf protonmail-mcp-server-aarch64-apple-darwin.tar.gz chmod +x protonmail-mcp-server sudo mv protonmail-mcp-server /usr/local/bin/
- macOS (Intel) curl -LO https://github.com/TensorTemplar/protonmail-mcp-server/releases/latest/download/protonmail-mcp-server-x86_64-apple-darwin.tar.gz tar xzf protonmail-mcp-server_x86_64-apple-darwin.tar.gz chmod +x protonmail-mcp-server sudo mv protonmail-mcp-server /usr/local/bin/
- Windows (PowerShell) Invoke-WebRequest -Uri "https://github.com/TensorTemplar/protonmail-mcp-server/releases/latest/download/protonmail-mcp-server.exe-x86_64-pc-windows-msvc.zip" -OutFile "protonmail-mcp-server.zip" Expand-Archive protonmail-mcp-server.zip -DestinationPath .
- Via cargo (Rust) (recommended if you have Rust installed):
- From crates.io cargo install protonmail-mcp-server --features http
- Or from source git clone https://github.com/TensorTemplar/protonmail-mcp-server cd protonmail-mcp-server cargo install --path . --features http
Configure and run:
- Set environment variables as described in the README (IMAP_HOST, IMAP_PORT, IMAP_USERNAME, IMAP_PASSWORD, MCP_TRANSPORT, MCP_AUTH_TOKEN).
- Run the server binary or via cargo installed path, e.g. protonmail-mcp-server.
Verification and updates:
- Optional: verify binaries with provided SHA256 checksums and signatures as described in the README.
Additional notes
Environment and configuration tips:
- The MCP transport supports stdio as the default and http when using the HTTP transport mode. If using HTTP, you must provide MCP_AUTH_TOKEN for authentication.
- SSE keep-alive behavior may differ between Python MCP SDK versions; if you encounter JSON parsing issues with older SDKs, consider setting MCP_SSE_KEEPALIVE=false.
- The server exposes a suite of MCP tools (e.g., list_mailboxes, get_inbox_items, search_emails, get_email, etc.). Ensure your client uses the correct protocol version and capabilities per the MCP spec.
- If you encounter IMAP connection limits or timeouts, consider adjusting IMAP_HOST/PORT or using per-session IMAP connections per the architecture notes.
- For production, place the server behind a reverse proxy with TLS if exposing HTTP endpoints publicly.
Related MCP Servers
rust -schema
A type-safe implementation of the official Model Context Protocol (MCP) schema in Rust.
turbovault
MCP server that transforms your Obsidian vault into an intelligent knowledge system
tsrs
tushare rust mcp server
mcp-loxone
An opinionated Model Context Protocol (MCP) server for controlling Loxone home automation systems.
ultrafast
High-performance, ergonomic Model Context Protocol (MCP) implementation in Rust
firecrawl -zed
Firecrawl MCP Server for Zed