proton-mail-bridge-client 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +445 -0
  3. package/dist/cli.d.ts +12 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +1627 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/index.d.ts +56 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +3173 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/scripts/bridge-smoke.d.ts +2 -0
  12. package/dist/scripts/bridge-smoke.d.ts.map +1 -0
  13. package/dist/scripts/bridge-smoke.js +415 -0
  14. package/dist/scripts/bridge-smoke.js.map +1 -0
  15. package/dist/scripts/check-claude-desktop.d.ts +17 -0
  16. package/dist/scripts/check-claude-desktop.d.ts.map +1 -0
  17. package/dist/scripts/check-claude-desktop.js +138 -0
  18. package/dist/scripts/check-claude-desktop.js.map +1 -0
  19. package/dist/scripts/install-claude-desktop.d.ts +39 -0
  20. package/dist/scripts/install-claude-desktop.d.ts.map +1 -0
  21. package/dist/scripts/install-claude-desktop.js +257 -0
  22. package/dist/scripts/install-claude-desktop.js.map +1 -0
  23. package/dist/scripts/setup-claude-desktop.d.ts +15 -0
  24. package/dist/scripts/setup-claude-desktop.d.ts.map +1 -0
  25. package/dist/scripts/setup-claude-desktop.js +187 -0
  26. package/dist/scripts/setup-claude-desktop.js.map +1 -0
  27. package/dist/services/analytics-service.d.ts +45 -0
  28. package/dist/services/analytics-service.d.ts.map +1 -0
  29. package/dist/services/analytics-service.js +189 -0
  30. package/dist/services/analytics-service.js.map +1 -0
  31. package/dist/services/audit-service.d.ts +13 -0
  32. package/dist/services/audit-service.d.ts.map +1 -0
  33. package/dist/services/audit-service.js +67 -0
  34. package/dist/services/audit-service.js.map +1 -0
  35. package/dist/services/background-sync-service.d.ts +28 -0
  36. package/dist/services/background-sync-service.d.ts.map +1 -0
  37. package/dist/services/background-sync-service.js +216 -0
  38. package/dist/services/background-sync-service.js.map +1 -0
  39. package/dist/services/draft-store-service.d.ts +59 -0
  40. package/dist/services/draft-store-service.d.ts.map +1 -0
  41. package/dist/services/draft-store-service.js +251 -0
  42. package/dist/services/draft-store-service.js.map +1 -0
  43. package/dist/services/local-index-service.d.ts +90 -0
  44. package/dist/services/local-index-service.d.ts.map +1 -0
  45. package/dist/services/local-index-service.js +1462 -0
  46. package/dist/services/local-index-service.js.map +1 -0
  47. package/dist/services/simple-imap-service.d.ts +209 -0
  48. package/dist/services/simple-imap-service.d.ts.map +1 -0
  49. package/dist/services/simple-imap-service.js +1100 -0
  50. package/dist/services/simple-imap-service.js.map +1 -0
  51. package/dist/services/smtp-service.d.ts +15 -0
  52. package/dist/services/smtp-service.d.ts.map +1 -0
  53. package/dist/services/smtp-service.js +100 -0
  54. package/dist/services/smtp-service.js.map +1 -0
  55. package/dist/types/index.d.ts +355 -0
  56. package/dist/types/index.d.ts.map +1 -0
  57. package/dist/types/index.js +2 -0
  58. package/dist/types/index.js.map +1 -0
  59. package/dist/utils/helpers.d.ts +45 -0
  60. package/dist/utils/helpers.d.ts.map +1 -0
  61. package/dist/utils/helpers.js +393 -0
  62. package/dist/utils/helpers.js.map +1 -0
  63. package/dist/utils/logger.d.ts +22 -0
  64. package/dist/utils/logger.d.ts.map +1 -0
  65. package/dist/utils/logger.js +91 -0
  66. package/dist/utils/logger.js.map +1 -0
  67. package/dist/utils/runtime-policy.d.ts +12 -0
  68. package/dist/utils/runtime-policy.d.ts.map +1 -0
  69. package/dist/utils/runtime-policy.js +62 -0
  70. package/dist/utils/runtime-policy.js.map +1 -0
  71. package/glama.json +6 -0
  72. package/package.json +91 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 googlarz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,445 @@
