Skip to content

Proton Mail Bridge

mcp-proton talks to Proton Mail only through Proton Mail Bridge, the desktop app that serves your mailbox over IMAP and SMTP on your own machine. This page covers setting Bridge up for mcp-proton, which Bridge settings matter, how Bridge behaves in ways an agent will notice, and what to do when the connection fails.

Bridge setting names below are as Proton's support pages give them. Bridge's interface changes between versions; if a name differs in yours, look for the closest match and check Proton's Bridge support.

Requirements

  • A paid Proton Mail plan. Bridge is not available on the free plan.
  • macOS, Windows or Linux. Bridge does not run on mobile devices. mcp-proton has been tested live only on macOS (Bridge 03.27.01); see Bridge compatibility.
  • On Linux, a keychain Bridge can use: a Secret Service provider (gnome-keyring, KWallet, KeePassXC) or pass. Without one Bridge cannot keep you signed in (Proton: cannot access keychain).

Business plans also offer SMTP Submission, which can send mail without Bridge. It does not provide IMAP, so it cannot replace Bridge for mcp-proton.

Set up Bridge

  1. Download and install Bridge from proton.me/mail/bridge, open it and sign in with your Proton account (Proton: install Bridge).
  2. Let the first synchronisation finish. Until it does, listings and searches can be incomplete.
  3. In Bridge, open the account's Mailbox details. They show the username, a password generated by Bridge, and the IMAP and SMTP host, port and security. Use these values for mcp-proton. Do not use your Proton account password; Bridge rejects it.
  4. Decide on the address mode (see Combined or split addresses).
  5. Run setup with the values from Mailbox details:
mcp-proton init --address you@proton.me --username you@proton.me \
  --imap-port 1143 --smtp-port 1025 --security starttls

Setup asks for the Bridge password and stores it in the OS keyring (or use --secret-ref env:VAR / file:PATH on a headless system). It then reads Bridge's certificate fingerprint and asks you to confirm it before pinning it.

To add another Bridge account or address later, use mcp-proton accounts add with the same options.

Bridge settings that matter

Bridge's settings are described in Proton's guide to Bridge settings. These affect mcp-proton:

Bridge setting What to do for mcp-proton
Default ports (Settings → Advanced settings) Bridge uses 1143 (IMAP) and 1025 (SMTP). If another application holds a port, Bridge reports an occupied port and Proton suggests raising it by one (Proton: port error). mcp-proton must use the same ports: pass --imap-port / --smtp-port, or edit imap_port / smtp_port in config.toml.
Connection mode STARTTLS (Bridge's default) or SSL, for both IMAP and SMTP. Pass the same with --security starttls or --security ssl (imap_security / smtp_security in config.toml). A mismatch shows up as a tls_error.
Export TLS certificates Writes Bridge's certificate and its private key to a folder you choose. mcp-proton needs only the certificate: pass it with --tls-ca-file instead of pinning the fingerprint. Keep the private key out of any folder an agent can read, or delete it.
Show All Mail Keep it on. messages_search with account_wide, and the compatibility probe's checks for whether a deletion destroyed a message, read All Mail. With it off, All Mail is not served over IMAP.
Split addresses See below.
Open on startup Turn on, unless something else starts Bridge. mcp-proton cannot reach your mail while Bridge is not running.
Automatic updates A Bridge update can change behaviour mcp-proton relies on. After an update, rerun the compatibility probe (see Bridge compatibility).
Repair Bridge Reloads every account and downloads all mail again; messages can disappear from IMAP for a while. Expect stale_handle errors for handles taken before the repair; list or search again to get new ones, and rerun the probe.
Reset Bridge Removes all accounts. Sign in again, then re-run mcp-proton init --replace (or accounts add --replace): the Bridge password and the certificate are new.

Alternative routing, appearance, usage diagnostics, the local cache location and beta access do not affect mcp-proton.

Combined or split addresses

Bridge serves all of an account's addresses in one of two modes:

  • Combined (Bridge's default): one mailbox for all addresses, one set of Mailbox details. Configure one mcp-proton account. To let agents send from your other addresses, list them with --identity (repeatable) or identities in config.toml; mcp-proton refuses any other sender address.
  • Split: turn on Split addresses in Bridge. Each address gets its own mailbox and its own Mailbox details. Add one mcp-proton account per address (mcp-proton accounts add --address ... --username ...), each with that address's Bridge password. --identity is refused in split mode.

Pass --address-mode combined or --address-mode split so diagnostics and probe reports record which mode was used. Switching modes in Bridge changes the mailboxes and credentials, so rerun setup for the affected accounts afterwards.

Running Bridge without a desktop

Bridge has a command-line interface for debugging and for systems without a working graphical session: protonmail-bridge -c on Linux (see Proton: Bridge CLI for macOS and Windows). Its commands change between versions; use its own help. On Linux it still needs a keychain (see Requirements).

For the isolated service deployment, Bridge and mcp-proton both run as the service user, and the agent user must not be able to read Bridge's keychain entry or mcp-proton's secret. See Deployment.

How Bridge behaves

mcp-proton presents Proton's model through IMAP as Bridge does. Live testing on Bridge 03.27.01 found the behaviour below; details and dates are in Bridge compatibility.

  • Labels are folders under Labels/. Applying a label copies the message into that folder; removing it removes only that copy. The message stays where it was.
  • A label cannot share a name with a folder. Proton refuses the second one.
  • Moving into a label acts as a copy. mcp-proton refuses that move (unsupported_semantics); use labels_apply.
  • All Mail is late. New, moved or deleted messages appear there after 10 to 25 seconds. messages_search takes wait_for_match for this.
  • Sent copies are filed late. A successful send may report no Sent copy yet; call mail_reconcile. With Proton's attach-public-key setting on, the Sent copy carries your public key as an attachment.
  • Header search matches raw headers. Bridge does not decode encoded headers when searching; mcp-proton rechecks those messages itself, so header searches work.
  • Body and text search can miss words inside base64 or quoted-printable parts. Results carry a note saying so.
  • Every message carries X-Pm-Internal-Id, the same in every folder and label it appears in. mcp-proton uses it to show one result per message in account-wide search.
  • Permanent deletion is limited to Trash and Spam. Expunging elsewhere is refused, because its effect in Proton is not established.

Troubleshooting

Error Likely cause What to do
bridge_unavailable Bridge is not running, is still starting, or uses other ports. Start Bridge (or turn on Open on startup). Check the ports in Mailbox details against config.toml. Run mcp-proton accounts test <name>.
auth_failed Wrong username or password, the Proton account password was used, or Bridge signed you out (for example after a Proton password change). Sign in to Bridge again if needed, copy the password from Mailbox details, and rerun mcp-proton init --replace for the account.
tls_error "fingerprint mismatch" Bridge's certificate changed (reinstall, reset, or a new machine). Check the new certificate, then rerun setup with --replace to pin it again.
tls_error "refused STARTTLS" or handshake failure Bridge's connection mode does not match. Use --security ssl if Bridge is set to SSL, --security starttls otherwise.
stale_handle The mailbox was rebuilt (Repair Bridge, resync, or the folder was deleted and recreated). List or search again for new handles.
unsupported_semantics The operation's effect in Proton is not established (for example, a move into a label). Use the operation the error suggests.
Searches miss recent mail Bridge has not applied the change yet, or the first sync is still running. Pass wait_for_match, or wait for Bridge's sync to finish.

mcp-proton diagnostics --json prints the configuration (without secrets) and the connection status, and is safe to attach to a bug report.