MCP ScannerCustom audit
All servers

patrickfreyer/apple-mail-mcp

MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language

Packagemcp-apple-mail
Version3.4.0 in pyproject.toml
Publisherpatrickfreyer community
MCP Registrynot listed
Scanned2026-11-25
Scannerv1.3.0
Methodologyv1.2
Stars 256Forks 62Last push 2026-11-11
Python 100.0%by source files the scanner reads
Code safetypartly tracedExposure6.1Prompts10.0Supply chain5.3Secrets10.0Transparency10.0
Analysis confidence90%
How much of the server the scanner could read: tools analyzed, files parsed, limits hit.
Code Safetypartly traced—

Paths from tool input into commands, SQL, files and URLs

Capability Exposure6.1/10Fair

How much power the tools give an agent over the machine

Prompt Integritynothing published yet10.0/10

Hidden instructions and poisoning in text for the model

Supply Chain5.3/10Fair

Known vulnerabilities in the packages the server uses

Secrets & Credentialsnothing published yet10.0/10

How the server reads credentials and where they can go

Behavior Transparencynothing published yet10.0/10

Whether the tools do only what their descriptions say

How far the analysis went

The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.

  • In 1 place a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
  • 2 tools, prompts and resources registered only in the repository's tests are not counted on this page

Top risks in plain words

  • CRITICAL1 production dependency has known vulnerabilities (worst: critical).

How to use it safely

Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.

  • Update its vulnerable packages

    Use fastmcp 3.4.10 or later.

  • Keep confirmations on

    Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.

What its tools can do on your machine

The server offers 28 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.

Start other programs on the machinecan run commands or launch programs
compose_email, create_rich_email_draft, forward_email, reply_to_email
4 of 28
Read or write filesopen, create, change or delete files
compose_email, create_mailbox, create_rich_email_draft, export_emails, forward_email, get_awaiting_reply and 22 more
28 of 28

No tool was seen to: connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.

Where its requests and secrets go

Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.

Hosts written in the code

The literal addresses the tools' requests name.

  • None: no request names a fixed host.
Addresses from settings

Constants or settings that start an address; the value comes from configuration.

  • None seen.
Secrets it reads

Credential-like environment variables. Give the server a key with the least access it needs.

  • None: no credential-like variable is read by the tools.

Text it brings in from outside

Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.

  • files28 tools · compose_email, create_mailbox, create_rich_email_draft +25

Tool annotations

No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.

Tools, prompts and resources (28: 28 tools)

Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.

compose_emailtool Compose and send a new email from a specific account.ProcessesFilesoutside text
Compose and send a new email from a specific account.

    Args:
        account: Account name to send from (e.g., "Gmail", "Work", "Personal")
        to: Recipient email address(es), comma-separated for multiple
        subject: Email subject line
        body: Email body text (used as plain-text fallback when body_html is provided)
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        attachments: Optional file paths to attach, comma-separated for multiple (e.g., "/path/to/file1.png,/path/to/file2.pdf")
        mode: Delivery mode — "send" (send immediately, default), "draft" (save silently to Drafts), or "open" (open compose window for review before sending)
        body_html: Optional HTML body for rich formatting (bold, headings, links, colors). When provided, the email is sent as HTML. The plain 'body' field is still required as fallback text.
        from_address: Optional sender address to use for this message. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Confirmation message with details of the email
create_mailboxtool Create a new mailbox (folder) in the specified account.Filesoutside text
Create a new mailbox (folder) in the specified account.

    Supports nested paths via the parent_mailbox parameter (e.g.,
    parent_mailbox="Projects" + name="2024" creates Projects/2024).
    You can also pass a full slash-separated path as *name*
    (e.g., "Projects/2024/ClientName") and omit parent_mailbox.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        name: Name for the new mailbox. May contain "/" to create a
              nested path in one call (each segment is created if needed).
        parent_mailbox: Optional existing parent folder for nesting.

    Returns:
        Confirmation with the new mailbox path.
create_rich_email_drafttool Create a rich-text email draft by generating an unsent `.eml` message and optionally opening it in Mail.ProcessesFilesoutside text
Create a rich-text email draft by generating an unsent `.eml` message and optionally opening it in Mail.

    This is the preferred path for HTML or richly formatted emails because Mail reliably renders `.eml`
    content, while setting raw HTML through AppleScript often stores the literal markup instead.

    Args:
        account: Account name to use for the sender identity (e.g., "Work", "Oracle")
        subject: Subject line for the draft (optional; defaults to empty)
        to: Optional recipient email address(es), comma-separated for multiple
        text_body: Optional plain-text body. If omitted but html_body is provided, a fallback plain body is generated.
        html_body: Optional HTML body. If omitted but text_body is provided, a basic HTML wrapper is generated.
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        output_path: Optional path for the generated `.eml` file (same protected-location
            rules as save_email_attachment; defaults to ~/Library/Caches/apple-mail-mcp/rich-drafts)
        open_in_mail: If True, open the generated `.eml` in Mail (default: True)
        save_as_draft: Not currently supported. Mail opens a `.eml` as a read-only message
            viewer, not a compose object, so it can never be saved into Drafts this way.
            Passing True is reported honestly in the output rather than silently ignored;
            use `compose_email(mode="draft")` or `manage_drafts` for a real, sendable draft.
        from_address: Optional sender address to stamp into the `.eml` `From:` header. Must be one of the account's configured email addresses. When omitted, Mail fills the account's default "Send new messages from" address on open.

    Returns:
        Confirmation with the generated `.eml` path, missing details, and Mail-open/save status
export_emailstool Export emails to files for backup or analysis.Filesoutside text
Export emails to files for backup or analysis.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        scope: Export scope: "single_email" (requires subject_keyword) or "entire_mailbox"
        subject_keyword: Keyword to find email (required for single_email)
        mailbox: Mailbox to export from (default: "INBOX")
        save_directory: Directory to save exports (default: "~/Desktop"). Protected
            locations (dot-folders in ~, LaunchAgents, ~/Library/Application Support,
            ...) are rejected.
        format: Export format: "txt", "html" (default: "txt")
        max_emails: Maximum number of emails to export for entire_mailbox (default: 1000, safety cap)

    Returns:
        Confirmation message with export location
forward_emailtool Forward an email to one or more recipients.ProcessesFilesoutside text
Forward an email to one or more recipients.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to search for in email subjects
        to: Recipient email address(es), comma-separated for multiple
        message: Optional message to add before forwarded content
        mailbox: Mailbox to search in (default: "INBOX")
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        from_address: Optional sender address to use when forwarding. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Confirmation message with details of forwarded email
get_awaiting_replytool Find sent emails that haven't received a reply yet.Filesoutside text
Find sent emails that haven't received a reply yet.

    Scans the Sent mailbox for outgoing emails and cross-references with
    the Inbox to see if a reply (matching subject) was received from the
    same recipient. Useful for follow-up tracking.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        days_back: How many days back to check sent emails (default: 7, 0 = all time)
        exclude_noreply: Skip emails sent to noreply/no-reply addresses (default: True)
        max_results: Maximum results to return (default: 20)

    Returns:
        List of sent emails still awaiting a reply with subject, recipient, and date sent
