mailpouch
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PORT | No | Override settings UI HTTP server port | 8766 |
| MAILPOUCH_TIER | No | Tool-tier override: core / extended / complete | complete |
| MAILPOUCH_AUDIT | No | Override escalation audit log path | ~/.mailpouch.audit.jsonl |
| MAILPOUCH_AGENTS | No | Override per-agent grant store path | ~/.mailpouch-agents.json |
| MAILPOUCH_CONFIG | No | Override config file path | ~/.mailpouch.json |
| MAILPOUCH_FTS_DB | No | Override full-text-search index database path | ~/.mailpouch-fts.db |
| MAILPOUCH_PENDING | No | Override pending escalations file path | ~/.mailpouch.pending.json |
| MAILPOUCH_LOG_FILE | No | Override log file path | ~/.mailpouch.log |
| MAILPOUCH_REMINDERS | No | Override reminder persistence file path | ~/.mailpouch-reminders.json |
| MAILPOUCH_PASS_AUDIT | No | Override Proton Pass access audit log path | ~/.mailpouch-pass-audit.jsonl |
| MAILPOUCH_AGENT_AUDIT | No | Override per-agent tool-call audit log path | ~/.mailpouch-agent-audit.jsonl |
| MAILPOUCH_FORCE_STDIO | No | Force stdio for this spawn even if the config has remoteMode: true | unset |
| MAILPOUCH_MACHINE_SECRET | No | Override the machine-binding secret used to encrypt at-rest credentials | derived from host |
| MAILPOUCH_INSECURE_BRIDGE | No | Per-launch opt-in to localhost Bridge without a pinned cert | unset |
| MAILPOUCH_SCHEDULER_STORE | No | Scheduled email persistence file | ~/.mailpouch-scheduled.json |
| MAILPOUCH_SERVICE_ACCOUNTS | No | Override service-account (client_credentials) store path | ~/.mailpouch-service-accounts.json |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| send_emailA | Send an email via Proton Mail SMTP (through Proton Bridge). Supports To/CC/BCC (comma-separated), plain text or HTML body, priority (high/normal/low), reply-to, and base64-encoded attachments. Returns messageId on success. |
| reply_to_emailA | Send a reply to an existing email. Fetches the original to pre-fill To, Re:-prefixed subject, and thread references. Use replyAll to include original CC recipients. |
| forward_emailA | Forward an email to a new recipient. Original message is included as quoted content. Standard email headers (From, Date, Subject) are preserved in the forward body. Optionally prepend a message before the forwarded content. |
| send_test_emailA | Send a test email to verify SMTP is working. Returns messageId on success. Use before relying on send_email in automated workflows. |
| get_emailsA | Fetch a page of emails from a folder. Returns summary fields (id, messageId, from, subject, date, isRead, bodyPreview). |
| get_email_by_idA | Fetch a single email's full content including body, attachment metadata (no binary content), isAnswered, and isForwarded flags. Use the id returned by get_emails or search_emails. |
| search_emailsA | Search the live mailbox by sender, recipient (To/CC/BCC), subject, body content, date range (received or sent), size, read/replied/starred/draft status, or attachment presence. Uses server-side IMAP SEARCH except hasAttachment, which filters locally. Use fts_search only for faster local ranked search after its index is built. Use folder for one folder or folders for many (pass ["*"] for all); returns summaries, so use get_email_by_id for full content. |
| get_unread_countA | Get unread email count for each folder. Cheap call — use this before get_emails to decide whether to fetch. Returns object mapping folder path to unread count. |
| list_labelsA | List only Proton Mail labels with message counts (Labels/ prefix), not regular folders. Use get_folders when you also need regular folders, folder type, or IMAP special-use metadata. |
| get_emails_by_labelA | Legacy convenience wrapper for get_emails with folder set to Labels/. Prefer get_emails when you need the canonical pagination and summaryOnly options. |
| get_foldersA | List all email folders with message counts. Labels appear as folders with the Labels/ prefix (e.g. Labels/Work). Each folder reports |
| sync_foldersA | Refresh the folder list from IMAP (invalidates folder cache). Call this after creating/renaming/deleting folders in another client or if folder counts seem stale. |
| create_folderA | Create one new IMAP mailbox. Use Folders/Name for a custom folder or Labels/Name for a label; the path must be unused across both namespaces. Use rename_folder to change an existing mailbox. Returns success after Proton Bridge accepts the create; create labels before adding them with move_to_label. |
| delete_folderA | Delete an empty folder or label. Protected system folders (INBOX, Sent, Drafts, Trash, Spam, Archive, All Mail, Starred) cannot be deleted. Requires { confirmed: true }. |
| rename_folderA | Rename a custom folder or label. Protected system folders cannot be renamed. |
| mark_email_readA | Set the read/unread status of an email. isRead defaults to true. Pass sourceFolder whenever the UID came from a folder other than INBOX — IMAP UIDs are folder-scoped and silent no-ops can otherwise occur. |
| star_emailA | Toggle the starred (flagged) status of an email. isStarred defaults to true. Pass sourceFolder whenever the UID came from a folder other than INBOX. |
| mark_answeredA | Set or clear the \Answered flag on an email (the IMAP 'replied to' marker). answered defaults to true. Pass sourceFolder whenever the UID came from a folder other than INBOX. |
| mark_forwardedA | Set or clear the $Forwarded keyword on an email (the 'has been forwarded' marker the forward tool writes). forwarded defaults to true. Pass sourceFolder whenever the UID came from a folder other than INBOX. |
| move_emailA | Move an email to a different folder. Common targets: Trash, Archive, Spam, INBOX, Folders/MyFolder. Moving to Trash or Spam requires { confirmed: true }. Pass sourceFolder whenever the UID came from a folder other than INBOX — IMAP UIDs are folder-scoped. |
| archive_emailA | Move an email to the Archive folder. Convenience wrapper for move_email targeting Archive. Note: labels are lost when an email is moved — label copies in Labels/ folders are not preserved. |
| move_to_trashA | Move an email to the Trash folder. Convenience wrapper for move_email targeting Trash. Note: labels are lost when an email is moved — label copies in Labels/ folders are not preserved. Destructive: requires { confirmed: true }. |
| move_to_spamA | Move an email to the Spam folder. Convenience wrapper for move_email targeting Spam. Destructive: requires { confirmed: true }. |
| move_to_folderA | Move an email to a custom folder (Folders/). Similar to move_to_label but for Folders/ paths. |
| bulk_mark_readA | Mark multiple emails as read or unread. Emits progress notifications. Returns success/failed counts. Pass sourceFolder whenever the UIDs came from a folder other than INBOX. |
| bulk_starA | Star or unstar multiple emails. Emits progress notifications. Returns success/failed counts. Pass sourceFolder whenever the UIDs came from a folder other than INBOX. |
| bulk_move_emailsA | Move multiple emails to a folder in one call. Moving to Trash or Spam requires { confirmed: true }. Emits progress notifications if a progressToken is provided in _meta. Returns success/failed counts. Pass sourceFolder whenever the UIDs came from a folder other than INBOX. |
| move_to_labelA | Add a label to an email. The email remains in its original folder and also appears in Labels/{label}; labels are additive, so an email can have multiple labels simultaneously. Use move_email only when the email should leave its source folder. |
| bulk_move_to_labelA | Add a label to multiple emails. Each email remains in its original folder and also appears in Labels/{label}; use bulk_move_emails only when messages should leave their source folder. Progress notifications are sent for large batches. |
| remove_labelA | Remove a label from an email. The email is removed from Labels/{label} but remains in its original folder (Inbox, etc.). The UID passed must be the UID in Labels/{label} (not the INBOX/source UID) — Labels/ folders have their own UID space. |
| bulk_remove_labelA | Remove a label from multiple emails. Emails are removed from Labels/{label} but remain in their original folders. The UIDs passed must be the UIDs inside Labels/{label} — Labels/ folders have their own UID space, so INBOX UIDs will silently miss. |
| delete_emailA | Delete an email by MOVING it to Trash — mail is never permanently deleted and stays recoverable from Trash. An email already in Trash is left in place. Requires { confirmed: true }. Pass sourceFolder whenever the UID came from a folder other than INBOX. |
| bulk_delete_emailsA | Delete multiple emails by MOVING them to Trash — mail is never permanently deleted and stays recoverable from Trash. Emits progress notifications if a progressToken is provided in _meta. Returns success/failed counts. Requires { confirmed: true }. Pass sourceFolder whenever the UIDs came from a folder other than INBOX. |
| empty_trashA | PERMANENTLY delete every message in the Trash mailbox. This is the only operation that bypasses the move-to-Trash safety net — purged mail is UNRECOVERABLE. It only ever touches the Trash mailbox, never live mail. Requires { confirmed: true }. |
| get_email_statsA | Return a compact inbox-and-sent dashboard: totals, unread count, most active contact, and storage estimate. Use get_email_analytics for deeper breakdowns or get_volume_trends for a custom date window. Results are cached for 5 minutes. |
| get_email_analyticsA | Return a detailed inbox-and-sent dashboard: top senders/recipients, peak hours, attachment stats, and measured response times (null when insufficient data). Use get_email_stats for a compact overview or get_volume_trends for a custom date window. Results are cached for 5 minutes. |
| get_contactsA | Extract a ranked contact list from inbox and sent history, including send/receive counts, last interaction, inferred organization, and recency. Use this to choose recipients; use get_correspondence_profile for one relationship in depth. |
| get_volume_trendsA | Return daily sent/received volume for a caller-selected time window. Use get_email_analytics for the broader default dashboard, or get_unread_count for current unread counts. |
| get_connection_statusA | Check live SMTP and IMAP health after setup. Returns connection status, TLS security mode (secure/insecure), and host/port details. Use setup_status first for credentials, Bridge reachability, or agent-approval diagnosis. |
| sync_emailsA | Fetch the latest emails from IMAP into the local cache. Use this to refresh the cache after Bridge syncs new messages. Returns emails fetched; use get_emails for paginated access. |
| clear_cacheA | Clear all in-memory caches (email message cache, folder cache, analytics cache). Forces fresh IMAP fetches on next access. Use if you suspect stale data. Does NOT rebuild the on-disk FTS index — run fts_rebuild to refresh fts_search results. |
| get_logsA | Retrieve recent server log entries filtered by level. Sensitive fields are redacted. |
| get_server_versionA | Return the running mailpouch server version. Use to confirm which version is active before reporting bugs or checking for new features. |
| start_bridgeA | Launch Proton Mail Bridge if it is not already running. Waits up to 15 s for SMTP/IMAP ports to become reachable before returning. |
| shutdown_serverA | Gracefully shut down the MCP server. Terminates Proton Bridge (regardless of whether this server launched it), disconnects IMAP/SMTP, scrubs credentials from memory, then exits. Requires { confirmed: true }. |
| restart_serverA | Restart the MCP server. Terminates Proton Bridge, shuts down gracefully, then spawns a fresh server process. If autoStartBridge is enabled the new process will re-launch Bridge automatically. Requires { confirmed: true }. |
| save_draftA | Save an email as a draft in the Drafts folder without sending it. All fields are optional — drafts can be incomplete. Returns the server-assigned UID. |
| schedule_emailA | Schedule an email for future delivery (minimum 60 seconds from now, maximum 30 days). Definite failures are retried up to 3 times; ambiguous deliveries are never retried automatically. Use list_scheduled_emails to view pending sends and cancel_scheduled_email to cancel before delivery. |
| list_scheduled_emailsA | List all scheduled emails, including in-flight and outcome-unknown deliveries. Sorted by scheduledAt ascending. |
| list_proton_scheduledA | List emails natively scheduled via Proton Mail web/mobile app (not MCP-scheduled emails). Reads the 'All Scheduled' IMAP folder exposed by Proton Bridge. |
| remind_if_no_replyA | Schedule a follow-up reminder for a message you've sent. Given the IMAP UID of a message in Sent, captures its Message-ID + recipient and fires a reminder after N days. Use check_reminders to retrieve due reminders; list_pending_reminders to audit; cancel_reminder to drop one. |
| list_pending_remindersA | List every pending no-reply reminder, sorted by earliest fireAt. |
| cancel_reminderA | Cancel a pending no-reply reminder by ID. Silently returns false if the ID is unknown or the reminder already fired. |
| check_remindersA | Return every pending reminder whose deadline has passed. Each returned reminder is transitioned to 'fired' status so it won't appear in subsequent calls. The agent can then search INBOX for replies to messageId and decide whether to surface the reminder to the user. |
| cancel_scheduled_emailA | Cancel a pending scheduled email before it is sent. Returns false if the ID is not found or the email has already been sent. |
| download_attachmentA | Download the binary content of an email attachment as a base64-encoded string. Use get_email_by_id first to see available attachments and their indices (0-based). Provide the message folder to avoid a cross-folder UID collision; it is required for folder-restricted agents. |
| get_threadA | Return all messages that look like they belong to the same thread as the given email. Uses the normalized Subject (Re:/Fwd: stripped) to collect related messages from INBOX + Sent. Folder-restricted agents only receive messages from their allowed folders. Useful for summarising long conversations in one call. |
| get_correspondence_profileA | Return relationship statistics for a single email address — volume sent/received, first and last interaction, average response time (if computable). Useful before drafting so the agent can match tone and recall context. |
| fts_searchA | BM25-ranked keyword search over the locally indexed mail corpus. Supports FTS5 syntax: phrases ("exact phrase"), boolean (foo AND bar, foo OR bar, NOT baz), prefix (proto*), and column filters (subject:invoice from:alice). Use search_emails for live, authoritative IMAP results; use this for faster ranked local search after fts_rebuild has populated the index. |
| fts_rebuildA | Clear the local FTS5 index and rebuild it from the messages currently cached by the analytics layer (INBOX + Sent). Intended for use after major mailbox changes or when fts_search returns stale results. Returns the number of messages indexed. |
| fts_statusA | Report the path, row count, and on-disk size of the local FTS5 index. Returns { available: false } when better-sqlite3 is not installed. |
| extract_action_itemsA | Scan a single email's body for action-item-looking lines (bullets with action verbs, TODO:/ACTION: markers, @mentions) and return a structured list with best-effort assignee and due-date fields. Heuristic — not a replacement for a real task extractor, but useful for quick triage. |
| extract_meetingA | Parse an iCalendar (ICS) attachment or inline VCALENDAR block out of an email and return structured meeting details. Returns { meeting: null } when no ICS block is found. Supports RFC 5545 line folding and the common VEVENT properties (SUMMARY, DTSTART, DTEND, LOCATION, ORGANIZER, ATTENDEE, DESCRIPTION, RRULE). |
| setup_statusA | CALL THIS FIRST. Diagnoses the mailpouch install end-to-end and returns the single next action to get connected: whether credentials are configured, whether Proton Bridge is reachable, and whether this agent's access has been approved. Always available — works even before the agent is approved or credentials are set. Use get_connection_status afterwards for live IMAP/SMTP auth health. |
| request_permission_escalationA | Request an increase in the server's active permission preset. YOU CANNOT APPROVE THIS YOURSELF — approval requires a human to open the settings UI (http://localhost:8766) and click Approve. Use check_escalation_status to poll for the result. Downgrading (reducing access) never requires a challenge. |
| check_escalation_statusA | Check whether a pending permission escalation has been approved, denied, or has expired. Poll this after calling request_permission_escalation. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| triage_inbox | Review unread emails, assess urgency, and suggest actions (reply / archive / delete / snooze). Uses available tools to act on approved decisions. |
| compose_reply | Draft a reply to a specific email, preserving thread context and tone. |
| daily_briefing | Summarize today's inbox: unread count, key senders, action items, and any calendar or deadline mentions. |
| find_subscriptions | Identify bulk sender / newsletter / subscription emails in the inbox and offer to archive or delete them. |
| thread_summary | Fetch all messages related to a thread and produce a concise summary with open action items. |
| draft_in_my_voice | Draft a new email to a specific recipient in the user's own voice, using a handful of their recent sent emails as tone samples. The LLM infers style (formality, greeting/sign-off habits, typical length) from the samples rather than guessing. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chandshy/mailpouch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server