Skip to content

The CLI for your email.

A programmable, agent-native email client that works across every provider. One binary. Full CLI. Hackable with any language you already use.

Homebrew

Terminal window
brew tap planetaryescape/mxr
brew install mxr

crates.io

Terminal window
cargo install mxr

Pre-built binaries

macOS (Intel + Apple Silicon) and Linux x86_64.

Download latest release ->

If you want current main instead of the latest release:

Terminal window
git clone https://github.com/planetaryescape/mxr
cd mxr
cargo install --path . --locked

Works with Gmail, IMAP, and SMTP out of the box. One local database, one CLI, all your accounts.

Tools like gog and Google Workspace CLI give you a CLI for email — but only if you use Google. What if you’re on Fastmail? Or your company’s Exchange server? Or you have a Gmail personal account and an IMAP work account? There’s nothing that works across providers with the same power.

mxr is that tool. One binary that syncs Gmail, IMAP, and SMTP into one local database. One CLI that can search, compose, reply, label, archive, snooze, unsubscribe, and export across all your accounts. One interface your scripts and agents can talk to, regardless of what provider sits behind it.

Not a wrapper around provider APIs. Not a DSL you have to learn. A real CLI with --format json, --dry-run, --search for batch operations, and every output piped through stdout. Hack it with Python, Bash, Go, TypeScript — whatever you already use.

Gmail / IMAP / SMTP
|
v
daemon
/ \
SQLite Tantivy
/ | \
CLI TUI agents

Your coding agent can already write code, run tests, and commit to git. Now it can manage your email too. Install the mxr skill and ask:

“Go through my unread emails from the last 24 hours. For each one, tell me who it’s from, one-line summary, and whether it needs a response. Draft replies for anything urgent."
"Find all emails from our CI system that are build failures. Extract the failing test names, cross-reference with my recent commits, and archive the ones that have since been fixed."
"I’m prepping for my 1-on-1 with Sarah. Pull up all email threads between us from the last two weeks, summarize the open items, and draft an agenda."
"Export the thread about the Q2 roadmap as markdown, summarize the key decisions, and create a TODO list from the action items."
"Search my inbox for recurring newsletters I haven’t opened in 3 months. Show me the list, and unsubscribe from the ones I confirm.”

This works because mxr isn’t a GUI with an API bolted on. The CLI is the interface. Every operation supports structured JSON output, safe dry-runs, and batch operations via search queries. Your agent doesn’t need screen scraping, browser automation, or a provider-specific SDK — just mxr.

Today, agents use mxr through the CLI and the skill guide. A first-party MCP server is still on the roadmap.

<50msSearch across 10k+ messages
0msOpen any message (local SQLite)
InstantStart composing (your $EDITOR)

mxr syncs your email to a local SQLite database and indexes it with Tantivy — the same engine behind Quickwit. Opening a message is a local read, not a network call. Search uses BM25 ranking with field-level boosts, plus optional local semantic retrieval when you enable it. Works offline. Your data lives on your machine. No spinners. No loading states.

Compose in your editor

$EDITOR opens with markdown and YAML frontmatter. Your keybindings, your plugins, your muscle memory. mxr handles parsing, markdown-to-multipart conversion, and sending.

Real search engine

Tantivy gives you BM25-ranked, sub-second full-text search across your entire mailbox. You can keep it lexical or opt into local hybrid/semantic retrieval. Saved searches live in the sidebar as programmable lenses. Search is navigation, not a bolt-on filter.

Daemon-backed

The daemon is the system. The TUI is just a thin client. Sync, indexing, rules, and snooze run in the background. Close the TUI — nothing stops.

Provider-agnostic

Gmail, IMAP, SMTP — all normalize into one internal model. Mix providers freely. Add new ones with a clean Rust trait. The conformance suite validates your adapter.

Distraction-free

Reader mode strips tracking pixels, banners, signatures, and quoted text. You see what the email says, not what it’s selling you. One key to unsubscribe.

Build your own client

The daemon speaks JSON over a Unix socket. The TUI is just one client. Build a web dashboard, a mobile bridge, a Raycast extension — anything that can open a socket.

mxr grows out of work that earlier tools already proved mattered. mutt and neomutt showed how good keyboard mail can feel. aerc pushed the terminal UI forward. himalaya made the CLI feel cleaner. notmuch made local indexing hard to ignore. gog and gws made Gmail scripting practical.

gog / gwcnotmuchmuttaerchimalayamelimxr
Works beyond Googlenoyesyesyesyesyesyes
Full CLI for every actionpartialsearch onlynonoyesnoyes
JSON output for scriptingyesyesnonopartialnoyes
Compose and send from CLIpartialnononoyesnoyes
Batch operations via searchnotag onlynonononoyes
Daemon architecturenonononononoyes
Local databasenoXapiannononooptionalSQLite
Full-text search enginenoyesnononooptionalyes
Compose in $EDITORnovia Emacspartialpartialyesnoyes
Markdown to multipartnonononononoyes
One-key unsubscribenonononononoyes
Rules with dry-runnonoprocmailnononoyes
Pluggable provider adaptersnononopartialpartialnoyes
Custom client supportnoyesnonononoyes

More detail, including capability matrices, lives on Why mxr.

mxr is MIT / Apache-2.0 dual-licensed. The entire codebase is open. Built with Rust — one binary, no runtime, runs on every platform. No telemetry, no analytics, no “phone home.”

The architecture is designed for contribution: clean crate boundaries, compile-time checked SQL, a conformance test suite for provider adapters, and thorough documentation. Whether it’s a bug fix, a new provider adapter, a CLI improvement, or an idea — we want to hear from you.