get_email_sourcetool Return the raw RFC 822 source of a single message.Filesoutside text
Return the raw RFC 822 source of a single message.

    The MCP's other body-extraction paths return Mail.app's rendered content
    (HTML collapsed to display text, hrefs dropped, embedded objects replaced
    with U+FFFC). This tool returns the raw source instead — all headers, all
    MIME parts, all hrefs intact.

    Implementation note:
    --------------------
    Wraps the ``source`` property of ``message`` defined in ``Mail.sdef``
    (the AppleScript dictionary for Mail.app). That property returns the
    same RFC 822 text Mail.app writes to the on-disk ``.partial.emlx`` file,
    so the consumer does not need filesystem access or knowledge of the
    Mail directory layout to recover MIME parts / hrefs / custom headers.

    Identifier resolution: ``message_id`` is preferred when both are provided
    (exact match on the RFC 822 ``Message-Id`` header via AppleScript's
    ``message id`` property — distinct from ``id``, which is Mail.app's
    internal numeric id). ``subject_keyword`` matches the first message in
    ``mailbox`` whose subject contains the substring.

    Output sizing: messages can be large (a plain note is ~200 KB; with
    attachments far larger). ``max_bytes`` caps the returned payload and
    appends a truncation marker when exceeded. ``headers_only=True`` returns
    only the RFC 822 header block (everything up to and including the first
    blank line) — usually sufficient for URL/header inspection and avoids
    returning base64 bodies. Cap applies after the headers_only filter.

    Args:
        account: Account name (e.g., ``"Gmail"``, ``"Work"``).
        subject_keyword: Substring to match against subject (first hit).
        message_id: RFC 822 Message-Id for exact match (preferred when known).
        mailbox: Mailbox name (default: ``"INBOX"``). Resolved via the
            shared ``build_mailbox_ref`` helper so non-English / Exchange
            inboxes (Posteingang, Bandeja de entrada, etc.) are found.
        headers_only: When ``True``, return only the header block.
        max_bytes: Byte cap on the returned payload (default 256 KB).

    Returns:
        The raw RFC 822 source as a string, or a string starting with
        ``"Error:"`` if the message could not be resolved.
get_email_threadtool Get an email conversation thread - messages linked by Message-ID, not just by subject.Filesoutside text
Get an email conversation thread - messages linked by Message-ID, not just by subject.

    Candidates are found by subject (fast, filtered inside Mail), then linked
    through their Message-ID / In-Reply-To / References headers. Messages that
    merely share the subject but belong to a different conversation are listed
    separately instead of being mixed into the thread.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to identify the thread (e.g., "Re: Project Update")
        mailbox: Mailbox to search in (default: "INBOX", use "All" for all mailboxes)
        max_messages: Maximum number of candidate messages to inspect (default: 50).
            The cap applies before linking: only the first N subject matches
            that Mail returns are considered, so the thread is seeded from the
            newest of those N, not necessarily the newest message overall.
            Raise it for long-running subjects.

    Returns:
        Formatted thread view sorted oldest first, with unlinked same-subject
        messages called out separately
get_inbox_overviewtool Get a comprehensive overview of your email inbox status across all accounts.Filesoutside text
Get a comprehensive overview of your email inbox status across all accounts.

    Returns:
        Comprehensive overview including:
        - Unread email counts by account
        - List of available mailboxes/folders
        - AI suggestions for actions (move emails, respond to messages, highlight action items, etc.)

    This tool is designed to give you a complete picture of your inbox and prompt the assistant
    to suggest relevant actions based on the current state.
get_mailbox_unread_countstool Get unread counts per mailbox for one account or all accounts.Filesoutside text
Get unread counts per mailbox for one account or all accounts.

    When summary_only=True, returns only per-account inbox unread totals
    (replaces the former get_unread_count tool).

    Args:
        account: Optional account name filter
        include_zero: Whether to include mailboxes with zero unread messages
        summary_only: If True, return only per-account inbox unread totals
                      (flat dict of account name -> unread count)

    Returns:
        If summary_only=False: nested dict keyed by account name then mailbox path
        If summary_only=True: flat dict mapping account names to inbox unread counts
get_needs_responsetool Identify unread emails that likely need a response from you.Filesoutside text
Identify unread emails that likely need a response from you.

    Filters out newsletters, automated emails, and noreply senders.
    Prioritises direct emails (To: you) with question marks as likely
    needing a reply.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        mailbox: Mailbox to scan (default: "INBOX")
        days_back: How many days back to look (default: 7)
        max_results: Maximum results to return (default: 20)

    Returns:
        Ranked list of emails likely needing a response, with priority hints
get_statisticstool Get comprehensive email statistics and analytics.Filesoutside text
Get comprehensive email statistics and analytics.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        scope: Analysis scope: "account_overview", "sender_stats", "mailbox_breakdown"
        sender: Specific sender for "sender_stats" scope
        mailbox: Specific mailbox for "mailbox_breakdown" scope
        days_back: Number of days to analyze (default: 30, 0 = all time)

    Returns:
        Formatted statistics report with metrics and insights
get_top_senderstool Analyse a mailbox to find the most frequent senders.Filesoutside text
Analyse a mailbox to find the most frequent senders.

    Useful for identifying key contacts, high-volume senders to filter,
    or newsletter sources to unsubscribe from.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        mailbox: Mailbox to analyse (default: "INBOX")
        days_back: How many days back to look (default: 30, 0 = all time)
        top_n: Number of top senders to return (default: 10)
        group_by_domain: Group results by domain instead of individual sender (default: False)

    Returns:
        Ranked list of senders (or domains) with email counts
inbox_dashboardtool Get an interactive dashboard view of your email inbox.Filesoutside text
Get an interactive dashboard view of your email inbox.

    Returns an interactive UI dashboard resource that displays:
    - Unread email counts by account (visual cards with badges)
    - Recent emails across all accounts (filterable list)
    - Quick action buttons for common operations (Mark Read, Archive, Delete)
    - Search functionality to filter emails

    This tool returns a UIResource that can be rendered by compatible
    MCP clients (like Claude Desktop with MCP Apps support) to provide
    an interactive dashboard experience.

    Note: Requires mcp-ui-server package and a compatible MCP client.

    Returns:
        UIResource with uri "ui://apple-mail/inbox-dashboard" containing
        an interactive HTML dashboard, or error message if UI is unavailable.
list_account_addressestool List all configured email addresses for each Mail account.Filesoutside text
List all configured email addresses for each Mail account.

    Useful for mapping a Mail.app account name (e.g. "Gmail", "Work") to the
    actual email address(es) it receives mail at — handy when an integration
    needs to know which inbox a message landed in by address rather than by
    Mail.app's display name.

    Returns:
        Dict mapping account name -> list of email addresses configured on
        that account. Accounts with no addresses configured map to [].
list_accountstool List all available Mail accounts.Filesoutside text
List all available Mail accounts.

    Returns:
        List of account names
list_email_attachmentstool List attachments for emails matching a subject keyword.Filesoutside text
List attachments for emails matching a subject keyword.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        subject_keyword: Keyword to search for in email subjects
        max_results: Maximum number of matching emails to check (default: 1)
        message_id: Numeric internal Mail id; overrides subject_keyword
        mailbox: Mailbox for id lookup (default: "INBOX"); nested names use "/"

    Returns:
        List of attachments with their names and sizes
list_inbox_emailstool List all emails from inbox across all accounts or a specific account.Filesoutside text
List all emails from inbox across all accounts or a specific account.

    Replaces the former get_recent_emails tool — use account + max_emails to
    get recent emails from a single account.

    Args:
        account: Optional account name to filter (e.g., "Gmail", "Work"). If None, shows all accounts.
        max_emails: Maximum number of emails to return per account (0 = all)
        include_read: Whether to include read emails (default: True)
        include_content: Whether to include a content preview for each email (slower, default: False)
        output_format: "text" (default, human-readable) or "json" (structured list of email dicts)

    Returns:
        Formatted list of emails with subject, sender, date, and read status
list_mailboxestool List all mailboxes (folders) for a specific account or all accounts.Filesoutside text
List all mailboxes (folders) for a specific account or all accounts.

    Args:
        account: Optional account name to filter (e.g., "Gmail", "Work"). If None, shows all accounts.
        include_counts: Whether to include message counts for each mailbox (default: True)

    Returns:
        Formatted list of mailboxes with optional message counts.
        For nested mailboxes, shows both indented format and path format (e.g., "Projects/Amplify Impact")
manage_draftstool Manage draft emails - list, create, send, open, or delete drafts.Filesoutside text
Manage draft emails - list, create, send, open, or delete drafts.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "list", "create", "send", "open", "delete". Use "open" to open a draft in a visible compose window for review before sending.
        subject: Email subject (required for create)
        to: Recipient email(s) for create (comma-separated)
        body: Email body (required for create)
        cc: Optional CC recipients for create
        bcc: Optional BCC recipients for create
        draft_subject: Subject keyword to find draft (required for send/open/delete)
        from_address: Optional sender address for new drafts (action="create"). Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Formatted output based on action
manage_trashtool Manage trash operations - delete emails or empty trash.Filesoutside text
Manage trash operations - delete emails or empty trash.

    Pass message_ids with action="move_to_trash" to trash specific messages
    by exact id (other filters are ignored). Each id is looked up on its own
    and its id is re-read right before the move, so a message is only
    trashed when it really is the one asked for.

    When dry_run=True (default) and action is "move_to_trash", previews what
    would be deleted without acting. Set dry_run=False to actually move to trash.

    Mail's AppleScript interface has no command that erases a message: `delete`
    means "move to Trash", and on a message that already sits in Trash it does
    nothing. "delete_permanent" and "empty_trash" therefore usually remove
    nothing at all. Both report the real before/after mailbox count instead of
    the number of delete calls, and say so when nothing was removed; emptying
    the trash for good has to happen in Mail itself.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "move_to_trash", "delete_permanent", "empty_trash"
        subject_keyword: Optional keyword to filter emails (not used for empty_trash)
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender to filter emails (not used for empty_trash)
        mailbox: Source mailbox (default: "INBOX", not used for empty_trash or delete_permanent)
        max_deletes: Maximum number of emails to delete (safety limit, default: 5)
        confirm_empty: Must be True to execute "empty_trash" action (safety confirmation)
        apply_to_all: Must be True to allow operations without subject_keyword or sender filter
        older_than_days: Optional age filter - only affect emails older than N days
        dry_run: If True (default), preview what would be affected without acting
        message_ids: Optional list of exact Mail message ids (move_to_trash only).
            When set, subject/sender/age filters and apply_to_all are ignored,
            and the number of ids must not exceed max_deletes.

    Returns:
        Confirmation message with details of deleted emails
move_emailtool Move email(s) matching filters from one mailbox to another.Filesoutside text
Move email(s) matching filters from one mailbox to another.

    Supports subject, sender, and date filters. Use dry_run=True to preview
    matches without moving. Set only_read=True to skip unread emails (useful
    for archiving). For archiving to "Archive", just set to_mailbox="Archive".
    Pass message_ids to move specific messages by exact id (ignores other
    filters; same fast path as update_email_status).

    Args:
        account: Account name (e.g., "Gmail", "Work")
        to_mailbox: Destination mailbox name. For nested mailboxes, use "/" separator (e.g., "Projects/Amplify Impact")
        subject_keyword: Optional keyword to search for in email subjects
        from_mailbox: Source mailbox name (default: "INBOX")
        max_moves: Maximum number of emails to move (default: 50, safety limit)
        subject_keywords: Optional list of keywords to match in subjects; matches any keyword
        sender: Optional sender to filter emails by
        older_than_days: Optional age filter - only move emails older than N days
        dry_run: If True, preview what would be moved without acting (default: False)
        only_read: If True, only move emails that have been read (default: False)
        message_ids: Optional list of exact Mail message ids for precise targeting. When set, all other filters are ignored.

    Returns:
        Confirmation message with details of moved emails
read_emailtool Read headers, plain-text body and attachment metadata for one message.Filesoutside text
Read headers, plain-text body and attachment metadata for one message.

    Use the numeric message_id returned by search_emails, not the RFC
    Message-ID header. The lookup never scans messages. max_chars caps only
    the body, with explicit truncation metadata. output_format is text or json.
    Attachment contents are never returned.
