Skip to main content
Glama
mail-mcp

mail-mcp

by p-l-ta

mail-mcp

macOSのMail.appへのフルアクセスをClaude(およびその他のMCPホスト)に提供するMCPサーバーです。Mail.appで設定されたすべてのアカウント(iCloud、Exchange、IMAPなど)にわたり、検索、読み取り、送信、返信、フラグ付け、移動などが可能です。

前提条件

  • macOS (Mail.appが必須)

  • Node.js 20以上

  • MCPホスト: Claude Desktop、Amazon Quick、または任意のstdio MCPクライアント

Related MCP server: Apple Mail MCP Server

インストール

Claude Desktop — ワンクリックインストール (推奨)

  1. 最新リリースから mail-mcp.dxt をダウンロードします

  2. .dxt ファイルをダブルクリックすると、Claude Desktopが自動的にインストールします

  3. 必要なmacOS権限を付与します(下記参照)

手動 / Amazon Quick / その他のホスト

npx @p-l-ta/mail-mcp

またはグローバルにインストールします:

npm install -g @p-l-ta/mail-mcp
mail-mcp

MCPホストで mail-mcp バイナリ(stdioトランスポート)を指定します。設定例:

{
  "mcpServers": {
    "mail-app": {
      "command": "npx",
      "args": ["@p-l-ta/mail-mcp"]
    }
  }
}

必要なmacOS権限

MCPホストを実行するアプリケーション(Claude Desktop、Amazon Quickなど)に以下の権限を付与してください:

権限

付与場所

フルディスクアクセス

システム設定 → プライバシーとセキュリティ → フルディスクアクセス

自動化 → メール

システム設定 → プライバシーとセキュリティ → 自動化

MCPサーバープロセスは、それを起動するホストアプリケーションから権限を継承します。

ツール

ツール

説明

search_emails

Envelope Indexデータベースを介して、豊富なフィルターでメッセージを検索

read_email

RFCメッセージIDを使用してメッセージの本文全体を読み取る

list_accounts_and_mailboxes

未読数を含む、設定されたすべてのアカウントとメールボックスを一覧表示

list_recent

特定のメールボックス内の最近のメッセージを一覧表示

list_senders

メッセージ数と未読数を含む送信者のグループ化された概要

send_email

設定されたアカウントのいずれかから新しいメールを送信

reply_to_email

RFCメッセージIDを使用して既存のメッセージに返信

set_message_flags

メッセージの既読またはフラグ付きステータスを設定

move_email

メッセージを別のメールボックスに移動

trash_email

メッセージを削除済みメッセージに移動

create_mailbox

アカウント内に新しいメールボックス/フォルダーを作成

bulk_mark_read

メールボックス内や特定の送信者からのすべてのメッセージを既読にする

get_unsubscribe_link

メッセージのヘッダーと本文から登録解除URLを抽出

empty_mailbox

メールボックス内のすべてのメッセージを一括削除(迷惑メール、ゴミ箱など)

仕組み

  • 検索と読み取り — Mail独自のEnvelope Index SQLiteデータベースを直接クエリし、すべてのアカウントにわたって高速で構造化された結果を取得します

  • アクション (送信、返信、フラグ付け、移動、ゴミ箱への移動) — Mail.appに対するAppleScript自動化によって実行されるため、メッセージがローカルファイルとして保存されていないアカウントでも機能します

開発

npm install
npm run dev          # tsx watch — live reload
npm test             # vitest unit tests
npm run build        # compile TypeScript → dist/
npm run dxt          # build Claude Desktop extension → build/mail-mcp.dxt

インタラクティブなMCPテスト:

npm run build
npx @modelcontextprotocol/inspector node dist/server.js

ライセンス

ISC

Available Tools

24 tools
bulk_applyA
Destructive

Apply one action (mark_read, mark_unread, flag, unflag, trash, or move) to a list of messages by RFC message-id, in a single batched call — far faster than calling set_message_flags/trash_email/move_email once per message.

Inputs: op (required), message_ids (required), destination_account, destination_mailbox.

bulk_flagA

Flag or unflag multiple messages in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then updates in a single batched AppleScript call.

Inputs: flagged (required), from, limit, account, +1 more.

bulk_mark_readA

Mark multiple messages as read in one call — by mailbox, sender substring, or both. Far faster than calling set_message_flags per message.

Inputs: from, account, mailbox.

bulk_moveA

Move multiple messages to a destination mailbox in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then moves in a single batched AppleScript call.

Inputs: destination_mailbox (required), from, limit, account, +2 more.

bulk_trashA
Destructive

Move multiple messages to trash in one call — by mailbox, sender substring, or both. Queries the Envelope Index for matching IDs then trashes in a single batched AppleScript call.

Inputs: from, limit, account, mailbox.

check_compatibilityA
Read-only

Probe each mail-mcp dependency (Envelope Index schema, SyncedRules.plist, AppleScript, MailData directory) and report pass/fail. Run this after a macOS update to verify nothing broke.

Inputs: no named parameters.

create_mailboxA

Create a new mailbox (folder) in a Mail.app account.

Inputs: name (required), account.

create_ruleA

Create a new Mail.app rule. A timestamped backup of SyncedRules.plist is made before writing. Mail.app may need to be restarted for the rule to take effect.

Inputs: name (required), actions (required), conditions (required), match_all.

delete_ruleA
Destructive

Permanently delete a Mail.app rule by its RuleId. A timestamped backup of SyncedRules.plist is made before writing so the deletion can be undone. Mail.app may need to be restarted for the change to take effect.

Inputs: rule_id (required).

empty_mailboxA
Destructive

Delete every message in a mailbox at once — moves to Deleted Messages, or permanently removes if the mailbox is already Deleted Messages/Trash. Use for Junk, Trash, or bulk-cleanup folders.

Inputs: mailbox_name (required), account.

list_accounts_and_mailboxesA
Read-only

List all configured Mail.app accounts and their mailboxes with unread counts.

Inputs: no named parameters.

list_recentB
Read-only

List recent messages in a mailbox of a specific account.

Inputs: account (required), limit, mailbox, unread_only.

list_rulesA
Read-only

List all Mail.app rules with their conditions and actions. Reads directly from SyncedRules.plist.

Inputs: no named parameters.

list_sendersA
Read-only

Return a grouped count of senders across mailboxes — who sends how many messages, how many are unread, and when the last arrived. By default excludes Deleted Messages, Junk, Sent, and Drafts so counts reflect live mail only. Ideal for identifying bulk senders and noise.

Inputs: limit, account, mailbox, include_system_mailboxes.

move_emailA

Move a message to a different mailbox by RFC message-id. Use list_accounts_and_mailboxes to get exact mailbox names.

Inputs: message_id (required), destination_mailbox (required), destination_account.

read_emailA
Read-only

Read full body of a message by its RFC message-id. Uses Mail.app via AppleScript so it works for IMAP/iCloud/Exchange messages without filesystem access.

Inputs: message_id (required).

reply_to_emailB
Destructive

Reply to an existing message identified by RFC message-id.

Inputs: body (required), message_id (required), reply_all.

search_emailsA
Read-only

Search Mail.app messages via the Envelope Index database. Returns rich metadata including RFC message-id (usable with read_email, reply_to_email, set_message_flags).

Inputs: from, limit, query, since, +3 more.

send_emailB
Destructive

Send a new email via Mail.app from an existing account.

Inputs: to (required), body (required), subject (required), cc, +1 more.

set_message_flagsB

Set read and/or flagged status on a message identified by RFC message-id.

Inputs: message_id (required), read, flagged.

submit_feedbackA

Open a pre-filled GitHub issue for mail-mcp (p-l-ta/mail-mcp) in the default browser. Automatically includes macOS version and mail-mcp version in the issue body.

Inputs: description (required), title.

trash_emailA
Destructive

Move a message to Deleted Messages (trash) by RFC message-id. Does not permanently delete.

Inputs: message_id (required).

update_ruleA

Update an existing Mail.app rule by its RuleId (use list_rules to find IDs). A timestamped backup is made before writing. Mail.app may need to be restarted for changes to take effect.

Inputs: rule_id (required), name, actions, match_all, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 24 tools

    Disambiguation4/5

    The tool purposes are mostly distinct, and descriptions clarify usage. The specialized bulk_* tools overlap with generic bulk_apply, but the query-based vs. ID-list distinction is clear. Overall, an agent can reliably select the right tool.

    Naming Consistency5/5

    All tools use a consistent snake_case verb_noun pattern, with bulk_ prefix uniformly marking batch operations. Minor deviations like list_recent are readable and don't disrupt the general convention.

    Tool Count3/5

    At 24 tools, the server is on the heavy side of the typical range. The bulk operations could be consolidated into fewer generic tools, but the broad scope justifies most of the count.

    Completeness4/5

    Core email workflows (send, read, reply, search, move, trash, flags) and full rule CRUD are covered. Missing mailbox update/delete and forward/draft operations are workable gaps rather than critical failures.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      An MCP server for Apple Mail that enables Claude to read, search, manage, and compose emails via AppleScript.
      20
      24 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A read-only MCP server that lets Claude Desktop interact with Apple Mail on macOS via AppleScript. It enables listing mailboxes, searching emails, and reading email content without making network calls.
      3
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      An MCP server that provides programmatic access to Apple Mail, enabling AI assistants like Claude to read, send, search, and manage emails on macOS.
      25
      MIT