Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Macos Mail Draft

БесплатноНе проверен

Creates email drafts in the macOS Mail app using AppleScript, with support for recipients, subject, body, attachments, and sender selection. No email is sent; d

GitHubEmbed

Описание

Creates email drafts in the macOS Mail app using AppleScript, with support for recipients, subject, body, attachments, and sender selection. No email is sent; drafts are saved locally and synced to the mail server by Mail.

README

An MCP (Model Context Protocol) server that creates email drafts in the macOS Mail app. The server itself runs locally: it drives Mail.app through AppleScript (osascript), opens no network services of its own, and handles no credentials — it never sends an email. Note, however, that Mail owns the draft once it is saved: if the target account is an IMAP, Exchange, or Gmail account (anything other than "On My Mac"), Mail syncs the draft — including its body and attachments — to that account's mail server, just as it would for any draft you create by hand.

Requirements

  • macOS with Mail.app configured with at least one account
  • Node.js >= 24 (runs the TypeScript source directly — there is no build step and no compiled artifacts; erasableSyntaxOnly keeps the source type-strippable)

Setup

npm install

Register with Claude Code

claude mcp add macos-mail-draft -- node /absolute/path/to/macos-mail-draft-mcp/src/index.ts

Register with Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "macos-mail-draft": {
      "command": "node",
      "args": ["/absolute/path/to/macos-mail-draft-mcp/src/index.ts"]
    }
  }
}

Automation permission

The first time a draft is created, macOS asks the host application (your terminal, Claude Desktop, etc.) for permission to control Mail. If a call fails with "Not authorized to send Apple events", grant access under System Settings > Privacy & Security > Automation.

Tool: create_mail_draft

Creates a draft in Mail's Drafts mailbox. No email is sent. If the draft is saved to a synced account (IMAP / Exchange / Gmail), Mail uploads it to that account's Drafts mailbox on the remote server.

Parameter Type Required Description
to array of address strings or {address, name} yes Primary recipients
subject string yes Subject line
body string yes Plain-text body
cc / bcc same shape as to no CC / BCC recipients
attachments array of absolute POSIX paths no Files to attach (a leading ~ is expanded; files must exist)
sender email address no Account address to send from; defaults to Mail's default account
openComposeWindow boolean no Open the draft in a compose window and bring Mail to the front (default on); false saves silently to Drafts. Attachments are only allowed with the compose window open, so the files being attached are visible for review.

Example call:

{
  "to": [{ "address": "[email protected]", "name": "Someone" }],
  "subject": "Quarterly report",
  "body": "Hi,\n\nDraft attached.\n\nJason",
  "attachments": ["~/Documents/report.pdf"]
}

Development

npm run dev          # run the server from source (tsx)
npm run check        # typecheck + lint + format check + tests
npm run test:watch   # vitest in watch mode

The AppleScript is generated from validated (zod) input, and every interpolated value is escaped for AppleScript string literals, so recipient names, subjects and bodies cannot break out into script code. Attachment paths are checked to be existing regular files before any script runs.

Known Mail quirks

  • Mail silently drops attachments if a draft is saved in the same instant they are added, so the generated script waits one second before saving.
  • After saving, the invisible compose session is closed (close ... saving no) so windows don't accumulate. Mail may still keep an inert entry in its scripting outgoing messages list until it is next restarted; this is harmless and invisible.
  • Rich text (HTML) bodies are not supported in v1: Mail's AppleScript dictionary cannot set HTML content on an outgoing message, and the available workarounds require GUI scripting via the clipboard.

from github.com/jasongwartz/macos-mail-draft-mcp

Установка Macos Mail Draft

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/jasongwartz/macos-mail-draft-mcp

FAQ

Macos Mail Draft MCP бесплатный?

Да, Macos Mail Draft MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Macos Mail Draft?

Нет, Macos Mail Draft работает без API-ключей и переменных окружения.

Macos Mail Draft — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Macos Mail Draft в Claude Desktop, Claude Code или Cursor?

Открой Macos Mail Draft на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Macos Mail Draft with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории communication