reply_to_emailtool Reply to an email matching a subject keyword.ProcessesFilesoutside text
Reply to an email matching a subject keyword.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to search for in email subjects
        reply_body: The body text of the reply
        reply_to_all: If True, reply to all recipients; if False, reply only to sender (default: False)
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        send: If True (default), send immediately; if False, save as draft. Ignored if mode is set.
        mode: Delivery mode — "send" (send immediately), "draft" (save silently), or "open" (open compose window for review). Overrides send parameter when set.
        attachments: Optional file paths to attach, comma-separated for multiple (e.g., "/path/to/file1.png,/path/to/file2.pdf")
        body_html: Optional HTML body for rich formatting (bold, headings, links, colors). When provided, the reply is pasted as HTML. The plain 'reply_body' field is still required as fallback text.
        from_address: Optional sender address to use for this reply. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.
        mailbox: Mailbox to look for the message in (default: "INBOX", which also matches localized inbox names). Use "/" for nested folders, e.g. "Projects/2026/Private".

    Returns:
        Confirmation message with details of the reply sent, saved draft, or opened draft
save_email_attachmenttool Save a specific attachment from an email to disk.Filesoutside text
Save a specific attachment from an email to disk.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        subject_keyword: Keyword to search for in email subjects (ignored with message_id)
        message_id: Numeric internal Mail id returned by search_emails
        attachment_name: Name of the attachment to save
        save_path: Full path where to save the attachment. Protected locations
            (shell startup and dotfiles in ~, .git/hooks, LaunchAgents,
            ~/Library/Application Support, ...) are rejected; see "File Access"
            in the README for opt-in restriction to specific folders.
        mailbox: Mailbox to search in (default: "INBOX"). Use e.g. "Archive" for an already archived message; nested mailboxes use "/".

    Returns:
        Confirmation message with save location
search_emailstool Unified search tool with JSON output, pagination, and real date filtering.Filesoutside text
Unified search tool with JSON output, pagination, and real date filtering.

    Consolidates subject search, sender search, body content search, and
    cross-account search into a single tool.

    Args:
        account: Account name to search in (e.g., "Gmail", "Work").
            If None, searches ALL accounts (slower).
        mailbox: Mailbox to search (default: "INBOX", use "All" for all mailboxes, or specific folder name)
        subject_keyword: Optional keyword to search in subject
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender email or name to filter by
        has_attachments: Optional filter for emails with attachments (True/False/None)
        flagged: Optional filter for flagged emails (True/False/None)
        flag_color: Optional filter for a specific flag color: "red", "orange",
            "yellow", "green", "blue", "purple", or "gray". Implies flagged=True.
        read_status: Filter by read status: "all", "read", "unread" (default: "all")
        date_from: Optional start date filter (format: "YYYY-MM-DD")
        date_to: Optional end date filter (format: "YYYY-MM-DD")
        include_content: Whether to include email content preview (slower)
        max_content_length: Maximum content length in characters when include_content=True (default: 500, 0 = unlimited)
        body_text: Optional text to search for in email body content (case-insensitive).
            WARNING: body search is significantly slower as it reads each message body.
        max_results: Backward-compatible alias for limit
        output_format: Output format: "text" or "json" (default: "text")
        offset: Number of matching results to skip before returning data
        limit: Maximum number of results to return per page
        sort: Result sort order: "date_desc" or "date_asc"
        max_body_reads: Only used with body_text. Maximum number of message
            bodies read per call (default 50, max 500). Cheap filters (sender,
            subject, dates, read/flag status) are applied first, so this caps
            only the messages that pass them. If a result comes back with
            scan_limited=true, either narrow the filters or retry with a
            higher value; uncached bodies can take up to ~1 s each, so very
            high values risk the call timing out.

    Returns:
        Formatted list of matching emails or JSON payload with stable message metadata
synchronize_accounttool Force Mail.app to synchronize an account (or every account) with itsFilesoutside text
Force Mail.app to synchronize an account (or every account) with its
    IMAP / Exchange server right now. Equivalent to clicking the
    refresh button next to the account or selecting Mailbox → Synchronize.

    Use after `move_email`, `update_email_status`, or `manage_trash`
    when downstream clients (iPhone, web mail, etc.) need to see the
    change immediately. Mail.app's natural sync cadence is "automatic"
    which can be several minutes — this collapses that to one IMAP push.

    Implementation note:
    --------------------
    Uses the `synchronize with <account>` AppleScript verb (per Mail.sdef:
    "Command to trigger synchronizing of an IMAP account with the server")
    rather than `check for new mail`. The latter is receive-only — it
    pulls new messages but does NOT push pending IMAP commands like
    queued moves / archives / flag changes. With `check for new mail`,
    archives done via `move_email` could sit in Mail.app's local cache
    for several minutes before reaching the IMAP server, leaving iPhone
    Mail (which reads IMAP directly) showing already-archived messages
    still in INBOX. `synchronize with` is the bidirectional verb that
    drains pending IMAP commands AND fetches new mail.

    Mail.app's synchronize is potentially long-running. We wrap each
    invocation in `with timeout of N seconds` so the AppleScript returns
    promptly. When the timeout fires (error -1712) Mail.app keeps the
    sync running in the background — exactly the fire-and-forget
    semantics callers expect.

    Args:
        account: Account name (e.g., "Gmail", "Work"). Omit to sync every
                 configured account.

    Returns:
        Confirmation string with the account(s) synced or queued.
update_email_statustool Update email status - mark as read/unread or flag/unflag emails.Filesoutside text
Update email status - mark as read/unread or flag/unflag emails.

    When message_ids is provided, uses exact ID matching (ignores other filters).
    Otherwise filters by subject, sender, and/or age.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "mark_read", "mark_unread", "flag", "unflag"
        subject_keyword: Optional keyword to filter emails by subject
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender to filter emails by
        mailbox: Mailbox to search in (default: "INBOX")
        max_updates: Maximum number of emails to update (safety limit, default: 10)
        apply_to_all: Must be True to allow updates without any filter
        message_ids: Optional list of exact Mail message ids for precise targeting
        older_than_days: Optional age filter - only update emails older than N days
        flag_color: Optional flag color for the "flag" action: "red", "orange",
            "yellow", "green", "blue", "purple", or "gray". Omit to flag
            without setting a color — Mail shows its default (red), or the
            message's previous color if one remains from an earlier flag.
            Re-colors messages that are already flagged.

    Returns:
        Confirmation message with details of updated emails

Text the model reads (28)

Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.

update_email_status tool
Update email status - mark as read/unread or flag/unflag emails.

    When message_ids is provided, uses exact ID matching (ignores other filters).
    Otherwise filters by subject, sender, and/or age.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "mark_read", "mark_unread", "flag", "unflag"
        subject_keyword: Optional keyword to filter emails by subject
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender to filter emails by
        mailbox: Mailbox to search in (default: "INBOX")
        max_updates: Maximum number of emails to update (safety limit, default: 10)
        apply_to_all: Must be True to allow updates without any filter
        message_ids: Optional list of exact Mail message ids for precise targeting
        older_than_days: Optional age filter - only update emails older than N days
        flag_color: Optional flag color for the "flag" action: "red", "orange",
            "yellow", "green", "blue", "purple", or "gray". Omit to flag
            without setting a color — Mail shows its default (red), or the
            message's previous color if one remains from an earlier flag.
            Re-colors messages that are already flagged.

    Returns:
        Confirmation message with details of updated emails
