
Baryon — Proton Mail via Bridge
io.github.combor由 GitHub 帳號 combor 發布v0.7.0更新於 Oct 24, 2026
Read Proton Mail and save drafts through your local Proton Mail Bridge.
概覽
一個本機 MCP 伺服器,讓 AI 助理透過 Proton Mail Bridge 搜尋與閱讀 Proton Mail,並準備草稿供你審閱與寄送。
- 可以做什麼
- 列出資料夾,依文字、寄件者、收件者、主旨、日期或未讀狀態列出或搜尋郵件,可選擇附上縮短的內文以便快速篩選,支援游標分頁與資料夾白名單。讀取單封郵件或整個對話,包含寄件者、回覆地址與密件副本地址、純文字與 HTML 內文以及附件中繼資料。列出、取得並儲存附件,儲存到本機磁碟時僅限已設定的目錄。建立或取代草稿,儲存自動推導收件者與對話串標頭的回复草稿,以及攜帶原文內文、HTML、附件與內嵌圖片的轉寄草稿。列出草稿可使用的寄件身分。
- 適用情境
- 適合讓助理對 Proton Mail 信箱進行篩選、摘要或搜尋,並把回覆或轉寄準備成草稿,而寄送仍由你自己掌控。適合已在本機執行 Proton Mail Bridge、希望取得以讀取為主且權限受限的信箱連線的使用者。
- 執行需求
- 以本機程序透過 stdio 執行,僅限桌面端。需要安裝、登入並執行 Proton Mail Bridge,需要能啟動本機 stdio 伺服器的 MCP 用戶端,需要 Bridge 的 IMAP 使用者名稱與 Bridge 產生的密碼,以及 Bridge 匯出的 TLS 憑證。憑證可透過環境變數提供,或由安裝指令存入系統鑰匙圈或權限為 600 的檔案。在 Linux 上使用 Docker 需要主機網路模式。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Baryon — Proton Mail via Bridge,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Baryon MCP
A local, permission-limited bridge between Proton Mail and the AI you choose
Baryon connects an MCP-compatible AI assistant to Proton Mail through a local Proton Mail Bridge.
It lets your assistant search and read email, understand conversations, work with attachments, and prepare drafts for you to review. Baryon cannot send email, move or delete ordinary messages, or mark messages as read.
Baryon has no hosted service. You decide which MCP client and AI model receive your email content.
[!IMPORTANT] Baryon and Proton Mail Bridge run locally, but your AI may not.
Email content requested through Baryon is returned to your MCP client and can be passed to the model it uses. With a local or self-hosted model, processing can remain on infrastructure you control, depending on your client configuration. With a hosted service, selected email content is sent to that provider.
For example, using Baryon with hosted Claude or Codex models sends requested email content to Anthropic or OpenAI infrastructure respectively. Review your client's and provider's privacy and data-retention terms before connecting it to your mailbox.
What you can do
- Find messages by text, sender, recipient, subject, date, or unread state.
- Read an email or an entire conversation.
- Inspect, retrieve, and save attachments.
- Prepare new messages as Proton Mail drafts.
- Forward a message as a draft, with its attachments and embedded images.
- Review, edit, and send those drafts yourself in Proton Mail.
For example, you could ask your assistant:
Find the renewal notices I received this month and summarise the price changes.
Read my conversation with Alice and prepare a polite follow-up draft.
Find the PDF invoice attached to the latest message from Acme and save it locally.
Summarise this support thread and draft a reply covering the unresolved questions.
Useful access, deliberate limits
Replacing an existing draft saves its replacement before removing the previous draft copy. Baryon has no tool for deleting ordinary received or sent messages.
How it works
Baryon talks only to Proton Mail Bridge on your computer. It refuses to send Bridge credentials to a non-loopback address and verifies Bridge using its exported TLS certificate by default.
Before you start
You will need:
- Proton Mail Bridge installed, signed in, and running.
- An MCP client that can launch local MCP servers over
stdio. - The IMAP username and generated password shown in Bridge's mailbox settings.
- Bridge's exported TLS certificate for a verified connection.
Use the password generated by Bridge, not your normal Proton account password. Export cert.pem from Settings → Advanced settings → Export TLS certificates in Proton Mail Bridge.
Installation
1. Install the binary
macOS:
Windows, with Scoop:
Nix, from the package repository:
Arch Linux — baryon-mcp-bin from the AUR:
Debian-based Linux distributions (amd64 and arm64):
RPM-based Linux distributions (amd64 and arm64):
Anywhere else, download the archive for your platform from the latest release and extract baryon-mcp onto your PATH. Releases provide macOS, Linux, FreeBSD, and OpenBSD builds for amd64 and arm64, Windows amd64 builds, and DEB and RPM packages for Linux amd64 and arm64, alongside a SHA256SUMS file. Hash your download and compare it with the matching line in that file:
2. Run the setup
Setup pins Bridge's TLS certificate, stores your Bridge credentials, and registers baryon with any installed Claude Code and Codex CLIs, which then launch the binary directly — no wrapper script and no credentials in a client configuration file. The Bridge password goes into the system keyring (Secret Service on Linux with gnome-keyring, KWallet or KeePassXC running; Login Keychain on macOS; Credential Manager on Windows), and into a mode-600 file under ~/.config/baryon-mcp when no keyring answers.
On Linux, if no exported certificate is found, setup offers to pin the certificate the running Bridge is serving — after verifying through procfs that the process owning the port is a Bridge executable running as you — and shows its fingerprint before asking. Bridge installed headlessly (protonmail-bridge-core) has no certificate-export UI, so this is the expected path there. baryon-mcp setup --help lists the options, including --reset-credentials, --tls-cert and --client.
Configuring a client by hand
baryon-mcp setup knows how to configure Claude Code and Codex. For any other MCP client, point it at the baryon-mcp binary yourself. The surrounding configuration format varies between clients, but the server entry looks like this:
This basic configuration may store Bridge credentials as plaintext. Prefer baryon-mcp setup, which keeps them out of client configuration entirely, or your client's secure secret storage. Any variable set here takes precedence over the stored credentials, so the two can be mixed — a client entry can override the endpoint while the password stays in the keyring.
Proton Pass CLI
If you keep the Bridge password in Proton Pass, pass-cli run can resolve it at launch, so the client configuration holds a reference instead of the password:
pass-cli run passes the MCP stdio stream through unchanged and preserves the exit code. --no-masking matters: by default pass-cli rewrites any occurrence of the resolved secret in the child's output, which would corrupt a tool result whose mailbox content happens to contain the Bridge password. An expired Proton Pass session or an unresolvable reference fails on stderr before the server starts, which surfaces in the client's MCP log.
Hosted AI clients
[!CAUTION] The installation methods below connect Baryon to hosted AI products. Email content retrieved through Baryon is sent to the relevant provider when the client gives it to the model.
Claude Desktop
Download the .mcpb bundle for your platform from the latest release, open it, and enter the Bridge settings when prompted.
Claude Code and Codex
Install the binary and run baryon-mcp setup, as above. It registers both CLIs it finds on PATH; --client claude or --client codex configures only one, and an existing baryon entry is left alone unless --force-client-config is given.
Docker on Linux
ghcr.io/combor/baryon-mcp is published for linux/amd64 and linux/arm64. It exists so MCP directories can start the server and read its tool schemas, and so Linux users can run Baryon in a container. On macOS and Windows use the native binaries: Docker Desktop does not share the host loopback interface that Bridge listens on.
Baryon speaks stdio, so the client launches the container rather than connecting to a port:
--network=hostis required. Bridge listens on the host's loopback interface, and Baryon refuses to send credentials to any other address.- Keep
PROTON_BRIDGE_USERNAMEandPROTON_BRIDGE_PASSWORDin the env file and supply them at run time. It holds the Bridge password in plain text, so create it outside any repository andchmod 600it. Never bake credentials into an image or commit them in a Compose file. - Replace
1000:1000with your ownid -uandid -g. Bind mounts keep host ownership, so without--userthe container runs as UID 65532 and cannot read a mode-0600 certificate or write into your attachment directory.save_attachmentcreates files mode 0600 owned by whichever UID the container ran as, so running as yourself keeps them readable. - Keep
BARYON_ATTACHMENT_ROOTSpointed at the mounted directory, as above. Without it the server creates its attachment directory under the container user's home, which a--useroverride usually cannot write to, and startup fails rather than falling back to unrestricted access. - Anyone who can reach the Docker daemon can read a running container's environment. On a desktop, prefer a native binary configured with
baryon-mcp setup, which keeps credentials in the system keyring or in mode-600 files. - With both credentials absent the image still starts and serves tool schemas, so a directory can inspect it; every tool call then reports the missing configuration. Supplying only one credential fails at startup.
Security boundaries
- Baryon refuses to send Bridge credentials to a non-loopback host.
- Bridge's TLS certificate is pinned by default. Without a certificate, Baryon refuses to start unless insecure mode is explicitly enabled.
- Read tools select mailboxes read-only and do not mark messages as read.
save_draft,save_reply_draftandsave_forward_draftare the only tools that change the mailbox, and only inside Drafts. There are no send, move, general delete, or flag-changing tools.save_attachmentis the only tool that writes to local disk. It never overwrites an existing file or creates a missing parent directory.- Local attachment reads and writes are confined to a managed folder by default, or to the directories chosen with
BARYON_ATTACHMENT_ROOTS. - Reading can be limited to an allowlist of folders with
BARYON_ALLOWED_FOLDERS. A folder outside it is refused before the mailbox is opened, and never appears inlist_folders. - Replies can only be sent from the addresses in
BARYON_SENDER_IDENTITIES, and never carry the original message's Bcc recipients. - Message content is labelled
content_trust: "untrusted_email"wherever it is returned, and fenced with an unguessable delimiter for clients that read only text blocks. - MCP clients can access the message content and attachments you request. Connect only clients and models you trust.
Advanced reference
Available MCP tools
Configuration options
Baryon creates the default attachment directory at mode 0700 when it starts, and refuses to start if it cannot. Setting BARYON_ATTACHMENT_ROOTS replaces that default entirely — those directories must already exist. On Windows there is no attachment directory, because both file-touching tools refuse to run there.
BARYON_ALLOWED_FOLDERS names must match Bridge's spelling exactly, except INBOX, which matches case-insensitively. Draft saving is outside this scope, so a reply can still be saved when Drafts is not on the list.
Without an explicit or auto-discovered certificate, Baryon refuses to start unless PROTON_BRIDGE_ALLOW_INSECURE=true. Insecure mode allows another local process to impersonate Bridge and capture its generated password.
BARYON_ALLOW_UNCONFIGURED_INTROSPECTION=true applies only when both credentials are absent, which is how a published image can be started and inspected without a mailbox. Every tool call then fails with a configuration error, and a half-configured server — one credential set, the other missing — still refuses to start.
Stored credentials and `baryon-mcp setup`
baryon-mcp setup stores credentials that the server loads whenever the corresponding environment variable is unset; a set environment variable always wins. The layout under ${XDG_CONFIG_HOME:-~/.config}/baryon-mcp (mode 0700):
The keyring item is stored under service baryon-mcp-proton-bridge with the Bridge address as its username, so a keyring browser shows it as Password for '[email protected]' on 'baryon-mcp-proton-bridge' and
retrieves it. Exactly one password store survives a setup run: saving into the keyring removes the file, and falling back to the file removes the keyring item. A keyring that stops answering — or blocks locked for more than ten seconds — reads as "no stored credentials" rather than an error, so containers and headless machines keep working.
Reading messages and attachments
For reading mail:
- Call
list_folders. - Call
list_emailsorsearch_emails. - Pass the returned
folder,uid, anduidvaliditytoget_emailor the attachment tools.
Every summary carries the message's message_id, which correlates the same message across folders — the copy in All Mail and the copy in INBOX share it, while their UIDs do not.
list_emails and search_emails accept include_bodies, which adds a shortened body to every summary on the page. That turns triage into a single call — "which of my unread messages need attention" — instead of one get_email per message, and the full message is still one get_email away where the preview shows it matters. Bodies are the plain-text part when the message has one, and otherwise the HTML part reduced to the text a reader would see, flagged by body_from_html. Stripping happens before shortening, so the character budget buys readable text rather than markup, and body_truncated marks a body cut short. get_email still returns both parts as they were sent, HTML included. Because bodies are far larger than envelopes, a page carrying them is capped at 10 messages: a larger limit is refused rather than silently trimmed, and an omitted one defaults to 10. Previews are peeked like every other read, so triaging unread mail leaves it unread.
For the next page, pass the returned next_before_uid back as before_uid, together with uidvalidity. Mail arriving between two calls then cannot shift or repeat a result, which plain offset paging cannot promise. offset still works, but the two cannot be combined, and the call fails rather than paging a mailbox whose uidvalidity changed.
Attachments come back in two ways. get_attachment returns the bytes inline—images as image content and other files as base64—which puts them in the conversation. save_attachment writes the decoded bytes to a path and returns only the path, so a large attachment never reaches the model's context.
output_path may be relative, in which case it resolves inside the attachment directory, or absolute and inside it. The parent directory must already exist and the target file must not. Both attachment tools are bounded at 25 MB decoded, so save_attachment removes the context cost, not the fetch cap.
Replying
save_reply_draft answers one message. Pass the folder, uid and uidvalidity you read it with, plus the body; everything else is derived from the message:
- Recipients come from its
Reply-To, else itsFrom, else itsSender. Your own addresses are removed and duplicates collapse. A message that names nobody else there — one of your own, or one forging your address — is refused rather than answered at the other recipients it lists;save_draftis where you name recipients yourself. reply_alladditionally copies itsToandCc. The originalBccis never carried over; only abccyou pass yourself is kept.frommust be one ofBARYON_SENDER_IDENTITIES— calllist_sender_identitiesto see them. Omitted, Baryon picks the identity the message was addressed to, then the one it was sent from, then the default.- Subject keeps an existing
Re:prefix, in any case, or gains one. - Threading sets
In-Reply-Toto the parent'sMessage-IDandReferencesto its chain followed by it. A message with noMessage-IDis refused: it cannot be threaded correctly, andsave_draftremains available for it.
The original is quoted only when you set quote_original. It is then copied whole below your text, under an "On , wrote:" line, with > prefixes in plain text and a <blockquote> in HTML, together with the images its HTML shows inline. Its other attachments are never copied. The response echoes every derived field, so the recipients can be reviewed before you send the draft from Proton Mail. save_reply_draft only ever creates a draft; replacing one stays with save_draft.
Forwarding
save_forward_draft forwards one message. Pass the folder, uid and uidvalidity you read it with, the recipients, and optionally a note in text_body or html_body. Baryon reads the original and writes the draft itself, so neither the message nor its attachments pass through the conversation or touch local disk:
- Body is your note, then a
---------- Forwarded message ----------block naming the original's From, Date, Subject, To and Cc, then the original text and HTML copied whole. A plain-text original forwarded with a plain note stays plain text. - Attachments all travel with it. Images the original's HTML shows through
cid:links stay inline; everything else is a regular attachment. - Subject keeps an existing
Fwd:orFw:prefix, in any case, or gainsFwd:. fromis chosen as for a reply. Recipients are optional and can be added in Proton Mail before sending.
The draft carries no In-Reply-To or References, so it starts a new conversation for its recipients. An original whose body is above 2 MiB, or whose attachments exceed 100 files or 25 MB, is refused rather than cut short. warning reports text that could not be decoded exactly, and attachments whose encoding was damaged, which carry only what was readable.
Things to know about forwards, and about replies that quote:
- A draft carrying more than 50,000 characters cannot be replaced faithfully with
save_draft, which reads it back truncated, and a replacement loses its inline images. Edit such a draft in Proton Mail instead. - Proton Mail keeps a draft's HTML body when it has one, and Bridge does not tell it which message a draft forwards, so the original is not marked as forwarded.
- Nested attachment containers become separate files, and attachments without a filename get generated names such as
part-1.2.png. Attachments keep their Content-Type parameters, such as a calendar invitation's method, except a charset other than UTF-8: such a text file keeps its bytes but loses its charset label. - The original HTML is embedded as it was sent,
<head>styles included.
Creating and replacing drafts
For drafts, omit uid and uidvalidity to create one. To replace an existing draft, pass both values and submit the complete desired state. Read the current draft with get_email and fetch any attachments first so recipients, bodies, and files can be retained.
Each attachment supplies its content in exactly one of two ways:
content_base64: inline bytes, withfilenameandcontent_typerequired.content_path: a path to a regular file on the machine running Baryon, relative to the attachment directory or absolute and inside it.filenamedefaults to the path's basename andcontent_typeis inferred from the extension.
All attachments are read and validated before anything touches the mailbox, so a missing or unreadable file fails the call without creating or replacing a draft.
save_reply_draft derives a reply's threading for you. To thread one by hand, read the message being answered with get_email, then pass its message_id as in_reply_to, and its references followed by that same message_id as references. When the parent reports no references, use its in_reply_to in their place, as RFC 5322 section 3.6.4 prescribes.
Angle brackets are optional on message identifiers, but each identifier must be a well-formed id-left@id-right. Baryon rejects anything it could not read back and strips the self-reference Bridge adds to References, so the chain it reports can be quoted as-is.
A replacement gets a new UID. Baryon appends it before removing the previous draft and returns a warning if cleanup is incomplete. The replacement keeps the previous draft's Message-ID, plus whichever of its In-Reply-To and References the call omits. Omitting one of those fields keeps the existing header; passing an empty array removes it and detaches the draft from its thread.
Limits and platform notes
Reading limits:
- 50,000 characters each for the plain-text and HTML bodies
get_emailreturns. - 2,000 characters per shortened body, in both
get_threadand the listing tools, counted after markup is stripped. - 10 messages per page when
list_emailsorsearch_emailsis called withinclude_bodies; 100 without it. - 50 messages per conversation from
get_thread, keeping the most recent.
Draft limits:
- 50,000 characters each for the plain-text and HTML bodies you write. A forwarded or quoted original is carried whole, up to 2 MiB per body.
- 100 regular attachments.
- 100 message identifiers each in
in_reply_toandreferences, with 512 bytes per identifier. A longer chain read from a message is trimmed to its most recent identifiers. - 25 MB decoded per attachment and in total, across both content sources.
- Generated RFC822/MIME message below 70 MiB.
- Standard base64 for inline content.
save_draftcannot add inline CID images; forwards and quoted replies keep the original's. - Attached messages (
message/rfc822and othermessage/types) travel unencoded, as MIME requires. One that is not in CRLF form, has a line over 998 bytes, or holds a NUL byte is attached as a genericapplication/octet-streamfile instead, so its bytes, and any signature over them, stay exact. This applies tosave_draftas well as forwards. content_pathandsave_attachmentare not available on Windows. Usecontent_base64andget_attachmentthere.
Baryon speaks MCP 2026-07-28 and negotiates down to any earlier revision back to 2024-11-05, so older clients keep working.
Detailed local-file protections
The draft tools with content_path read local files with the server's privileges. They refuse anything but regular files after resolving symlinks. save_attachment never overwrites and creates no directories. Every read tool, including get_attachment, is annotated read-only.
Both are confined to the same directories. Unset, that is the managed ${XDG_CONFIG_HOME:-~/.config}/baryon-mcp/attachments, created at mode 0700 when the server starts; BARYON_ATTACHMENT_ROOTS replaces it with directories of your own, which must already exist. A relative path resolves inside the first of them, and an absolute path must fall inside one — a path escaping the boundary is refused rather than followed.
Attachment roots are pinned by identity when the server starts. Replacing a root afterwards—renaming it and leaving a symlink in its place, for example—does not move the boundary. If every root becomes unreachable, both tools refuse all paths rather than falling back to unrestricted access.
Upgrading from a release before the managed directory: with BARYON_ATTACHMENT_ROOTS unset, content_path and output_path used to accept any absolute path the server's account could reach. They are now confined to the managed directory. To keep using other locations, set BARYON_ATTACHMENT_ROOTS explicitly; the Docker example above already does, so container users are unaffected.
Development
Building from source requires Go 1.27.2 or later.
make snapshot also requires GoReleaser, jq, and npx.
The release workflow fills the server.json template with checksums from the released MCPB bundles before publishing it to the MCP Registry.
License
來源:README.md,提交 41db358
工具
0版本歷史
4- v0.7.0最新Oct 15, 2026
- v0.6.3Sep 27, 2026
- v0.6.2Sep 20, 2026
- v0.5.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分