proton-safe-mcp is a client-agnostic FastMCP server that accesses Proton Mail through the official Proton Mail Bridge. It can read and search mail, create drafts with attachments, and inspect received attachments such as PDF, TXT, CSV, etc. (via bounded text extraction, without exposing raw bytes). The server runs locally over STDIO and works with any MCP-compatible client such as Claude Desktop, Claude Code, etc.
Core security design: there is no SMTP client or send tool in the code, nor are there delete, move, or raw attachment download tools; draft creation requires explicit confirmation in the conversation of the recipients, subject, body, and attachments; attachments are uploaded in chunked base64 with size and SHA-256 verification, and the client does not need to and cannot pass in filesystem paths; it listens only on STDIO, and the Bridge host is hardcoded to 127.0.0.1.
Usage: requires Linux (developed and tested on Ubuntu), a Proton plan that supports Bridge, Proton Mail Bridge installed, logged in, and running, Python 3.11–3.14, uv, and a working Secret Service keyring. After installing from PyPI, set the Proton address and Bridge IMAP port in the MCP process environment, store the IMAP password generated by Bridge in the system keyring, and then register the local STDIO server in the client. Optionally provide PROTON_BRIDGE_ALIASES to use other sender addresses for the same account.
Attachment and draft flow: compute the file byte length and SHA-256, call begin_attachment_upload, base64-encode in chunks according to the returned max_chunk_bytes and call upload_attachment_chunk chunk by chunk, then call finish_attachment_upload to obtain the attachment_token; show the user the exact recipients, subject, body, and attachment list, and after confirmation call create_confirmed_draft(..., user_confirmed=true, attachment_tokens=[token]), and finallymanually review and send in Proton Mail. Unused uploaded attachments expire after 30 minutes.
Limitations: email content is attacker-controllable input, extracted attachment text may contain prompt injection, and the server does not perform OCR or malware scanning; user_confirmed is a client assertion and cannot constitute a boundary against a controlled client; the Bridge self-signed TLS certificate is not verified (only because the target is fixed to local). Windows 11 support has been implemented but not yet released, and end-to-end acceptance has not been tested.