thunderbird-cli
Exposes Thunderbird's email capabilities as machine-readable API tools, allowing AI agents to interact with email data while Thunderbird manages all IMAP/SMTP credentials and account state.
thunderbird-cli
Give Claude (and other AI agents) full access to your email through Mozilla Thunderbird.
Why
IMAP libraries force you to manage credentials, OAuth flows, and sync state — dangerous in an AI-agent context. Thunderbird already solves all of that. This tool treats Thunderbird as the source of truth and exposes every capability as a CLI command or MCP tool, so AI agents can read, search, and write email without ever touching a password.
Tested at scale: 22 accounts, 249,000+ messages, 86,000+ unread — all managed live through a single CLI.
Related MCP server: Thunderbird MCP Server
Features
🔐 Zero credential exposure — all IMAP/SMTP stays in Thunderbird
🤖 Claude Desktop ready — 12 MCP tools, one-line config
📨 38 CLI commands — read, search, compose, reply, bulk ops, folder CRUD, attachments
🛡️ Safe by default — compose/reply/forward save as drafts; permanent delete requires
--confirm🎯 Token-optimized —
--fieldsselection,--compactmode,--max-bodytruncation🏠 Localhost-only — no cloud, no telemetry, nothing leaves your machine
✅ Thunderbird 128+ — signed and approved on addons.thunderbird.net
🧪 80 tests — 46 CLI/bridge + 34 MCP integration tests
Quick Start
# 1. Install CLI + bridge from npm
npm install -g thunderbird-cli thunderbird-cli-bridge
# 2. Install the signed Thunderbird extension
# Download: https://github.com/vitalio-sh/thunderbird-cli/releases/latest
# Thunderbird → Add-ons → ⚙ → Install Add-on From File… → thunderbird_ai_bridge-*.xpi
# 3. Start the bridge daemon (keep running)
tb-bridge
# 4. Try it
tb health
tb statsFull setup guide (including background service, Docker, troubleshooting): docs/SETUP.md
Usage
# How many unread across all accounts?
tb stats
# Find invoices from AWS in the last 30 days
tb search "invoice" --from aws --since 30d --fields id,author,subject,date
# Read a message (token-efficient — headers + text only, max 500 chars)
tb read 89900 --max-body 500
# Reply as draft (never auto-sends)
tb reply 89900 --body "Thanks, I'll review tomorrow"
# Download a PDF attachment
tb attachment-download 11 1.2 --output invoice.pdf
# Bulk archive old newsletters
tb bulk move "account1://INBOX" "account1://Archive" \
--from "newsletter@" --older-than 30Full command reference: docs/COMMANDS.md
Use with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"thunderbird": {
"command": "npx",
"args": ["-y", "thunderbird-cli-mcp"]
}
}
}Restart Claude Desktop. Now ask:
"How many unread emails do I have?" "Find invoices from AWS last month" "Reply to message 118 saying I'll attend — save as draft" "Download the PDF attachment from message 245"
Full MCP guide: mcp/README.md
Companion skill for Claude
A Claude Skill ships alongside the MCP server. It teaches Claude how to use the 12 email tools well — token-efficient field selection, draft-by-default safety, trust-metadata checking before acting on links, recipes for common workflows. Install it from skills/thunderbird-cli/:
# Claude Code
cp -r skills/thunderbird-cli ~/.claude/skills/
# Claude.ai — zip and upload via Settings → Capabilities → Skills
cd skills && zip -r thunderbird-cli.zip thunderbird-cliWithout the skill, the MCP still works. With it, Claude automatically uses the safest defaults and most efficient response shapes.
How It Works
Component | Role |
Extension ( | Thunderbird WebExtension. Calls |
Bridge ( | Stateless HTTP↔WebSocket proxy daemon. No business logic. |
CLI ( |
|
MCP ( |
|
Thunderbird is the source of truth. The CLI never caches or stores email data.
How this compares
Tool | Credentials | AI-agent ready | Compose / send | Multi-account | Runtime |
thunderbird-cli | stay in Thunderbird | ✅ CLI + MCP, JSON out | ✅ draft / open / send | ✅ any Thunderbird account | Node.js |
Raw IMAP libs (imapflow, imaplib) | you manage them | you wire it yourself | SMTP, separate | manual per account | varies |
via your MUA | CLI only, text output | ❌ reader only | via config | C | |
via your MUA | CLI only, sexp/text | ❌ reader only | via config | C | |
in config files | ✅ CLI, JSON out | ✅ | ✅ | Rust | |
in muttrc | ❌ interactive TUI | ✅ | via config | C |
The niche: you already trust Thunderbird with your credentials and account state. This tool surfaces that as a machine-readable API without asking you to re-configure IMAP/SMTP anywhere else.
Documentation
Doc | What's inside |
Installation, background service, Docker, troubleshooting | |
Full reference for all 38 CLI commands | |
AI-agent-focused quick reference + security rules | |
Companion Claude Skill — recipes, safety defaults, token patterns | |
Claude Desktop integration guide | |
Guide for AI agents editing this codebase | |
Full technical specification | |
Threat model, prompt-injection defenses | |
Dev setup, code style, PR process | |
Release notes |
Contributing
Contributions welcome. Please open an issue first to discuss non-trivial changes. See CONTRIBUTING.md for local dev setup and the 80-test suite.
License
MIT — see LICENSE
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Hosted email for AI agents: create inboxes, send, receive, and reply over MCP with scoped API keys
Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a Model Context Protocol interface for Mozilla Thunderbird, allowing AI assistants to manage emails, filters, calendars, and contacts. It exposes 24 tools for tasks like searching messages, drafting replies, and organizing folders through a local bridge.-
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to access Thunderbird email, contacts, and calendars through the Model Context Protocol, with tools for searching, reading, composing, and managing messages.3-
- AlicenseAqualityAmaintenanceEnables AI agents to control Thunderbird directly, including mail, folders, contacts, calendar, filters, and settings, through its own internals.501MIT
- AlicenseAqualityAmaintenanceYour real mailbox and calendar for your AI agent — Microsoft 365 via Graph or any IMAP — as 24 tools: read, search, attachments as text, sender history, drafting from identity and knowledge files, free-slot computation. Send, reply, delete and calendar writes need out-of-band human approval: the agent cannot approve its own actions.29142 PyPI8AGPL 3.0