macos-mail-draft-mcp
Allows creating email drafts in the macOS Mail app, supporting recipients, subject, body, attachments, sender selection, and optional compose window opening.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@macos-mail-draft-mcpdraft an email to jane@example.com with subject 'Meeting' and body 'See you at 3pm'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
macos-mail-draft-mcp
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;
erasableSyntaxOnlykeeps the source type-strippable)
Related MCP server: mcp-mac
Setup
npm installRegister with Claude Code
claude mcp add macos-mail-draft -- node /absolute/path/to/macos-mail-draft-mcp/src/index.tsRegister 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 |
| array of address strings or | yes | Primary recipients |
| string | yes | Subject line |
| string | yes | Plain-text body |
| same shape as | no | CC / BCC recipients |
| array of absolute POSIX paths | no | Files to attach (a leading |
| email address | no | Account address to send from; defaults to Mail's default account |
| boolean | no | Open the draft in a compose window and bring Mail to the front (default on); |
Example call:
{
"to": [{ "address": "someone@example.com", "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 modeThe 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 scriptingoutgoing messageslist 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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jasongwartz/macos-mail-draft-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server