search_emails tool
Unified search tool with JSON output, pagination, and real date filtering.

    Consolidates subject search, sender search, body content search, and
    cross-account search into a single tool.

    Args:
        account: Account name to search in (e.g., "Gmail", "Work").
            If None, searches ALL accounts (slower).
        mailbox: Mailbox to search (default: "INBOX", use "All" for all mailboxes, or specific folder name)
        subject_keyword: Optional keyword to search in subject
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender email or name to filter by
        has_attachments: Optional filter for emails with attachments (True/False/None)
        flagged: Optional filter for flagged emails (True/False/None)
        flag_color: Optional filter for a specific flag color: "red", "orange",
            "yellow", "green", "blue", "purple", or "gray". Implies flagged=True.
        read_status: Filter by read status: "all", "read", "unread" (default: "all")
        date_from: Optional start date filter (format: "YYYY-MM-DD")
        date_to: Optional end date filter (format: "YYYY-MM-DD")
        include_content: Whether to include email content preview (slower)
        max_content_length: Maximum content length in characters when include_content=True (default: 500, 0 = unlimited)
        body_text: Optional text to search for in email body content (case-insensitive).
            WARNING: body search is significantly slower as it reads each message body.
        max_results: Backward-compatible alias for limit
        output_format: Output format: "text" or "json" (default: "text")
        offset: Number of matching results to skip before returning data
        limit: Maximum number of results to return per page
        sort: Result sort order: "date_desc" or "date_asc"
        max_body_reads: Only used with body_text. Maximum number of message
            bodies read per call (default 50, max 500). Cheap filters (sender,
            subject, dates, read/flag status) are applied first, so this caps
            only the messages that pass them. If a result comes back with
            scan_limited=true, either narrow the filters or retry with a
            higher value; uncached bodies can take up to ~1 s each, so very
            high values risk the call timing out.

    Returns:
        Formatted list of matching emails or JSON payload with stable message metadata
list_email_attachments tool
List attachments for emails matching a subject keyword.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        subject_keyword: Keyword to search for in email subjects
        max_results: Maximum number of matching emails to check (default: 1)
        message_id: Numeric internal Mail id; overrides subject_keyword
        mailbox: Mailbox for id lookup (default: "INBOX"); nested names use "/"

    Returns:
        List of attachments with their names and sizes
get_statistics tool
Get comprehensive email statistics and analytics.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        scope: Analysis scope: "account_overview", "sender_stats", "mailbox_breakdown"
        sender: Specific sender for "sender_stats" scope
        mailbox: Specific mailbox for "mailbox_breakdown" scope
        days_back: Number of days to analyze (default: 30, 0 = all time)

    Returns:
        Formatted statistics report with metrics and insights
export_emails tool
Export emails to files for backup or analysis.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        scope: Export scope: "single_email" (requires subject_keyword) or "entire_mailbox"
        subject_keyword: Keyword to find email (required for single_email)
        mailbox: Mailbox to export from (default: "INBOX")
        save_directory: Directory to save exports (default: "~/Desktop"). Protected
            locations (dot-folders in ~, LaunchAgents, ~/Library/Application Support,
            ...) are rejected.
        format: Export format: "txt", "html" (default: "txt")
        max_emails: Maximum number of emails to export for entire_mailbox (default: 1000, safety cap)

    Returns:
        Confirmation message with export location
inbox_dashboard tool
Get an interactive dashboard view of your email inbox.

    Returns an interactive UI dashboard resource that displays:
    - Unread email counts by account (visual cards with badges)
    - Recent emails across all accounts (filterable list)
    - Quick action buttons for common operations (Mark Read, Archive, Delete)
    - Search functionality to filter emails

    This tool returns a UIResource that can be rendered by compatible
    MCP clients (like Claude Desktop with MCP Apps support) to provide
    an interactive dashboard experience.

    Note: Requires mcp-ui-server package and a compatible MCP client.

    Returns:
        UIResource with uri "ui://apple-mail/inbox-dashboard" containing
        an interactive HTML dashboard, or error message if UI is unavailable.
create_rich_email_draft tool
Create a rich-text email draft by generating an unsent `.eml` message and optionally opening it in Mail.

    This is the preferred path for HTML or richly formatted emails because Mail reliably renders `.eml`
    content, while setting raw HTML through AppleScript often stores the literal markup instead.

    Args:
        account: Account name to use for the sender identity (e.g., "Work", "Oracle")
        subject: Subject line for the draft (optional; defaults to empty)
        to: Optional recipient email address(es), comma-separated for multiple
        text_body: Optional plain-text body. If omitted but html_body is provided, a fallback plain body is generated.
        html_body: Optional HTML body. If omitted but text_body is provided, a basic HTML wrapper is generated.
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        output_path: Optional path for the generated `.eml` file (same protected-location
            rules as save_email_attachment; defaults to ~/Library/Caches/apple-mail-mcp/rich-drafts)
        open_in_mail: If True, open the generated `.eml` in Mail (default: True)
        save_as_draft: Not currently supported. Mail opens a `.eml` as a read-only message
            viewer, not a compose object, so it can never be saved into Drafts this way.
            Passing True is reported honestly in the output rather than silently ignored;
            use `compose_email(mode="draft")` or `manage_drafts` for a real, sendable draft.
        from_address: Optional sender address to stamp into the `.eml` `From:` header. Must be one of the account's configured email addresses. When omitted, Mail fills the account's default "Send new messages from" address on open.

    Returns:
        Confirmation with the generated `.eml` path, missing details, and Mail-open/save status
reply_to_email tool
Reply to an email matching a subject keyword.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to search for in email subjects
        reply_body: The body text of the reply
        reply_to_all: If True, reply to all recipients; if False, reply only to sender (default: False)
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        send: If True (default), send immediately; if False, save as draft. Ignored if mode is set.
        mode: Delivery mode — "send" (send immediately), "draft" (save silently), or "open" (open compose window for review). Overrides send parameter when set.
        attachments: Optional file paths to attach, comma-separated for multiple (e.g., "/path/to/file1.png,/path/to/file2.pdf")
        body_html: Optional HTML body for rich formatting (bold, headings, links, colors). When provided, the reply is pasted as HTML. The plain 'reply_body' field is still required as fallback text.
        from_address: Optional sender address to use for this reply. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.
        mailbox: Mailbox to look for the message in (default: "INBOX", which also matches localized inbox names). Use "/" for nested folders, e.g. "Projects/2026/Private".

    Returns:
        Confirmation message with details of the reply sent, saved draft, or opened draft
