Skip to content

About

A plugin for Apple Mail to compose answers with different AI models with your own key.

Resources

Stars

14 stars

Watchers

1 watching

Forks

Repository files navigation

Apple Mail AI Plugin logo

Apple Mail AI Plugin

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.

Features

  • 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

Installation

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.

Download

Grab the latest .dmg from the Webpage.

Get Your API Key

The Apple Mail AI Plugin calls AI providers directly. Add a provider API key or connect to a local or custom server below:

Anthropic (Claude)

  1. Go to console.anthropic.com
  2. Sign up or log in
  3. Navigate to API Keys in the sidebar
  4. Click Create Key, give it a name, and copy the key

OpenAI (GPT)

  1. Go to platform.openai.com
  2. Sign up or log in
  3. Navigate to API Keys in the sidebar
  4. Click Create new secret key, name it, and copy the key

Google Gemini

  1. Go to aistudio.google.com/apikey
  2. Sign in with your Google account
  3. Click Create API Key, select a project (or create one), and copy the key

OpenRouter

  1. Go to openrouter.ai
  2. Sign up or log in
  3. Navigate to Keys in the sidebar
  4. 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.

TrustedTokens

  1. Go to trustedtokens.eu
  2. Sign up for a free trial
  3. Open Account to find your API token
  4. 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.

Local or Custom OpenAI-Compatible Server

  1. Open Settings → Models
  2. Enter your server's base URL in Local AI URL, for example http://localhost:1234 (LM Studio), http://localhost:11434 (Ollama), or https://llm.example.com (remote server). The app appends /v1/models and /v1/chat/completions, so omit those paths from the base URL.
  3. 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.
  4. 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.

Add Your Key to the App

  1. Click the Apple Mail AI Plugin icon in your menu bar
  2. Open Settings
  3. Paste your API key for the provider you chose
  4. The app will automatically fetch available models from that provider

Usage

  1. Open Apple Mail and start composing a reply
  2. Press ⌥H (Option + H) to open the composer panel
  3. Type a few words describing what you want to say (e.g. "sounds good, let's meet thursday")
  4. Pick a model from the dropdown
  5. 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.

Discord, WhatsApp, and other apps

  1. In Settings → General → Compose from a Screenshot, switch on Discord or WhatsApp, or click Add App… to pick any other app (Slack, Telegram, Messages, …)
  2. Open a conversation in that app and make it the active app
  3. 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
  4. Type what you want to say and hit Generate
  5. 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.

Building from Source

git clone https://github.com/jpwahle/aimail.git
cd aimail
make build
make run

Developing in Xcode

Open 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.

Available Make Targets

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

Notarization (for distribution)

make notarize \
  SIGNING_IDENTITY="Developer ID Application: ..." \
  APPLE_ID=you@example.com \
  TEAM_ID=ABC123

Privacy

  • 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

License

MIT

About

A plugin for Apple Mail to compose answers with different AI models with your own key.

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages