Skip to main content
Glama
proton-mail-mcp

proton-mail-mcp

by jasen1300
README.md
# proton-mail-mcp

A local [MCP](https://modelcontextprotocol.io) server that connects an MCP client (Claude Code, Claude Desktop or any other MCP client) to **Proton Mail** through **Proton Mail Bridge**. It also ships an optional **deterministic sorter** that labels your inbox on a schedule.

It is a single Python file per component (`server.py`, `sorter.py`). The defaults are meant for letting a language model work inside a real mailbox: sending is off until you enable it, protected senders are matched by address, only deterministic signals move mail to spam, bulk actions have a blast-radius cap, and every automatic move is written to an audit log.

> **Warning.** An automation with mailbox access can hide, move or delete mail. A wrong filter, a wrong rule or a wrong model verdict can push an important message into Spam, Archive or Trash, and if you empty those folders regularly, it is gone. Start with dry runs, keep the write tools on "ask every time", and read the audit log (`~/.config/proton-mail-mcp/audit.jsonl`) now and then.

## The problem

Proton Mail is end-to-end encrypted and has no open REST API for mailbox access. The supported way to reach your mail from local programs is **Proton Mail Bridge**, a desktop app that decrypts your mail on your machine and serves it over IMAP and SMTP on `127.0.0.1`. Bridge needs a **paid Proton plan** (for example Mail Plus, Proton Unlimited or a business plan).

This project turns that local IMAP/SMTP endpoint into MCP tools. A model can then search, read, draft, label and clean up mail for you, with guard rails around everything that changes the mailbox.

## How it works

```
MCP client (Claude Code / Desktop) --stdio--> server.py --IMAP/SMTP--> Proton Mail Bridge --> Proton
cron / launchd --------------------------------> sorter.py --IMAP----^
```

- **`server.py`** is a FastMCP stdio server with 31 tools. Every tool call opens its own IMAP connection to Bridge (STARTTLS on `127.0.0.1`), does its work and logs out. The configuration comes from environment variables or a `.env` file next to `server.py`.
- **`sorter.py`** is a command-line job. It gives every inbox message one category label (plus optional "Important" / "Suspicious" labels), using rules from a JSON config and what it learns from the labels already in your mailbox. An optional spam filter rescues real mail from Spam and, if you also enable it, moves clear promo out of the inbox. An optional drafts hygiene (`drafts_hygiene.py`) moves drafts that were provably sent, and empty ones, to Trash. It writes labels as IMAP `COPY` into `Labels/<name>` and reads with `BODY.PEEK`, so read flags stay untouched.
- Everything runs locally. Network traffic leaves your machine only for: the optional AI tools (Anthropic API), an RFC 8058 one-click unsubscribe (one HTTPS POST, only when you call `unsubscribe_sender` or enable it in the sorter), and mail you send yourself through Bridge.

## Requirements

- macOS. The code uses POSIX file locking, so Windows will not work. Linux may work but is untested. The extension manifest and the launchd examples are macOS-only.
- Python 3.10 to 3.13 (imapclient 3.1.0 breaks on 3.14). [uv](https://docs.astral.sh/uv/) is recommended; it picks Python 3.12 from `.python-version`.
- Proton Mail Bridge, installed, logged in and running, on a paid Proton plan.
- Optional: an Anthropic API key, only for the three AI tools.

## Install

```bash
git clone https://github.com/jasen1300/proton-mail-mcp.git
cd proton-mail-mcp
uv sync
```

Without uv:

```bash
python3 -m venv .venv          # with Python 3.10-3.13
source .venv/bin/activate
pip install -r requirements.txt
```

### Set up Bridge (and avoid the password trap)

1. Install Proton Mail Bridge from Proton's website, log in and wait for the first sync.
2. In Bridge, open your account's mailbox details (IMAP/SMTP settings). You will see:
   - **Username:** your Proton address.
   - **Password:** a **Bridge-specific password** that Bridge generated. **This is not your Proton login password.** Using your login password is the most common setup error; the server then reports "IMAP login to Proton Bridge failed".
   - **IMAP** `127.0.0.1:1143` and **SMTP** `127.0.0.1:1025`, both with STARTTLS (the defaults this server uses).
3. Bridge has to be running whenever you use the server. Enable "start on login" in Bridge if you want that.

Put the credentials in `.env` (git-ignored) or pass them through your MCP client's `env` block:

```bash
cp .env.example .env
# edit .env: PROTON_BRIDGE_USERNAME and PROTON_BRIDGE_PASSWORD
```

### Keep the password in the Keychain (macOS, optional)

Instead of writing the Bridge password into `.env`, you can store it in your login Keychain. The server looks for a generic password with the service `proton-mail-mcp` and your Proton address as the account. If it finds one, it uses that and ignores `PROTON_BRIDGE_PASSWORD`. `security` asks for the value, so it does not end up in your shell history:

```bash
security add-generic-password -s proton-mail-mcp -a you@proton.example \
  -l "Proton Mail Bridge (proton-mail-mcp)" -T /usr/bin/security -U -w
```

`-T /usr/bin/security` lets the server read the entry without a prompt, which scheduled jobs (launchd) need. It also means any program running as your user can read the entry through `/usr/bin/security`. That is still better than a plain-text file, but it is not a vault. `check_connection` and the sorter's status file show which source was used (`Keychain`, `environment` or `missing`). Set `PROTON_BRIDGE_KEYCHAIN_SERVICE` to use another service name, or to an empty value to switch the lookup off.

The Anthropic API key for the optional AI tools can live in the Keychain too. Store it as a generic password in the same way, under a service name of your choice, and put that name in `PROTON_AI_KEYCHAIN_SERVICE` (plus `PROTON_AI_KEYCHAIN_ACCOUNT` if several entries share the service). There is no default service for the key: without `PROTON_AI_KEYCHAIN_SERVICE` the Keychain is never asked for it. The lookup only happens when an AI tool needs the key and `ANTHROPIC_API_KEY` is empty, so a key in the environment or `.env` wins.

## Usage

### Claude Code

```bash
claude mcp add proton-mail -- uv --directory /path/to/proton-mail-mcp run server.py
```

With the credentials in `.env`, nothing else is needed. You can also pass them with `--env PROTON_BRIDGE_USERNAME=... --env PROTON_BRIDGE_PASSWORD=...`.

### Claude Desktop (or another client using an `mcpServers` JSON block)

Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "proton-mail": {
      "command": "uv",
      "args": ["--directory", "/path/to/proton-mail-mcp", "run", "server.py"],
      "env": {
        "PROTON_BRIDGE_USERNAME": "you@proton.example",
        "PROTON_BRIDGE_PASSWORD": "<bridge password from the Bridge app>"
      }
    }
  }
}
```

Restart Claude Desktop completely. If `uv` is not on the app's `PATH`, use the full path from `which uv`. Then ask the model to run `check_connection` first.

Started without an argument, `server.py` speaks MCP on stdio and waits for a client, so it looks idle in a terminal. That is expected.

### Desktop extension (`.mcpb`)

`extension/manifest.json` describes a Claude Desktop extension that runs the server with uv. The bundle needs copies of the project files, which are git-ignored inside `extension/`:

```bash
cp server.py pyproject.toml uv.lock .python-version extension/
npx @anthropic-ai/mcpb pack extension proton-mail.mcpb
```

The extension asks for the Bridge address and password, an optional API key, and whether sending is allowed (off by default). Packing and installing the extension was **not tested** for this release.

## Tools

| Group | Tools | Changes the mailbox? |
|---|---|---|
| Diagnostics | `check_connection`, `list_mailboxes`, `mailbox_stats` | no |
| Read and search | `search_emails`, `get_email`, `get_thread`, `download_attachment` | no (`get_email(mark_as_read=True)` sets the read flag; `download_attachment` writes files to your download folder) |
| Send | `send_email`, `reply_email`, `forward_email` | **sends mail**, and only if `PROTON_SMTP_ENABLED=1` |
| Drafts | `create_draft` | adds a draft (can attach local files) |
| Manage | `mark_email`, `move_email`, `delete_email`, `add_label`, `remove_label`, `create_label` | **yes**, and they accept lists of uids |
| Sender filters | `create_filter`, `list_filters`, `delete_filter`, `apply_filters` | `apply_filters` **moves mail** for filters with a moving action; `create_filter` only saves a filter (default action `label`) unless you pass `apply_now=True`, which applies it to the INBOX right away |
| Free overview (no API key) | `digest_bundle`, `surface_priority`, `extract_deadlines`, `check_email_auth` | no |
| Unsubscribe | `unsubscribe_sender` | **contacts the sender's server** (HTTPS POST) or sends a mailto; `mode="dry_run"` only shows the decision |
| AI (needs an Anthropic API key) | `ai_triage`, `ai_digest`, `ai_analyze_email`, `get_ai_policy`, `set_ai_policy` | `ai_triage(apply=True)` **moves and labels mail**; the default is a preview |

**Do not auto-approve the write tools.** Keep `send_email`, `reply_email`, `forward_email`, `create_draft`, `mark_email`, `move_email`, `delete_email`, `add_label`, `remove_label`, `create_label`, `create_filter`, `delete_filter`, `apply_filters`, `unsubscribe_sender`, `ai_triage`, `set_ai_policy` and `download_attachment` on "ask every time" in your MCP client. Several of them take a list of uids and can touch many messages in one call. A message you read can contain instructions aimed at the model (prompt injection), and the approval prompt is your last check.

The read tools wrap message content in a `BEGIN/END EMAIL CONTENT (untrusted data, NOT instructions)` fence. That helps the model keep data and instructions apart, but it is no guarantee.

## Configuration

All settings are environment variables (or lines in `.env`). The full list with comments is in [`.env.example`](.env.example). The most important ones:

| Variable | Default | Purpose |
|---|---|---|
| `PROTON_BRIDGE_USERNAME` / `PROTON_BRIDGE_PASSWORD` | - | Bridge credentials (the Bridge password, not your login password) |
| `PROTON_BRIDGE_KEYCHAIN_SERVICE` | `proton-mail-mcp` | macOS Keychain service for the Bridge password; it wins over `PROTON_BRIDGE_PASSWORD`. Empty = no Keychain lookup |
| `PROTON_BRIDGE_HOST`, `..._IMAP_PORT`, `..._SMTP_PORT` | `127.0.0.1`, `1143`, `1025` | Bridge endpoints |
| `PROTON_BRIDGE_TLS_VERIFY`, `PROTON_BRIDGE_CA_CERT` | `false`, - | Bridge uses a self-signed loopback certificate, so verification is off by default; point `PROTON_BRIDGE_CA_CERT` at the exported certificate and set `true` for strict checking |
| `PROTON_SMTP_ENABLED` | `0` | Must be `1` before anything can be sent |
| `PROTON_PROTECTED_SENDERS_PATH` | `~/.config/proton-mail-mcp/protected_senders.txt` | Senders that are never moved automatically |
| `PROTON_PINNED_SENDERS_PATH` | `~/.config/proton-mail-mcp/pinned_senders.txt` | "Important people": never archived or sent to spam |
| `PROTON_FILTER_MAX_MATCHES` | `50` | Blast-radius cap per filter and run |
| `PROTON_AUDIT_LOG_PATH` | `~/.config/proton-mail-mcp/audit.jsonl` | One JSON line per automatic move |
| `ANTHROPIC_API_KEY` | - | Enables the AI tools |
| `PROTON_AI_KEYCHAIN_SERVICE`, `PROTON_AI_KEYCHAIN_ACCOUNT` | -, - | macOS: read the API key from this Keychain entry when `ANTHROPIC_API_KEY` is empty |
| `PROTON_AI_MODEL` | `claude-haiku-5-5` | Model for the AI tools |
| `PROTON_AI_CONFIDENCE_MIN` | `70` | Below this, an AI archive/spam verdict only adds a label |
| `PROTON_DOWNLOAD_DIR`, `PROTON_ATTACH_DIR` | `~/Downloads/proton-mail-mcp`, - | Where attachments are saved / the only folder attachments may be sent from |

### Protected and pinned senders

`protected_senders.txt` is created on first use with a few generic entries (`.gov`, `court`, `tax`, `bank`, `insurance`). Replace them with the senders whose mail must never disappear: banks, landlords, courts, tax offices, your employer, the people you care about. Entries are matched against the **sender address only**, never against the display name, because anyone can put "Tax Office" in a display name:

```
billing@utility.example     exactly this address
@bank.example               this domain and its subdomains
bank.example                the same
.gov                        every domain that ends in .gov
court                       any address that contains the word (also matches look-alikes, so prefer domains)
```

Filters, the sorter and the AI layer never move a protected sender. `surface_priority` uses the same list to pull such mail to the top. `pinned_senders.txt` uses the same format.

## The sorter

`sorter.py` labels every inbox message with exactly one category from your config, plus an optional second category (for example "Finance" for an invoice from a shop) and an "Important" label for recent mail that matches your important rules or comes from a person. The stages, first match wins:

1. **Priority rules** (for example courts or authorities), always important
2. **Sender overrides** (`"shop.example": "Orders"`)
3. **Security** subjects (codes, logins, password resets)
4. **Promo** and **news** subjects
5. **Learned** from the labels already in your mailbox. Labels you set count three times, sorter labels once, and a sorter label you removed counts minus three. So correcting a label by hand teaches the sorter.
6. **Sender rules**, then **subject rules**
7. Newsletter headers become promo, a person becomes people, everything else becomes the fallback category

Each message is sorted once. A sorter label you remove stays removed. Every run picks up every inbox message that has no category yet.

```bash
mkdir -p ~/.config/proton-mail-mcp
cp examples/sorter_config.example.json ~/.config/proton-mail-mcp/sorter_config.json
# edit it: categories, roles, rules - the example senders are made up
uv run python sorter.py check-config
uv run python sorter.py run            # dry run: prints every decision, changes nothing
uv run python sorter.py explain 1234   # why inbox uid 1234 gets which labels
uv run python sorter.py run --apply    # writes the labels
```

To run it every ten minutes, adapt and install [`examples/launchd/com.example.proton-mail-mcp.sorter.plist`](examples/launchd/com.example.proton-mail-mcp.sorter.plist). There is also an example job for `server.py apply-filters`.

Messages that look forged (DMARC fail and high risk) get a "Suspicious" label instead of "Important".

**Status and outages.** Every run writes `sorter_status.json` (mode 0600) next to its database: time of the last good run, failed runs in a row, the last error and where the Bridge password came from. If Bridge stays unreachable for about ten minutes, the log says `ALARM`, and on macOS a notification appears, at most once a day. If Bridge reports that it no longer knows the account, the notification says to sign in again in the Bridge app. During an alarm the sorter tries to log in only every 30 minutes, so it does not run into Bridge's login throttle. Delete the status file to retry right away. `PROTON_SORTER_NO_NOTIFY=1` switches the notifications off.

**Spam filter (off by default).** With `"spam": {"enabled": true}` the sorter also:
- rescues real mail from Spam, but only with passing SPF/DMARC and either a protected sender address, a sender you allowed, a receipt/order/code subject from a domain you already have labelled mail from, or a reply from a person. At most 10 messages per run (`max_rescues_per_run`), oldest first; the rest follows in the next runs and is never unsubscribed. If more are due, it logs a warning and shows a notification, so do not empty Spam in the meantime;
- learns from your votes: dragging a message the sorter labelled to Spam blocks its sender, moving a message the sorter moved back allows the sender.

**Promo to Spam (off by default).** With `"move_promo": true` in the `spam` section, the sorter also moves promo out of the inbox to Spam: messages with newsletter headers, and messages without them only when the subject is clearly promo and the sender has sent nothing but promo so far (never a person or a reply). It never moves a protected, pinned or allowed sender, a sender that also sends you invoices or orders, mail labelled important, auto-replies, or shipping, appointment and account subjects. At most 40 moves per run (`max_moves_per_run`, 200 with the one-off `--promo-days N`); above that it moves nothing and logs a warning. It is off by default because a wrong move is lost if you empty Spam regularly; without it, promo just keeps its label in the inbox.

**Drafts hygiene (off by default).** With `"drafts": {"enabled": true}`, a `run --apply` cleans up the Drafts folder once a day ([`drafts_hygiene.py`](drafts_hygiene.py)). It is deterministic and never asks a model:
- a draft older than 24 hours goes to Trash when at least 80% of its own text (without quote, signature, greetings and your name, and at least 12 words) appears in a message in Sent that went out after the draft to at least one of the same recipients. If the draft has real attachments, the sent message needs some too;
- a draft older than 7 days with no subject, no attachment and nothing but greetings or an app signature goes to Trash;
- unsent drafts older than 30 days are only listed under `drafts.old` in the status file;
- at most 10 drafts per run (`max_per_run`), oldest first, only to Trash, after a UIDVALIDITY check, with one audit line each (action `drafts`). To undo, move the message from Trash back to Drafts.

`uv run python sorter.py drafts` shows what it would do; `drafts --apply` does it once by hand. Quote headers and greetings are recognised in English only. If you write in another language, add your mail client's quote header line and your usual greetings as regexes (`quote_header`, `closing_phrases`) before you enable it. Otherwise a quote in another language counts as your own text, and a draft could be matched through the quoted part of a later message. A revised draft that differs by more than about 20% from what you sent stays, and so does a forward or reply without own text. Those show up on the "old" list after 30 days.

**Unsubscribe (off by default).** With `"unsubscribe": {"enabled": true}` (requires the spam filter) newsletters in Spam are unsubscribed via RFC 8058 one-click: one HTTPS POST to a public address, no cookies, no redirects, never by mail, exactly one attempt per sender. What the sorter moved to Spam itself waits for a grace period first (7 days by default). This contacts third-party servers on its own, so turn it on only if you want that.

## Safety model

- **Bridge password, not your Proton password.** `.env` is git-ignored, and on macOS the Bridge password and the API key can live in the Keychain instead. The server talks to Bridge on `127.0.0.1` (configurable) and opens no ports.
- **Sending is locked** until `PROTON_SMTP_ENABLED=1`. Drafts always work. The extension exposes this as an "Allow sending" switch, off by default.
- **Only deterministic signals move mail to Spam.** An AI "spam" verdict moves a message only when SPF or DMARC failed (or the auth risk score is high). Otherwise the message stays in the inbox with an `AI-Suspicious` label. A DMARC-fail backstop only labels.
- **AI moves need an explicit call.** The model can archive or move messages only when you call `ai_triage(apply=True)`, and never for protected or pinned senders or verdicts below the confidence threshold. There is no scheduled AI job. The scheduled jobs (`sorter.py run --apply`, `server.py apply-filters`) are deterministic.
- **Blast-radius caps.** A filter that matches more than 50 messages or more than 20% of the folder is skipped. The sorter's promo step does nothing if it would move more than 40 messages, it rescues at most 10 messages from Spam per run, and the drafts hygiene moves at most 10 drafts to Trash per run. Filter tokens need at least 3 characters, and domain tokens only match at a `.`/`@` boundary.
- **Audit log.** Every automatic move or label (filters, sorter, drafts hygiene, AI) appends one JSON line with sender, subject, Message-ID, source and target. The file is created readable by you only (0600). To undo, `move_email` the message back. The file grows by one line per moved message; rotate it if needed.
- **Dry-run defaults.** `ai_triage` previews unless `apply=True`; `sorter.py run` and `sorter.py drafts` are dry runs unless `--apply` is given; `create_filter` defaults to the non-destructive `label` action and applies nothing until `apply_filters` runs or you pass `apply_now=True`; `apply_filters` and `unsubscribe_sender` have dry-run modes.
- **Resync protection.** If Bridge resyncs between reading and acting (UIDVALIDITY changes), triage and sorter refuse to act. A model verdict is only applied when every verdict maps to exactly one message.
- **Attachments.** Sending attachments reads local files, so `.env` files, SSH and cloud keys, `*.pem`/`*.key`, token files, keychains and browser cookie stores are always refused (symlinks resolved). `PROTON_ATTACH_DIR` can confine attachments to one folder. Downloads are confined to `PROTON_DOWNLOAD_ALLOW_DIR`, never overwrite and never follow symlinks.
- **IMAP injection.** CR/LF/NUL in search terms and folder names are rejected.
- **Message-IDs** of sent mail and drafts use your address's domain, not your computer's host name.

## Limitations

What was tested for this release, all offline:
- `tests/test_sorter.py` with **103 checks**: sorter decisions, the learning rules, the spam rescue/move rules, config validation, the rescue batches, the status file and outage alarm, and full `sorter.run()` passes against an in-memory fake IMAP server (promo stays without `move_promo` and moves with it, at most 10 rescues per run, dry runs change nothing, the drafts hygiene runs once a day, no login during the backoff). All on synthetic messages and the example config.
- `tests/test_drafts.py` with **37 checks** of the drafts hygiene: quote and signature handling, the sent/empty/old decisions, the batch limit, extra phrases from the config, and full passes against a fake IMAP server, including the audit lines.
- `tests/test_guards.py` with **84 checks** of the server's safety logic: address-only sender matching, the AI move guards, filter blast radius and boundaries, the unsubscribe decision tree, the sending lock, the API-key check, auth-header parsing, the deadline heuristic, the attachment and download guards, the Keychain lookups for the Bridge password and the API key (against stand-ins for `/usr/bin/security` and the `anthropic` package), the login error hints, the `create_filter` defaults and the audit file mode.
- Loading `server.py` and listing its 31 MCP tools.

The tests stub every network entry point and `subprocess.run`, set `HOME` to a temp folder and fail if anything reaches out. Run them with `uv run python tests/test_sorter.py`, `uv run python tests/test_drafts.py` and `uv run python tests/test_guards.py`.

Not tested for this release:
- Anything against a live Proton Mail Bridge, IMAP or SMTP server: no tool call, no sorter run, no drafts cleanup on a real mailbox. The fake IMAP server only covers the commands the sorter uses.
- The Keychain lookups against a real Keychain, and the macOS notifications (they were never shown).
- The AI tools against the Anthropic API, including the default model `claude-haiku-5-5` and the structured-output request format.
- The real HTTPS one-click unsubscribe request, the `.mcpb` extension, the launchd examples, Linux.

This code comes from a privately used version that ran against a real Bridge. For this release, names, defaults and parts of the safety behaviour were changed, so treat it as new code.

Known limits:
- `check_email_auth` and the spam rules read the `Authentication-Results` headers that the receiving side added; they do not verify DKIM signatures themselves. The risk score is a heuristic.
- Labels are emulated the way Bridge exposes them: adding a label copies the message into `Labels/<name>`, and removing it expunges that copy. Proton labels cannot be nested, so AI labels are flat (`Labels/AI-<name>`).
- Sender filters live in this server, not in Proton. They only run when you call `apply_filters` or schedule it. To stop mail before it reaches the inbox, use a Sieve filter in the Proton web app.
- Bridge does not search non-ASCII terms server-side. The server matches them client-side, but only over the newest 500 candidates.
- `extract_deadlines` is a recall-biased regex scan tuned for English text and numeric dates. It is not a calendar.
- The drafts hygiene knows English quote headers and greetings only (see above), and it compares text, not meaning.
- The example sorter rules are a starting point and are not tuned to any real mailbox.
- One account per server instance, a fresh IMAP connection per call, so it is slow on large mailboxes.

## Related projects

Other MCP servers for Proton Mail Bridge exist. The notes below come from their READMEs and were not tested:

- [googlarz/proton-mail-bridge-client](https://github.com/googlarz/proton-mail-bridge-client): the most complete one at the time of writing. It offers deterministic categorization, SPF/DKIM/DMARC details per message, previewed filter and cleanup proposals, prompt-injection risk notes and confirmation modes, with a much larger surface.
- [chandshy/mailpouch](https://github.com/chandshy/mailpouch): a large permission-gated, local-only toolset (69 tools).
- [miketigerblue/proton-bridge-mcp](https://github.com/miketigerblue/proton-bridge-mcp): pins Bridge's self-signed certificate on first use. This project instead disables verification on loopback by default, unless you provide the certificate.
- [DreamC0der-AI/proton-mail-mcp](https://github.com/DreamC0der-AI/proton-mail-mcp): syncs mail into a local SQLite database with full-text search. No license was listed at the time of writing.
- [codefuturist/email-mcp](https://github.com/codefuturist/email-mcp): a generic IMAP/SMTP MCP server (LGPL-3.0) with scheduled sending and analytics.

What this one adds: a small server you can read in one sitting per file, conservative defaults (sending off, address-only protection, deterministic spam moves, blast-radius caps, audit log, dry runs) and a rule-based sorter that learns from your own labels without any AI, with an optional deterministic drafts cleanup.

---

Built with [Claude Code](https://claude.com/claude-code). Provided as-is under the [MIT License](LICENSE), with no support commitment. Issues and pull requests are welcome.

TDQS

A3.5/5.0

Scored across 31 tools

Disambiguation4/5

Most tools have sharply distinct purposes and the descriptions actively cross-reference each other (e.g. move_email vs add_label, ai_digest vs digest_bundle), which strongly reduces misselection. The weak spot is the analytics cluster — ai_triage, ai_digest, ai_analyze_email, digest_bundle and check_email_auth all read the mailbox and produce triage-style output, so an agent must read carefully to pick the right one.

Naming Consistency4/5

The dominant pattern is clear verb_noun: get_email, send_email, mark_email, move_email, delete_email, add_label, create_filter, list_mailboxes, search_emails. Deviations are minor but noticeable — noun-only or verb-less names like mailbox_stats, digest_bundle, surface_priority, extract_deadlines, and an 'ai_' prefix family (ai_triage, ai_digest, ai_analyze_email) that breaks the verb-first convention.

Tool Count3/5

At 31 tools this is on the heavy side for a mail server, and the surface is broad enough that each tool maps to a real operation, but several AI helpers could be consolidated into one parameterized tool. The count pushes past the point where an agent can hold the whole set in working memory, especially the five-tool analysis cluster.

Completeness4/5

Coverage is strong: full message CRUD, attachments, labels, filters, threading (get_thread/reply/forward), auth checks, stats, and both AI and free triage paths. The main gap is the draft lifecycle — create_draft exists but there is no list_drafts, update_draft, or send_draft, and there is no folder/mailbox creation since that is delegated to Proton.