The missing AI agent for Apple Mail. Apple Mail AI Plugin is a native macOS menu bar app that uses AI (Claude, GPT, Gemini) to help you write email replies in Apple Mail, and chat messages in Discord and WhatsApp.
Installation · Get Your API Key · Usage · Build from Source
The Apple Mail AI Plugin lives in your menu bar and connects directly to Apple Mail. When you're composing a reply, press Option + H to open the composer panel. Type a few thoughts about what you want to say, pick an AI model, and the app writes your reply — matching the language and tone of the conversation.
Switch it on for Discord, WhatsApp, or any other app and the same shortcut works there too: the app takes a screenshot of the chat window, sends it to the model as the conversation context, and puts the finished message into the chat box for you to review and send.
Bring your own API key. No accounts, no subscriptions, no middleman. Your key is stored in macOS Keychain and calls go directly to the provider.
- Menu bar app — stays out of your way until you need it
- Works with Apple Mail — reads your email thread, recipients, subject, and current draft
- Works in Discord, WhatsApp, and any app you add — opt-in per app: screenshots the chat window as context and inserts the message into the chat box, never sending it for you
- Multiple AI providers — Anthropic (Claude), OpenAI (GPT), Google Gemini, OpenRouter, and TrustedTokens (EU-sovereign)
- Local and custom servers — connect to local or remote OpenAI-compatible servers, with an optional API key
- Streaming responses — see the reply as it's being written
- Language matching — automatically replies in the same language as the conversation
- Keyboard shortcut — ⌥H (Option + H) to open from anywhere
- Secure key storage — API keys stored in macOS Keychain, never on disk
Requirements: macOS 14 (Sonoma) or later. On recent macOS versions, Mail's AppleScript interface no longer reliably exposes compose windows, so the app can optionally use the Accessibility API to read your draft — grant Accessibility permission when the in-app banner suggests it (System Settings → Privacy & Security → Accessibility). The banner is dismissible; a blank new-message compose keeps working without it.
Composing from a screenshot is off for every app until you enable it under Settings → General → Compose from a Screenshot, so using only Mail never asks for extra permissions. Enabled apps additionally need Screen Recording permission (System Settings → Privacy & Security → Screen & System Audio Recording) so the app can screenshot the chat window, and Accessibility so it can type the result into the chat box. macOS applies a new Screen Recording grant after the app relaunches. Without Screen Recording the message is written from your notes alone; without Accessibility it is copied to the clipboard for you to paste.
Grab the latest .dmg from the Webpage.
The Apple Mail AI Plugin calls AI providers directly. Add a provider API key or connect to a local or custom server below:
- Go to console.anthropic.com
- Sign up or log in
- Navigate to API Keys in the sidebar
- Click Create Key, give it a name, and copy the key
- Go to platform.openai.com
- Sign up or log in
- Navigate to API Keys in the sidebar
- Click Create new secret key, name it, and copy the key
- Go to aistudio.google.com/apikey
- Sign in with your Google account
- Click Create API Key, select a project (or create one), and copy the key
- Go to openrouter.ai
- Sign up or log in
- Navigate to Keys in the sidebar
- Click Create Key, name it, and copy the key
Tip: OpenRouter gives you access to models from many providers through a single key. Great if you want to try different models without managing multiple accounts.
If OpenRouter reports a model training violation (account settings), your account's privacy policy has excluded the available providers for that model. Choose another model, or open OpenRouter privacy settings and allow routing to providers that may train on your data for the affected category (paid or free models). The app links to these settings from Settings → Models → API Keys and from the error message. The app sends no additional guardrail restrictions; OpenRouter account policies apply independently of TrustedTokens and cannot be disabled with an app setting. See OpenRouter's provider policy documentation.
- Go to trustedtokens.eu
- Sign up for a free trial
- Open Account to find your API token
- Copy the token
Tip: TrustedTokens is an EU-sovereign, OpenAI-compatible gateway hosted in Germany — all data processed in the EU. The app fetches model IDs automatically and sends the selected ID unchanged. Default-provider entries use a bare model ID (e.g.
zai-org/GLM-5.3); provider-specific entries include a routing prefix (e.g.skainet/zai-org/GLM-5.3). See the TrustedTokens API documentation for details.
- Open Settings → Models
- Enter your server's base URL in Local AI URL, for example
http://localhost:1234(LM Studio),http://localhost:11434(Ollama), orhttps://llm.example.com(remote server). The app appends/v1/modelsand/v1/chat/completions, so omit those paths from the base URL. - If your server requires authentication, enter its key in Local AI API key. This supports servers such as vLLM configured with an API key. Leave the field empty for servers without authentication.
- Settings save automatically and the app loads your server's models. Select one to start composing.
The optional key is stored in macOS Keychain and sent as a Bearer token for both model loading and reply generation. Clear the key field to remove authentication.
- Click the Apple Mail AI Plugin icon in your menu bar
- Open Settings
- Paste your API key for the provider you chose
- The app will automatically fetch available models from that provider
- Open Apple Mail and start composing a reply
- Press ⌥H (Option + H) to open the composer panel
- Type a few words describing what you want to say (e.g. "sounds good, let's meet thursday")
- Pick a model from the dropdown
- Hit Generate — the reply streams into your compose window
The app reads the full email thread for context, so the generated reply stays relevant to the conversation.
- In Settings → General → Compose from a Screenshot, switch on Discord or WhatsApp, or click Add App… to pick any other app (Slack, Telegram, Messages, …)
- Open a conversation in that app and make it the active app
- Press ⌥H (or your shortcut) — the app screenshots the chat window and opens the composer next to it, with a thumbnail of what the model will see
- Type what you want to say and hit Generate
- Click Insert into Discord (or the app's name) — the message lands in the chat box, unsent, so you can read it over before pressing Enter
Pick a vision-capable model for this (for example a current Claude, GPT, or Gemini model); text-only models reject the screenshot. Summarize chat gives you a TL;DR of the visible conversation instead. Switch an app off again and the shortcut goes back to the Mail flow there. The list is stored with your other settings and kept across updates.
git clone https://github.com/jpwahle/aimail.git
cd aimail
make build
make runOpen AIMailComposer.xcodeproj and hit Run — the shared AIMailComposer
scheme builds and launches the app bundle directly (requires Xcode 16 or
later). The project uses a synchronized folder reference, so new source
files added under AIMailComposer/ are picked up automatically.
| Command | Description |
|---|---|
make build |
Debug build |
make run |
Build and launch the app |
make release |
Optimized release build |
make sign |
Code sign (ad-hoc or with SIGNING_IDENTITY) |
make dmg |
Create a .dmg installer |
make install |
Install to /Applications |
make clean |
Remove build artifacts |
make notarize \
SIGNING_IDENTITY="Developer ID Application: ..." \
APPLE_ID=you@example.com \
TEAM_ID=ABC123- API keys are stored in macOS Keychain — never written to disk as plain text
- Email content is sent directly to your chosen AI provider and nowhere else
- No analytics, no telemetry, no data collection