Apple Mail MCP

v0.1.0
io.github.jayvee6/apple-mail-mcp Checked 3 days ago Published 7 months ago

LLM access to Apple Mail and iCloud via AppleScript.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_folders

List all mail accounts and their folders/mailboxes. Returns a tree of account → [mailbox names]. Use this to discover exact mailbox names before calling list_emails or search_emails.

list_emails

List emails in a specific mailbox with pagination. Returns message summaries including a message_ref that can be passed to get_email, reply_email, move_email, etc. Messages are returned newest-first (index 1 = most recent).

ParameterTypeDescription
account *stringAccount name, e.g. "iCloud" or "Google". Use list_folders to see available accounts.
mailbox *stringMailbox name, e.g. "INBOX", "Sent Messages". Must match exactly (case-sensitive).
limitintegerNumber of messages to return (max 100).
offsetinteger1-based offset for pagination. Start with 1.

get_email

Read the full content of a specific email including headers and body. The message_ref comes from list_emails or search_emails results.

ParameterTypeDescription
message_ref *stringComposite message reference in format "account::mailbox::rfc2822-id". Obtained from list_emails or search_emails results.

search_emails

Search for emails matching criteria across one or all mailboxes. Returns message summaries with message_ref fields for use with other tools. At least one filter (from_filter, subject_filter, after_date, before_date) should be provided.

ParameterTypeDescription
accountstringAccount to search, e.g. "iCloud". Use "ALL" to search all accounts. Defaults to "ALL".
after_datestringOnly return messages received after this date. ISO 8601 format: "YYYY-MM-DD".
before_datestringOnly return messages received before this date. ISO 8601 format: "YYYY-MM-DD".
from_filterstringSubstring match on sender name or address.
limitintegerMaximum number of results (max 100).
mailboxstringMailbox to search, e.g. "INBOX". Use "ALL" to search all mailboxes in the account. Defaults to "INBOX".
subject_filterstringSubstring match on subject line.

compose_email

Compose a new email. If send is false (default), opens the compose window with a draft. If send is true, sends immediately without confirmation.

ParameterTypeDescription
body *stringEmail body text.
subject *stringEmail subject line.
to *stringRecipient email address.
ccstringCC recipient email address (optional).
sendbooleanIf true, send immediately. If false (default), open compose window with draft.

reply_email

Reply to an existing email. If send is false (default), opens the reply in a compose window. If send is true, sends immediately without confirmation.

ParameterTypeDescription
body *stringReply body text.
message_ref *stringComposite message reference from list_emails or search_emails, e.g. "iCloud::INBOX::msg-id".
sendbooleanIf true, send immediately. If false (default), open compose window with reply draft.

move_email

Move an email to a different mailbox. Use list_folders to see available mailbox names.

ParameterTypeDescription
dest_account *stringDestination account name, e.g. "iCloud".
dest_mailbox *stringDestination mailbox name, e.g. "Finance & Accounts". Must match exactly (case-sensitive).
message_ref *stringComposite message reference from list_emails or search_emails.

archive_email

Move an email to the Archive mailbox of its account. Uses 'Archive' for iCloud, 'All Mail' for Gmail.

ParameterTypeDescription
message_ref *stringComposite message reference from list_emails or search_emails.

flag_email

Set or clear the flag on an email.

ParameterTypeDescription
flagged *booleanTrue to flag the message, false to unflag it.
message_ref *stringComposite message reference from list_emails or search_emails.

mark_read

Mark an email as read or unread.

ParameterTypeDescription
message_ref *stringComposite message reference from list_emails or search_emails.
read *booleanTrue to mark as read, false to mark as unread.

move_to_junk

Move an email to the Junk/Spam mailbox of its account. Uses 'Junk' for iCloud, 'Spam' for Gmail.

ParameterTypeDescription
message_ref *stringComposite message reference from list_emails or search_emails.

delete_email

Move an email to the Trash (Deleted Messages for iCloud, Trash for Gmail).

ParameterTypeDescription
message_ref *stringComposite message reference from list_emails or search_emails.

get_pending_events

Return and clear all real-time incoming mail events pushed by the MailKit extension. Returns an empty array if the extension is not installed or no new mail has arrived since the last call. Each event includes: subject, from, date, messageId, preview, receivedAt.