compose_email tool
Compose and send a new email from a specific account.

    Args:
        account: Account name to send from (e.g., "Gmail", "Work", "Personal")
        to: Recipient email address(es), comma-separated for multiple
        subject: Email subject line
        body: Email body text (used as plain-text fallback when body_html is provided)
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        attachments: Optional file paths to attach, comma-separated for multiple (e.g., "/path/to/file1.png,/path/to/file2.pdf")
        mode: Delivery mode — "send" (send immediately, default), "draft" (save silently to Drafts), or "open" (open compose window for review before sending)
        body_html: Optional HTML body for rich formatting (bold, headings, links, colors). When provided, the email is sent as HTML. The plain 'body' field is still required as fallback text.
        from_address: Optional sender address to use for this message. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Confirmation message with details of the email
forward_email tool
Forward an email to one or more recipients.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to search for in email subjects
        to: Recipient email address(es), comma-separated for multiple
        message: Optional message to add before forwarded content
        mailbox: Mailbox to search in (default: "INBOX")
        cc: Optional CC recipients, comma-separated for multiple
        bcc: Optional BCC recipients, comma-separated for multiple
        from_address: Optional sender address to use when forwarding. Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Confirmation message with details of forwarded email
manage_drafts tool
Manage draft emails - list, create, send, open, or delete drafts.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "list", "create", "send", "open", "delete". Use "open" to open a draft in a visible compose window for review before sending.
        subject: Email subject (required for create)
        to: Recipient email(s) for create (comma-separated)
        body: Email body (required for create)
        cc: Optional CC recipients for create
        bcc: Optional BCC recipients for create
        draft_subject: Subject keyword to find draft (required for send/open/delete)
        from_address: Optional sender address for new drafts (action="create"). Must be one of the account's configured email addresses. When omitted, Mail uses the account's default "Send new messages from" setting.

    Returns:
        Formatted output based on action
list_inbox_emails tool
List all emails from inbox across all accounts or a specific account.

    Replaces the former get_recent_emails tool — use account + max_emails to
    get recent emails from a single account.

    Args:
        account: Optional account name to filter (e.g., "Gmail", "Work"). If None, shows all accounts.
        max_emails: Maximum number of emails to return per account (0 = all)
        include_read: Whether to include read emails (default: True)
        include_content: Whether to include a content preview for each email (slower, default: False)
        output_format: "text" (default, human-readable) or "json" (structured list of email dicts)

    Returns:
        Formatted list of emails with subject, sender, date, and read status
get_mailbox_unread_counts tool
Get unread counts per mailbox for one account or all accounts.

    When summary_only=True, returns only per-account inbox unread totals
    (replaces the former get_unread_count tool).

    Args:
        account: Optional account name filter
        include_zero: Whether to include mailboxes with zero unread messages
        summary_only: If True, return only per-account inbox unread totals
                      (flat dict of account name -> unread count)

    Returns:
        If summary_only=False: nested dict keyed by account name then mailbox path
        If summary_only=True: flat dict mapping account names to inbox unread counts
list_accounts tool
List all available Mail accounts.

    Returns:
        List of account names
list_account_addresses tool
List all configured email addresses for each Mail account.

    Useful for mapping a Mail.app account name (e.g. "Gmail", "Work") to the
    actual email address(es) it receives mail at — handy when an integration
    needs to know which inbox a message landed in by address rather than by
    Mail.app's display name.

    Returns:
        Dict mapping account name -> list of email addresses configured on
        that account. Accounts with no addresses configured map to [].
list_mailboxes tool
List all mailboxes (folders) for a specific account or all accounts.

    Args:
        account: Optional account name to filter (e.g., "Gmail", "Work"). If None, shows all accounts.
        include_counts: Whether to include message counts for each mailbox (default: True)

    Returns:
        Formatted list of mailboxes with optional message counts.
        For nested mailboxes, shows both indented format and path format (e.g., "Projects/Amplify Impact")
get_inbox_overview tool
Get a comprehensive overview of your email inbox status across all accounts.

    Returns:
        Comprehensive overview including:
        - Unread email counts by account
        - List of available mailboxes/folders
        - AI suggestions for actions (move emails, respond to messages, highlight action items, etc.)

    This tool is designed to give you a complete picture of your inbox and prompt the assistant
    to suggest relevant actions based on the current state.
move_email tool
Move email(s) matching filters from one mailbox to another.

    Supports subject, sender, and date filters. Use dry_run=True to preview
    matches without moving. Set only_read=True to skip unread emails (useful
    for archiving). For archiving to "Archive", just set to_mailbox="Archive".
    Pass message_ids to move specific messages by exact id (ignores other
    filters; same fast path as update_email_status).

    Args:
        account: Account name (e.g., "Gmail", "Work")
        to_mailbox: Destination mailbox name. For nested mailboxes, use "/" separator (e.g., "Projects/Amplify Impact")
        subject_keyword: Optional keyword to search for in email subjects
        from_mailbox: Source mailbox name (default: "INBOX")
        max_moves: Maximum number of emails to move (default: 50, safety limit)
        subject_keywords: Optional list of keywords to match in subjects; matches any keyword
        sender: Optional sender to filter emails by
        older_than_days: Optional age filter - only move emails older than N days
        dry_run: If True, preview what would be moved without acting (default: False)
        only_read: If True, only move emails that have been read (default: False)
        message_ids: Optional list of exact Mail message ids for precise targeting. When set, all other filters are ignored.

    Returns:
        Confirmation message with details of moved emails
save_email_attachment tool
Save a specific attachment from an email to disk.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        subject_keyword: Keyword to search for in email subjects (ignored with message_id)
        message_id: Numeric internal Mail id returned by search_emails
        attachment_name: Name of the attachment to save
        save_path: Full path where to save the attachment. Protected locations
            (shell startup and dotfiles in ~, .git/hooks, LaunchAgents,
            ~/Library/Application Support, ...) are rejected; see "File Access"
            in the README for opt-in restriction to specific folders.
        mailbox: Mailbox to search in (default: "INBOX"). Use e.g. "Archive" for an already archived message; nested mailboxes use "/".

    Returns:
        Confirmation message with save location