1
+ ```
2
+ ____ ____ ___ _____ ___ _ _ __ __ _ ___ _
3
+ | _ \| _ \ / _ \_ _/ _ \| \ | | | \/ | / \ |_ _| |
4
+ | |_) | |_) | | | || || | | | \| | | |\/| | / _ \ | || |
5
+ | __/| _ <| |_| || || |_| | |\ | | | | |/ ___ \ | || |___
6
+ |_| |_| \_\\___/ |_| \___/|_| \_| |_| |_/_/ \_\___|_____|
7
+ Bridge Client · CLI + Claude Desktop MCP for Proton Mail
8
+ ```
9
+
10
+ # Proton Mail Bridge Client
11
+
12
+ [![proton-mail-bridge-client MCP server](https://glama.ai/mcp/servers/googlarz/proton-mail-bridge-client/badges/card.svg)](https://glama.ai/mcp/servers/googlarz/proton-mail-bridge-client)
13
+
14
+ A full-featured CLI and Claude Desktop MCP for Proton Mail, built on top of Proton Bridge.
15
+
16
+ ## About
17
+
18
+ Proton Mail Bridge Client gives you two ways to use Proton Mail programmatically:
19
+
20
+ **CLI** — a terminal client with complete parity to the MCP surface. Read, search, send, draft, archive, manage folders, triage threads, and run diagnostics — all from the command line. Body can be piped via stdin. Output is either human-readable or `--json`.
21
+
22
+ **MCP server** — the same capabilities exposed as a Model Context Protocol server so Claude Desktop can read and manage your Proton Mail in any chat, on the same machine where Proton Bridge is running.
23
+
24
+ Both surfaces share the same backend: Proton Bridge IMAP and SMTP, a local SQLite index, and an audit log. No hosted relay, no remote URL, no cloud dependency beyond your own Proton account.
25
+
26
+ ## Why CLI?
27
+
28
+ Most Proton Mail MCPs are MCP-only. This one ships a full CLI — the same 40+ commands, all in the terminal, no Claude required.
29
+
30
+ **Pipe and script:**
31
+
32
+ ```bash
33
+ # Morning digest to a file
34
+ proton-mail-bridge-client digest --json > ~/morning-mail.json
35
+
36
+ # Finance automation — pull every Stripe subject in seconds
37
+ proton-mail-bridge-client search --from stripe.com --json | jq '.[].subject'
38
+
39
+ # Pipe a script's output directly into an email
40
+ echo "Deploy complete on $(hostname) at $(date)" \
41
+ | proton-mail-bridge-client send --to alerts@example.com --subject "Deploy done"
42
+ ```
43
+
44
+ **Cron:**
45
+
46
+ ```bash
47
+ # Scheduled digest every weekday at 8am
48
+ 0 8 * * 1-5 proton-mail-bridge-client digest >> ~/mail-log.txt
49
+ ```
50
+
51
+ **One-liners:**
52
+
53
+ ```bash
54
+ # Live watch: notify on any new mail from your bank
55
+ proton-mail-bridge-client search --live --from bank.com
56
+
57
+ # Count unread in INBOX
58
+ proton-mail-bridge-client emails --folder INBOX --json | jq '[.[] | select(.isRead == false)] | length'
59
+ ```
60
+
61
+ No other Proton Mail MCP has a CLI. If you want to automate mail outside of Claude, this is the only option.
62
+
63
+ ## Prerequisites
64
+
65
+ - Node.js 18+
66
+ - [Proton Bridge](https://proton.me/mail/bridge) installed and signed in
67
+ - From Bridge: IMAP host/port, SMTP host/port, username, Bridge password
68
+
69
+ Default local Bridge addresses: IMAP `127.0.0.1:1143`, SMTP `127.0.0.1:1025`
70
+
71
+ ## Install
72
+
73
+ > **Before running `npm run build`:** configure your credentials first — see [Environment](#environment) below. The build step connects to Proton Bridge to verify connectivity and will fail without credentials set.
74
+
75
+ ```bash
76
+ git clone https://github.com/googlarz/proton-mail-bridge-client.git
77
+ cd proton-mail-bridge-client
78
+ npm install
79
+ npm run build
80
+ ```
81
+
82
+ After install, the `proton-mail-bridge-client` (and `proton-mail-bridge`) binary is available from the repo.
83
+
84
+ For a system-wide install: `npm install -g .`
85
+
86
+ ## CLI
87
+
88
+ ```bash
89
+ proton-mail-bridge-client <command> [options]
90
+ ```
91
+
92
+ All commands support `--json` for machine-readable output.
93
+
94
+ ### Read
95
+
96
+ ```bash
97
+ proton-mail-bridge-client emails --folder INBOX --limit 25
98
+ proton-mail-bridge-client read INBOX::25642
99
+ proton-mail-bridge-client search "invoice" --limit 10
100
+ proton-mail-bridge-client search --live --from openai.com
101
+ proton-mail-bridge-client attachments INBOX::25642
102
+ ```
103
+
104
+ ### Triage
105
+
106
+ ```bash
107
+ proton-mail-bridge-client digest
108
+ proton-mail-bridge-client threads "quarterly review"
109
+ proton-mail-bridge-client actionable
110
+ proton-mail-bridge-client followups
111
+ proton-mail-bridge-client thread-brief <threadId>
112
+ proton-mail-bridge-client document-threads --category invoice
113
+ proton-mail-bridge-client meeting-context alice@example.com
114
+ ```
115
+
116
+ ### Compose & send
117
+
118
+ ```bash
119
+ proton-mail-bridge-client send --to bob@example.com --subject "Hey" --body "Hello"
120
+ echo "Hello" | proton-mail-bridge-client send --to bob@example.com --subject "Hey"
121
+ proton-mail-bridge-client reply INBOX::25642 --body "On it."
122
+ proton-mail-bridge-client reply INBOX::25642 --reply-all --body "On it."
123
+ proton-mail-bridge-client forward INBOX::25642 --to carol@example.com
124
+ ```
125
+
126
+ ### Mailbox actions
127
+
128
+ ```bash
129
+ proton-mail-bridge-client move INBOX::25642 Folders/Archive
130
+ proton-mail-bridge-client archive INBOX::25642
131
+ proton-mail-bridge-client trash INBOX::25642
132
+ proton-mail-bridge-client restore Trash::25642
133
+ proton-mail-bridge-client mark-read INBOX::25642
134
+ proton-mail-bridge-client mark-read INBOX::25642 --unread
135
+ proton-mail-bridge-client star INBOX::25642
136
+ proton-mail-bridge-client delete INBOX::25642
137
+ proton-mail-bridge-client batch archive INBOX::100,INBOX::101,INBOX::102
138
+ proton-mail-bridge-client thread-action <threadId> archive
139
+ ```
140
+
141
+ ### Folders
142
+
143
+ ```bash
144
+ proton-mail-bridge-client folders
145
+ proton-mail-bridge-client create-folder Folders/Receipts
146
+ proton-mail-bridge-client rename-folder Folders/Receipts Folders/Bills
147
+ proton-mail-bridge-client delete-folder Folders/Bills
148
+ ```
149
+
150
+ ### Drafts
151
+
152
+ ```bash
153
+ proton-mail-bridge-client drafts
154
+ proton-mail-bridge-client draft-create --to bob@example.com --subject "Draft" --body "..."
155
+ proton-mail-bridge-client draft-read <id>
156
+ proton-mail-bridge-client draft-update <id> --subject "Updated subject"
157
+ proton-mail-bridge-client draft-reply INBOX::25642 --body "Will do."
158
+ proton-mail-bridge-client draft-forward INBOX::25642 --to carol@example.com
159
+ proton-mail-bridge-client draft-sync <id>
160
+ proton-mail-bridge-client draft-send <id>
161
+ proton-mail-bridge-client draft-delete <id>
162
+ proton-mail-bridge-client remote-drafts
163
+ ```
164
+
165
+ ### Analytics & diagnostics
166
+
167
+ ```bash
168
+ proton-mail-bridge-client stats
169
+ proton-mail-bridge-client analytics
170
+ proton-mail-bridge-client contacts
171
+ proton-mail-bridge-client volume-trends --days 14
172
+ proton-mail-bridge-client watch --timeout 30
173
+ proton-mail-bridge-client test-email you@example.com
174
+ proton-mail-bridge-client doctor
175
+ proton-mail-bridge-client status
176
+ proton-mail-bridge-client sync --folder INBOX --limit 150
177
+ ```
178
+
179
+ ### Ambient notifications
180
+
181
+ Run as a background daemon — sends a system notification (macOS / Linux) whenever new mail arrives:
182
+
183
+ ```bash
184
+ # Foreground (Ctrl+C to stop)
185
+ proton-mail-bridge-client notify
186
+
187
+ # Background (macOS / Linux)
188
+ proton-mail-bridge-client notify &
189
+
190
+ # Custom folder and idle timeout
191
+ proton-mail-bridge-client notify --folder INBOX --timeout 60
192
+ ```
193
+
194
+ Each notification event is also written as a JSON line to stdout:
195
+
196
+ ```json
197
+ {"event":"new_mail","folder":"INBOX","count":2,"at":"2026-05-18T14:32:01.000Z"}
198
+ ```
199
+
200
+ Uses IMAP IDLE — no polling, no extra network requests between events. Reconnects automatically on transient errors.
201
+
202
+ ### MCP tool passthrough
203
+
204
+ Any MCP tool is also callable directly from the CLI:
205
+
206
+ ```bash
207
+ proton-mail-bridge-client tools
208
+ proton-mail-bridge-client tool get_connection_status --json
209
+ proton-mail-bridge-client tool search_indexed_emails --args '{"query":"invoice","limit":3}'
210
+ ```
211
+
212
+ ## Environment
213
+
214
+ The CLI and MCP server both read the same environment variables:
215
+
216
+ ```bash
217
+ export PROTONMAIL_USERNAME='you@proton.me'
218
+ export PROTONMAIL_PASSWORD='your-bridge-password'
219
+ export PROTONMAIL_IMAP_HOST='127.0.0.1'
220
+ export PROTONMAIL_IMAP_PORT='1143'
221
+ export PROTONMAIL_IMAP_SECURE='false'
222
+ export PROTONMAIL_SMTP_HOST='127.0.0.1'
223
+ export PROTONMAIL_SMTP_PORT='1025'
224
+ export PROTONMAIL_DATA_DIR="$HOME/.proton-mail-bridge-client"
225
+ ```
226
+
227
+ Optional secrets via file or command (avoids raw credentials in shell):
228
+
229
+ ```bash
230
+ export PROTONMAIL_USERNAME_FILE='/path/to/user.txt'
231
+ export PROTONMAIL_PASSWORD_FILE='/path/to/pass.txt'
232
+ # or
233
+ export PROTONMAIL_USERNAME_COMMAND='pass proton/username'
234
+ export PROTONMAIL_PASSWORD_COMMAND='pass proton/password'
235
+ ```
236
+
237
+ Full runtime flags:
238
+
239
+ ```bash
240
+ export PROTONMAIL_READ_ONLY='false'
241
+ export PROTONMAIL_ALLOW_SEND='true'
242
+ export PROTONMAIL_ALLOW_REMOTE_DRAFT_SYNC='true'
243
+ export PROTONMAIL_ALLOWED_ACTIONS='mark_read,mark_unread,star,unstar,archive,trash,restore'
244
+ export PROTONMAIL_CONFIRM_DESTRUCTIVE='false'
245
+ export PROTONMAIL_AUTO_SYNC='true'
246
+ export PROTONMAIL_STARTUP_SYNC='true'
247
+ export PROTONMAIL_SYNC_INTERVAL_MINUTES='5'
248
+ export PROTONMAIL_IDLE_WATCH='true'
249
+ export PROTONMAIL_IDLE_MAX_SECONDS='30'
250
+ ```
251
+
252
+ ## Claude Desktop Setup
253
+
254
+ To use Proton Mail Bridge Client with Claude Desktop, run the guided wizard:
255
+
256
+ ```bash
257
+ npm run setup:claude-desktop
258
+ ```
259
+
260
+ This will:
261
+
262
+ - check your local Bridge ports
263
+ - ask for your Bridge username and password
264
+ - build the project
265
+ - install a stable machine-wide runtime
266
+ - write the Claude Desktop MCP config entry
267
+
268
+ After setup: restart Claude Desktop, keep Proton Bridge open, then check `+` → `Connectors` → `proton-mail-bridge`.
269
+
270
+ The runtime is installed at:
271
+
272
+ - macOS: `~/Library/Application Support/Proton Mail Bridge Client`
273
+ - Linux: `~/.local/share/proton-mail-bridge-client`
274
+ - Windows: `%APPDATA%\Proton Mail Bridge Client`
275
+
276
+ ### Updating
277
+
278
+ ```bash
279
+ git pull
280
+ npm run update:claude-desktop
281
+ ```
282
+
283
+ ### Manual Claude Desktop config
284
+
285
+ Three credential methods are supported. Use whichever fits your setup:
286
+
287
+ **Option 1 — Environment variables (simplest):**
288
+
289
+ ```json
290
+ {
291
+ "mcpServers": {
292
+ "proton-mail-bridge": {
293
+ "command": "node",
294
+ "args": ["/path/to/runtime/dist/index.js"],
295
+ "cwd": "/path/to/runtime",
296
+ "env": {
297
+ "PROTONMAIL_USERNAME": "you@proton.me",
298
+ "PROTONMAIL_PASSWORD": "your-bridge-password",
299
+ "PROTONMAIL_IMAP_HOST": "127.0.0.1",
300
+ "PROTONMAIL_IMAP_PORT": "1143",
301
+ "PROTONMAIL_IMAP_SECURE": "false",
302
+ "PROTONMAIL_SMTP_HOST": "127.0.0.1",
303
+ "PROTONMAIL_SMTP_PORT": "1025"
304
+ }
305
+ }
306
+ }
307
+ }
308
+ ```
309
+
310
+ **Option 2 — File-based secrets (credentials in files, not config):**
311
+
312
+ ```json
313
+ {
314
+ "mcpServers": {
315
+ "proton-mail-bridge": {
316
+ "command": "node",
317
+ "args": ["/path/to/runtime/dist/index.js"],
318
+ "cwd": "/path/to/runtime",
319
+ "env": {
320
+ "PROTONMAIL_USERNAME_FILE": "/path/to/username.txt",
321
+ "PROTONMAIL_PASSWORD_FILE": "/path/to/password.txt",
322
+ "PROTONMAIL_IMAP_HOST": "127.0.0.1",
323
+ "PROTONMAIL_IMAP_PORT": "1143",
324
+ "PROTONMAIL_IMAP_SECURE": "false",
325
+ "PROTONMAIL_SMTP_HOST": "127.0.0.1",
326
+ "PROTONMAIL_SMTP_PORT": "1025"
327
+ }
328
+ }
329
+ }
330
+ }
331
+ ```
332
+
333
+ **Option 3 — Command-based secrets (recommended for `pass`, `gopass`, or any secret manager):**
334
+
335
+ ```json
336
+ {
337
+ "mcpServers": {
338
+ "proton-mail-bridge": {
339
+ "command": "node",
340
+ "args": ["/path/to/runtime/dist/index.js"],
341
+ "cwd": "/path/to/runtime",
342
+ "env": {
343
+ "PROTONMAIL_USERNAME_COMMAND": "pass proton/username",
344
+ "PROTONMAIL_PASSWORD_COMMAND": "pass proton/password",
345
+ "PROTONMAIL_IMAP_HOST": "127.0.0.1",
346
+ "PROTONMAIL_IMAP_PORT": "1143",
347
+ "PROTONMAIL_IMAP_SECURE": "false",
348
+ "PROTONMAIL_SMTP_HOST": "127.0.0.1",
349
+ "PROTONMAIL_SMTP_PORT": "1025"
350
+ }
351
+ }
352
+ }
353
+ }
354
+ ```
355
+
356
+ ### macOS note
357
+
358
+ On macOS, `better-sqlite3` must be a native binary built for the current machine. The installer handles this automatically. If you restore from another environment or see a native-module crash, run `npm run update:claude-desktop`.
359
+
360
+ ## Trust & Safety
361
+
362
+ - Runs entirely locally — no hosted relay, no remote URL.
363
+ - Talks to Proton Mail only through Proton Bridge on your own machine.
364
+ - `PROTONMAIL_READ_ONLY=true` disables all write operations.
365
+ - `PROTONMAIL_ALLOW_SEND=false` disables SMTP sends without affecting other writes.
366
+ - `PROTONMAIL_ALLOWED_ACTIONS` controls which mailbox mutations are permitted.
367
+ - `PROTONMAIL_CONFIRM_DESTRUCTIVE=true` requires `confirmed: true` on `send_email`, `reply_to_email`, `forward_email`, `send_draft`, and `delete_email` — Claude will pause and ask before executing irreversible operations.
368
+ - `batch_email_action` and `apply_thread_action` both support `dryRun: true`.
369
+ - Supports `*_FILE` and `*_COMMAND` secrets so raw credentials never appear in config or shell history.
370
+ - System folders (INBOX, Sent, Trash, Spam, Archive, All Mail) are guarded against accidental deletion.
371
+
372
+ ## Compared With Claude's Native Gmail Connector
373
+
374
+ | Capability | Gmail connector | Proton Mail Bridge Client |
375
+ |---|---|---|
376
+ | Setup | First-party OAuth | Requires Proton Bridge + this client |
377
+ | Search and read | Native Claude UX | IMAP + local index |
378
+ | Send email | No | Yes |
379
+ | Draft workflows | Better first-party UX | Full control incl. remote draft sync |
380
+ | Attachment content | Limited | Fetch and save |
381
+ | Mailbox actions | Limited | Full (star, move, archive, trash, restore, delete, batch) |
382
+ | Folder management | No | Yes (create, rename, delete) |
383
+ | CLI access | No | Full parity with MCP |
384
+ | Original message links | Better | MCP resource links only |
385
+ | Native threads/labels | Gmail-native | Reconstructed from IMAP |
386
+
387
+ ## Example Claude Workflows
388
+
389
+ Once connected, ask Claude anything. Some prompts that work well:
390
+
391
+ **Morning triage**
392
+ > "Give me a digest of my inbox. Flag anything that needs a reply today and anything that looks like a bill or invoice."
393
+
394
+ **Inbox zero session**
395
+ > "Go through my unread emails from the past 3 days. Archive newsletters, trash anything promotional, and tell me what's left that needs action."
396
+
397
+ **Folder filing**
398
+ > "Find all emails from stripe.com and move them to Folders/Receipts. Create the folder if it doesn't exist."
399
+
400
+ **Meeting prep**
401
+ > "I have a call with alice@example.com in an hour. Pull up our last 5 email threads and summarise the open items."
402
+
403
+ **Draft review**
404
+ > "Show me my drafts, pick the oldest one, and suggest a better subject line and closing paragraph."
405
+
406
+ > **Tip:** If Claude needs to create a folder before moving emails, remind it to use `Folders/Name` (not just `Name`) — that's the Proton Bridge namespace for real folders vs. labels.
407
+
408
+ ## Tool Surface
409
+
410
+ ### Send
411
+ `send_email` · `send_test_email` · `reply_to_email` · `forward_email`
412
+
413
+ ### Drafts
414
+ `create_draft` · `create_reply_draft` · `create_forward_draft` · `create_thread_reply_draft` · `list_drafts` · `list_remote_drafts` · `get_draft` · `update_draft` · `sync_draft_to_remote` · `send_draft` · `delete_draft`
415
+
416
+ ### Read
417
+ `get_emails` · `get_email_by_id` · `search_emails` · `list_attachments` · `get_attachment_content` · `save_attachments` · `save_attachment`
418
+
419
+ ### Triage
420
+ `get_folders` · `sync_folders` · `get_labels` · `get_threads` · `get_thread_by_id` · `get_thread_brief` · `get_actionable_threads` · `get_inbox_digest` · `get_follow_up_candidates` · `find_document_threads` · `prepare_meeting_context`
421
+
422
+ ### Actions
423
+ `mark_email_read` · `star_email` · `move_email` · `archive_email` · `trash_email` · `restore_email` · `delete_email` · `batch_email_action` · `apply_thread_action`
424
+
425
+ ### Folder management
426
+ `create_folder` · `rename_folder` · `delete_folder`
427
+
428
+ ### Analytics
429
+ `get_email_stats` · `get_email_analytics` · `get_contacts` · `get_volume_trends`
430
+
431
+ ### Diagnostics
432
+ `get_connection_status` · `get_runtime_status` · `run_doctor` · `get_audit_logs` · `run_background_sync` · `wait_for_mailbox_changes` · `sync_emails` · `get_index_status` · `search_indexed_emails` · `clear_cache` · `clear_index` · `get_logs`
433
+
434
+ ## Operational Notes
435
+
436
+ - `get_emails` and `search_emails` return a composite `emailId` — use it for reads and actions.
437
+ - The local index lives at `PROTONMAIL_DATA_DIR/mail-index.sqlite`.
438
+ - Audit logs live at `PROTONMAIL_DATA_DIR/audit.log`.
439
+ - Background sync and IMAP IDLE keep the index warm but depend on Bridge staying up.
440
+ - `search_indexed_emails` supports `from:`, `to:`, `subject:`, `label:`, `domain:` shortcuts.
441
+ - Draft sync is best-effort — local draft is always preserved even if remote sync fails.
442
+
443
+ ## License
444
+
445
+ MIT
package/dist/cli.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ type CliFlags = Record<string, string | boolean>;
3
+ export interface ParsedCliArgs {
4
+ command: string;
5
+ subcommand?: string;
6
+ positionals: string[];
7
+ flags: CliFlags;
8
+ }
9
+ export declare function parseCliArgs(argv: string[]): ParsedCliArgs;
10
+ export declare function main(): Promise<void>;
11
+ export {};
12
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAiBA,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,aAAa,CAgC1D;AAq9CD,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAoL1C"}