UC

u-c4n/thunderbird-mcp

Developer tools
6 stars 10 forks Quality 71 Trend 14MIT

An MCP server that lets an AI agent drive the Thunderbird already running on your machine — mail, folders, contacts, calendar, filters and settings — through Thunderbird's own internals.

Overview

An MCP server that lets an AI agent drive the Thunderbird already running on your machine — mail, folders, contacts, calendar, filters and settings — through Thunderbird's own internals.

README

Thunderbird MCP

An MCP server that lets an AI agent drive the Thunderbird already running on your machine — mail, folders, contacts, calendar, filters and settings — through Thunderbird’s own internals. Not a copy of your mailbox and not an IMAP client: the same Thunderbird you have open.

Built for Claude Code and Codex CLI, and able to serve both at once.

What is new in 1.4.0

  • Continue a saved draft. Read its current revision, edit the actual draft and send the reviewed version. User-owned compose windows remain untouched.
  • Preview, apply and undo a batch. Freeze a selection before changing flags, tags or moving mail within an account. Later user edits become conflicts.
  • Know what a search covered. Stable conversation/search pages carry coverage and truncation information; an unavailable index does not silently change the query.
  • Find possible follow-ups. Inspect outgoing conversations with no observed human reply, with header evidence and explicit limits.
  • Save selected attachments together. Preview filenames and sizes, then export without overwriting existing files.
  • Inspect uncertain work. Seven-day local operation history and runtime receipts replace blind retries after a lost reply. Event pages no longer skip buffered notifications.

Thunderbird 128 remains the minimum. Reading a saved draft works on 128.0; editing or sending it requires 128.4.3 or newer on the 128 ESR branch, or 133.0b3 or newer on the main release line.

See the workflow guide, validation results and changelog.

Quick start

git clone https://github.com/U-C4N/Thunderbird-MCP
cd Thunderbird-MCP
python bootstrap.py --clients claude-code,codex

One command builds the environment, installs the add-on (Thunderbird restarts once), registers the clients you name and verifies the chain. Re-running it is safe. Agents can parse python bootstrap.py --json instead of the human output.

Then ask your agent something — “what did the accountant say about VAT in June?”, “archive everything from newsletters older than a month”, “draft a reply to the last mail from Ali and let me read it first”.

Prefer to register a client by hand? tbmcp setup --print-config all prints the exact block for Claude Code, Codex, Claude Desktop, Cursor, VS Code, Gemini CLI and Zed. Use python -m tbmcp serve as the command, with an absolute interpreter path.

What you can do

Find ranked full-text search across every account, threads rebuilt across Inbox, Sent and archives, substring filters by folder, sender, date, tag
Triage preview and undo marks/tags and same-account moves; archive/copy/delete remain separate tools
Write create a draft, continue editing the saved version, then send with a revision check and confirmation
Follow up find possible unanswered outgoing conversations with evidence and coverage limits
Collect files freeze attachment selections and export with non-overwriting writes and per-file outcomes
Configure server ports and security, identities and signatures, SMTP servers, junk handling, ~5,700 preferences — every write reports the old value so it can be undone
Automate create, reorder and run message filters; events and tasks on the calendar
Diagnose tb_status, tb_diagnostics, tb_console and tbmcp doctor say what is wrong and what to do

Safety

Reads are unrestricted. Anything that sends, deletes or changes configuration needs confirm=true, carries destructiveHint, and prompts for approval on clients that support elicitation. mail_send drafts unless told mode="send"; dry_run_only previews a write; preference writes are allowlisted and credentials, proxy and security prefs are refused at both layers. --read-only registers no mutating tool at all.

Toolsets

Tools are grouped so an agent only pays context for what it uses. The default set is mail, folders, compose, search and admin; add the rest with --toolsets.

tbmcp serve --toolsets all              # everything
tbmcp serve --toolsets +calendar        # the default set plus one
tbmcp tools --toolsets all              # list what would be registered

124 tools across 10 toolsets; 54 of them read-only. Full signatures in docs/TOOL-REFERENCE.md.

How it works

  Claude Code ──stdio──▶ tbmcp serve ─┐
                                      ├─local RPC─▶ tbmcp daemon ◀══WebSocket══ add-on
  Codex CLI  ──stdio──▶ tbmcp serve ─┘              owns the socket,            inside
                                                    multiplexes clients      Thunderbird

Thunderbird has no external API, so an add-on runs inside it: the official MailExtension API for mail and folders, plus a WebExtension Experiment for what that API cannot reach (preferences, accounts, filters, calendar). Python listens on loopback and the add-on dials out with a token from /tbmcp-bridge.json, so nothing is bound inside Thunderbird and nothing leaves the machine. A small daemon owns the one connection and shares it between clients.

More in docs/ARCHITECTURE.md and docs/PROTOCOL.md.

When something is wrong

Run tbmcp doctor. It checks every link — Python, the profile, the add-on that is installed versus the one in this package, the daemon, the handshake from both sides — and names the broken one with the command that fixes it.

Symptom What to do
“Thunderbird is not connected” start Thunderbird; if it is running, tbmcp doctor says why the add-on has not attached
the add-on connects but never completes the handshake restart Thunderbird; doctor shows both views and the daemon log’s path
doctor warns the installed add-on is older than the package tbmcp install-addon
settings tools fail, mail tools work the privileged half did not load → tbmcp install-addon
full-text search finds nothing the global indexer is off (Settings → General), or search_global names the words the index cannot match
a dependency fails to load on Windows Windows Application Control blocked a wheel; python bootstrap.py repairs it

TBMCP_DEBUG=1 logs verbosely to stderr; TBMCP_STATE_DIR moves the daemon’s files; tb_console returns the add-on’s [tbmcp] lines as a tool.

Requirements

Thunderbird 128 or newer (verified on 155), Python 3.11–3.14, Windows, macOS or Linux including Snap and Flatpak Thunderbird.

Development

uv venv && uv pip install -e ".[dev]"
pytest                                  # no Thunderbird needed
node --test "tests/js/*.test.mjs"       # real add-on scripts under node:vm
ruff check . && ruff format --check .
python tools/check_consistency.py       # the three layers still agree
python tools/smoke_search.py            # live acceptance, against a running Thunderbird

The add-on’s real scripts run under node:vm against fakes of the WebExtension and XPCOM surfaces (tests/js), which is how the sandbox rules that broke 1.2.0’s search are caught before a release. Live workflow tests additionally use a separate profile and local-only mail services; see the release gate in the workflow guide. Historical measurements are in docs/VERIFIED-FINDINGS.md.

Author

GitHub @U-C4N · X @UEdizaslan

Related: Autocad-MCP · U-Pool · Deuz-SDK

Issues and pull requests are welcome. Report a security problem through GitHub rather than a public issue.

Licence

MIT — see LICENSE. The add-on contains no Mozilla-licensed code.

View the full README on GitHub

Install

This server does not publish a one-line install command.

Open the repository installation guide New to MCP? Start with the mcpskill.org guide →