manage_trash tool
Manage trash operations - delete emails or empty trash.

    Pass message_ids with action="move_to_trash" to trash specific messages
    by exact id (other filters are ignored). Each id is looked up on its own
    and its id is re-read right before the move, so a message is only
    trashed when it really is the one asked for.

    When dry_run=True (default) and action is "move_to_trash", previews what
    would be deleted without acting. Set dry_run=False to actually move to trash.

    Mail's AppleScript interface has no command that erases a message: `delete`
    means "move to Trash", and on a message that already sits in Trash it does
    nothing. "delete_permanent" and "empty_trash" therefore usually remove
    nothing at all. Both report the real before/after mailbox count instead of
    the number of delete calls, and say so when nothing was removed; emptying
    the trash for good has to happen in Mail itself.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        action: Action to perform: "move_to_trash", "delete_permanent", "empty_trash"
        subject_keyword: Optional keyword to filter emails (not used for empty_trash)
        subject_keywords: Optional list of subject keywords; matches any keyword
        sender: Optional sender to filter emails (not used for empty_trash)
        mailbox: Source mailbox (default: "INBOX", not used for empty_trash or delete_permanent)
        max_deletes: Maximum number of emails to delete (safety limit, default: 5)
        confirm_empty: Must be True to execute "empty_trash" action (safety confirmation)
        apply_to_all: Must be True to allow operations without subject_keyword or sender filter
        older_than_days: Optional age filter - only affect emails older than N days
        dry_run: If True (default), preview what would be affected without acting
        message_ids: Optional list of exact Mail message ids (move_to_trash only).
            When set, subject/sender/age filters and apply_to_all are ignored,
            and the number of ids must not exceed max_deletes.

    Returns:
        Confirmation message with details of deleted emails
create_mailbox tool
Create a new mailbox (folder) in the specified account.

    Supports nested paths via the parent_mailbox parameter (e.g.,
    parent_mailbox="Projects" + name="2024" creates Projects/2024).
    You can also pass a full slash-separated path as *name*
    (e.g., "Projects/2024/ClientName") and omit parent_mailbox.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        name: Name for the new mailbox. May contain "/" to create a
              nested path in one call (each segment is created if needed).
        parent_mailbox: Optional existing parent folder for nesting.

    Returns:
        Confirmation with the new mailbox path.
synchronize_account tool
Force Mail.app to synchronize an account (or every account) with its
    IMAP / Exchange server right now. Equivalent to clicking the
    refresh button next to the account or selecting Mailbox → Synchronize.

    Use after `move_email`, `update_email_status`, or `manage_trash`
    when downstream clients (iPhone, web mail, etc.) need to see the
    change immediately. Mail.app's natural sync cadence is "automatic"
    which can be several minutes — this collapses that to one IMAP push.

    Implementation note:
    --------------------
    Uses the `synchronize with <account>` AppleScript verb (per Mail.sdef:
    "Command to trigger synchronizing of an IMAP account with the server")
    rather than `check for new mail`. The latter is receive-only — it
    pulls new messages but does NOT push pending IMAP commands like
    queued moves / archives / flag changes. With `check for new mail`,
    archives done via `move_email` could sit in Mail.app's local cache
    for several minutes before reaching the IMAP server, leaving iPhone
    Mail (which reads IMAP directly) showing already-archived messages
    still in INBOX. `synchronize with` is the bidirectional verb that
    drains pending IMAP commands AND fetches new mail.

    Mail.app's synchronize is potentially long-running. We wrap each
    invocation in `with timeout of N seconds` so the AppleScript returns
    promptly. When the timeout fires (error -1712) Mail.app keeps the
    sync running in the background — exactly the fire-and-forget
    semantics callers expect.

    Args:
        account: Account name (e.g., "Gmail", "Work"). Omit to sync every
                 configured account.

    Returns:
        Confirmation string with the account(s) synced or queued.
get_email_source tool
Return the raw RFC 822 source of a single message.

    The MCP's other body-extraction paths return Mail.app's rendered content
    (HTML collapsed to display text, hrefs dropped, embedded objects replaced
    with U+FFFC). This tool returns the raw source instead — all headers, all
    MIME parts, all hrefs intact.

    Implementation note:
    --------------------
    Wraps the ``source`` property of ``message`` defined in ``Mail.sdef``
    (the AppleScript dictionary for Mail.app). That property returns the
    same RFC 822 text Mail.app writes to the on-disk ``.partial.emlx`` file,
    so the consumer does not need filesystem access or knowledge of the
    Mail directory layout to recover MIME parts / hrefs / custom headers.

    Identifier resolution: ``message_id`` is preferred when both are provided
    (exact match on the RFC 822 ``Message-Id`` header via AppleScript's
    ``message id`` property — distinct from ``id``, which is Mail.app's
    internal numeric id). ``subject_keyword`` matches the first message in
    ``mailbox`` whose subject contains the substring.

    Output sizing: messages can be large (a plain note is ~200 KB; with
    attachments far larger). ``max_bytes`` caps the returned payload and
    appends a truncation marker when exceeded. ``headers_only=True`` returns
    only the RFC 822 header block (everything up to and including the first
    blank line) — usually sufficient for URL/header inspection and avoids
    returning base64 bodies. Cap applies after the headers_only filter.

    Args:
        account: Account name (e.g., ``"Gmail"``, ``"Work"``).
        subject_keyword: Substring to match against subject (first hit).
        message_id: RFC 822 Message-Id for exact match (preferred when known).
        mailbox: Mailbox name (default: ``"INBOX"``). Resolved via the
            shared ``build_mailbox_ref`` helper so non-English / Exchange
            inboxes (Posteingang, Bandeja de entrada, etc.) are found.
        headers_only: When ``True``, return only the header block.
        max_bytes: Byte cap on the returned payload (default 256 KB).

    Returns:
        The raw RFC 822 source as a string, or a string starting with
        ``"Error:"`` if the message could not be resolved.
read_email tool
Read headers, plain-text body and attachment metadata for one message.

    Use the numeric message_id returned by search_emails, not the RFC
    Message-ID header. The lookup never scans messages. max_chars caps only
    the body, with explicit truncation metadata. output_format is text or json.
    Attachment contents are never returned.
get_email_thread tool
Get an email conversation thread - messages linked by Message-ID, not just by subject.

    Candidates are found by subject (fast, filtered inside Mail), then linked
    through their Message-ID / In-Reply-To / References headers. Messages that
    merely share the subject but belong to a different conversation are listed
    separately instead of being mixed into the thread.

    Args:
        account: Account name (e.g., "Gmail", "Work")
        subject_keyword: Keyword to identify the thread (e.g., "Re: Project Update")
        mailbox: Mailbox to search in (default: "INBOX", use "All" for all mailboxes)
        max_messages: Maximum number of candidate messages to inspect (default: 50).
            The cap applies before linking: only the first N subject matches
            that Mail returns are considered, so the thread is seeded from the
            newest of those N, not necessarily the newest message overall.
            Raise it for long-running subjects.

    Returns:
        Formatted thread view sorted oldest first, with unlinked same-subject
        messages called out separately
