# imdinu/apple-mail-mcp [Health: Active]

**Category:** 💬 Communication  
**Repository:** https://github.com/imdinu/apple-mail-mcp  
**GitHub Stars:** 78  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/imdinu-apple-mail-mcp

## Description
Fast MCP server for Apple Mail — 87x faster email fetching via batch JXA and FTS5 search index for 2ms body search. 6 tools: list accounts/mailboxes, get emails with filters, full-text search across all scopes, and attachment extraction.

## Tools
Capabilities this server exposes over MCP:

- **list_accounts** — List all configured email accounts in Apple Mail.

Returns:
    List of account dictionaries with 'name' and 'id' fields.

Example:
    >>> list_accounts()
    [{"name": "Work", "id": "abc123"}, {"name": "Personal", "id": "def456"}]
- **list_mailboxes** — List all mailboxes for an email account.
- **get_emails** — Get emails from a specific mailbox with optional filtering.

Note: This tool lists emails from a single mailbox. To search
across all mailboxes, use the search() tool instead.
- **get_email** — Get a single email with full content.

Looks up the email across all accounts using a cascade strategy.
Just pass the message_id — account/mailbox are optional hints
that speed up lookup but are not required.
- **get_email_links** — Extract hyperlinks from an email's HTML content.

Filters out mailto:, javascript:, and long tracking URLs.
Returns deduplicated links with their anchor text.

Requires the search index.
- **get_email_attachment** — Extract a file attachment from an email and save to disk.

Saves the attachment under ~/.apple-mail-mcp/attachments/.
Parses the raw MIME structure, so it works for all attachment
types including inline images and S/MIME signatures.

Requires the search index.
- **get_attachment** — DEPRECATED: Use get_email_attachment() or get_email_links().

Extract resources from an email: attachments or links.
Delegates to get_email_links (filename omitted) or
get_email_attachment (filename provided).
- **search** — Search emails across all accounts and mailboxes.

Uses full-text search index for fast results (~2ms). All scopes
search across every account and mailbox unless filtered.

Query tips:
- Use 2-3 specific keywords, not full sentences
- Terms are AND-ed: "budget Q1" finds emails with BOTH words
- Use quotes for exact phrases: '"quarterly report"'
- Prefix search: "meet*" matches meeting, meetings, etc.
- The default scope "all" searches subject + sender + body together

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "apple-mail-mcp": {
    "command": "uvx",
    "args": ["apple-mail-mcp"]
  }
}
```

## Documentation

## What imdinu/apple-mail-mcp does

imdinu/apple-mail-mcp exposes Apple Mail data through the Model Context Protocol on macOS. It supports account and mailbox discovery, message listing, individual message retrieval, full-text search, hyperlink extraction, and attachment extraction. The server also provides equivalent standalone CLI commands, so the package can be used without an MCP client.

Search covers the indexed mailbox rather than only the newest messages. Queries can target all searchable content or narrower scopes such as subject, sender, body, or attachments. Results can also be constrained by dates, and the search syntax supports quoted phrases, prefix matching, and terms that are combined with AND semantics.

## How it works

The server uses an FTS5 index for email search and reads Apple Mail's local data directly for several operations. Individual messages use disk-first `.emlx` reads, while account, mailbox, and listing operations use direct Envelope-Index SQLite access with JXA available as a fallback. The index is intended to cover the full mailbox and can be refreshed by running the server with `--watch`.

`get_email` accepts a message ID and can search across accounts. Account and mailbox hints are optional; supplying them can make lookup faster. Link and attachment extraction depend on the search index. Attachments are parsed from the raw MIME structure and written to `~/.apple-mail-mcp/attachments/`.

## Setup and configuration

The package requires macOS and Python 3.11 or newer. Install it for general MCP use with:

```bash
pipx install apple-mail-mcp
```

Then register the stdio command in an MCP client:

```json
{
  "mcpServers": {
    "mail": {
      "command": "apple-mail-mcp"
    }
  }
}
```

Claude Code can install it as a plugin, while Claude Desktop can use the downloadable MCP bundle from the project's latest release. Both launch paths support `--watch`. The launching application needs Full Disk Access so the index can remain current; Terminal needs that permission when building the index manually.

Create the optional configuration template with `apple-mail-mcp init`. Settings can be stored in `~/.apple-mail-mcp/config.toml` or supplied through matching `APPLE_MAIL_*` environment variables. Configuration supports defaults such as a primary account or mailbox, with command-line, environment, file, and default values applied by precedence.

Build the recommended index with:

```bash
apple-mail-mcp index --verbose
```

## Tools and capabilities

- `list_accounts`: returns configured Apple Mail accounts.
- `list_mailboxes`: lists mailboxes for an account.
- `get_emails`: lists messages from one mailbox with filters such as unread, flagged, today, or the last seven days.
- `get_email`: retrieves one message with its full content and attachments.
- `search`: searches indexed messages across accounts and mailboxes, with scope and date filters.
- `get_email_links`: extracts deduplicated non-mailto and non-javascript hyperlinks with anchor text.
- `get_email_attachment`: saves a named attachment to the local attachment directory.
- `get_attachment`: legacy extraction entry point; use the link or attachment-specific tools instead.

## Limitations and notes

This server is tied to Apple Mail and macOS. Cross-mailbox searching requires the index, as do link and attachment extraction. `get_emails` operates on one mailbox at a time; use `search` for a query spanning accounts and mailboxes. Attachment extraction writes files to the local filesystem, and the older `get_attachment` tool is deprecated.

_Full upstream README: https://allmcps.com/mcp/imdinu-apple-mail-mcp/readme_