get_awaiting_reply tool
Find sent emails that haven't received a reply yet.

    Scans the Sent mailbox for outgoing emails and cross-references with
    the Inbox to see if a reply (matching subject) was received from the
    same recipient. Useful for follow-up tracking.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        days_back: How many days back to check sent emails (default: 7, 0 = all time)
        exclude_noreply: Skip emails sent to noreply/no-reply addresses (default: True)
        max_results: Maximum results to return (default: 20)

    Returns:
        List of sent emails still awaiting a reply with subject, recipient, and date sent
get_needs_response tool
Identify unread emails that likely need a response from you.

    Filters out newsletters, automated emails, and noreply senders.
    Prioritises direct emails (To: you) with question marks as likely
    needing a reply.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        mailbox: Mailbox to scan (default: "INBOX")
        days_back: How many days back to look (default: 7)
        max_results: Maximum results to return (default: 20)

    Returns:
        Ranked list of emails likely needing a response, with priority hints
get_top_senders tool
Analyse a mailbox to find the most frequent senders.

    Useful for identifying key contacts, high-volume senders to filter,
    or newsletter sources to unsubscribe from.

    Args:
        account: Account name (e.g., "Gmail", "Work", "Personal")
        mailbox: Mailbox to analyse (default: "INBOX")
        days_back: How many days back to look (default: 30, 0 = all time)
        top_n: Number of top senders to return (default: 10)
        group_by_domain: Group results by domain instead of individual sender (default: False)

    Returns:
        Ranked list of senders (or domains) with email counts

What we checked

The same checks run on every server. Each line below has one of these marks:

FoundA published issue such as a risky tool or a CVE
PassedWe ran the check on this server and found nothing
After reviewChecked; we publish it once a person verifies it
Partly tracedRan, but the scanner could not follow every path to its end
FactWhat the code does, not a judgement either way
Not checkedThe scanner had nothing to read for it, or it needs the live server
Code Safetypartly traced
  • 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injection
    Checked on every scan. Results in this category are published only after a person has verified them.
Capability Exposure6.1
  • Runs programs the caller chooses
    No tool runs a command or program the caller supplies — 28 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Executes caller-supplied code
    No tool evaluates code the caller supplies — 28 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Reads or writes any file path
    No tool works on a file path the caller supplies without a root check — 28 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Requests any address
    No tool sends a request to an address the caller supplies — 28 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Runs caller-supplied SQL
    No tool executes a query the caller supplies — 28 tool handlers traced. Not every path could be followed, so this is not a clean pass.
  • Tools that start processes
    4 of 28 capabilities start processes; 24 more call code the scanner could not follow, where it may happen
  • Tools that touch files
    28 of 28 capabilities touch files
  • Tools that call the network
    Not seen in the traced code of 28 capabilities; 28 more call code the scanner could not follow, where it may happen
Where the code is: 28 handlers in 8 files at commit 0cd38a585a77
Prompt Integrity10.0
  • 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrity
    Checked on every scan. Results in this category are published only after a person has verified them.
Supply Chain5.3
  • Dependency manifests
    2 manifests: plugin/requirements.txt, pyproject.toml
  • Lockfiles checked against OSV
    1 file resolved and checked against the OSV database; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
  • Known vulnerabilities in production dependencies CRITICAL
    1 production package with known advisories
  • Known vulnerabilities in other dependencies
    No package used only for development, tests or examples has a known advisory
  • MCP SDK version
    fastmcp >=3.1.0
Secrets & Credentials10.0
  • 3 checks: credential harvesting, undeclared credential access, credentials sent over the network
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tools that read credentials
    Not seen in the traced code of 28 capabilities; 28 more call code the scanner could not follow, where it may happen
  • Authentication declared
    Not checked: needs the live server's tools/list (a remote server declares how clients authenticate)
Behavior Transparency10.0
  • 3 checks: undeclared network access, undeclared file access, undeclared process execution
    Checked on every scan. Results in this category are published only after a person has verified them.
  • Tool descriptions present
    Every tool has a description the model and the user can read (1 only in code no tool reaches)
  • Statically known names
    Every tool's name could be read from the code
  • Input schemas
    Not checked: needs the live server's tools/list (every tool declares an input schema)
  • Destructive tools annotated
    Not checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)

Dependencies with known vulnerabilities (1 in production)

Dependency ranges were not resolved against a lockfile, so the score is capped at 7.

PackageInstalledWorstAdvisoriesFixed in
fastmcpPyPI 3.1.0 CRITICAL 7 advisories 3.2.03.4.104.1.2
  • CRITICALGHSA-vv7q-7jx5-f767 CVE-2026-32871 PYSEC-2026-338FastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerability
  • HIGHGHSA-rww4-4w9c-7733 CVE-2026-27124 PYSEC-2026-2476FastMCP: Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities
  • MEDIUMPYSEC-2026-2476 CVE-2026-27124 GHSA-rww4-4w9c-7733FastMCP: Missing Consent Verification in OAuth Proxy Callback Facilitates Confused Deputy Vulnerabilities
  • MEDIUMGHSA-7xgj-8392-5q4rFastMCP: Post-transform component authorization is skipped on direct calls
  • MEDIUMPYSEC-2026-338 CVE-2026-32871 GHSA-vv7q-7jx5-f767FastMCP OpenAPI Provider has an SSRF & Path Traversal Vulnerability
  • MEDIUMPYSEC-2026-2475 CVE-2025-64340 GHSA-m8x7-r2rg-vh5gFastMCP has a Command Injection vulnerability - Gemini CLI
  • MEDIUMGHSA-m8x7-r2rg-vh5g CVE-2025-64340 PYSEC-2026-2475FastMCP has a Command Injection vulnerability - Gemini CLI

Past security advisories

Vulnerabilities published for this server itself, from the GitHub Advisory Database.

No security advisories have been published for this server in the GitHub Advisory Database.

How it runs

Where it runsOn your machine, started by your MCP client from this repository or its package
Transportnot stated in the code the scanner read; most local servers talk over stdio
Sign-innot checked needs the live server
MCP SDKfastmcp ==3.1.0, fastmcp >=3.1.0
Servers in the code2 (Apple Mail MCP, test)

The project's own security

Security policynone no SECURITY.md in the repository: report issues privately through GitHub if it is enabled
Past advisoriesnone in the GitHub Advisory Database
Last push2026-11-11
Signed releasesnot checked yet

Where it is published

Listed in3 catalogs (github_search, glama, mcp_toplist)
LicenseMIT
Created2025-10-14
Topicsai apple-mail applescript automation claude email fastmcp macos mcp mcp-server

Attack map

How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.

Request a scan or an audit

Tell us about your server. We reply within 5 working days.

What do you need? *

We use these details only to answer you.