thunderbird-mcp

thunderbird-mcp

Enables searching and reading Thunderbird emails locally through MCP, using the mail client's own index for offline, credential-free access.

Category
Visit Server

README

thunderbird-mcp

CI Python 3.11+ License: MIT

A read-only MCP server that lets an LLM search and read your Thunderbird email — locally, with no IMAP connection and no credentials.

It works by querying Thunderbird's own full-text index (GLODA, the global-messages-db.sqlite that Thunderbird already maintains). The server takes an atomic snapshot of that database and exposes a handful of focused tools to any MCP client: Claude Desktop, Claude Code, or the Agent SDK.

You:  "What did the vendor say about the shipment quote last month?"
LLM:  → tb_search(query="shipment quote", since="2024-01-01")
      → tb_thread(conversation_id=…)
      "They approved it on Jan 11 and attached po.pdf. Here's the thread…"

Why

Most "email + LLM" integrations log into your IMAP server, re-download everything, and need an app password. This one doesn't move any mail or hold any secret. Thunderbird has already indexed every message you have — including local folders and archived accounts — so the fastest, safest path is to read that index directly.

  • No credentials. Nothing to configure, nothing to leak. Read-only by design.
  • Offline. Searches your local index; works on a plane.
  • Whole history. Every account and local folder Thunderbird knows about, in one place.
  • Cross-platform. Auto-detects your profile on Linux, macOS and Windows (including running under WSL against a Windows install).

Tools

Tool What it does
tb_search(query, since, until, from_addr, to_addr, account, folder, limit) Full-text + header + date search, newest first
tb_recent_by_address(email_or_domain, limit) Every message to/from a contact or domain
tb_thread(conversation_id, body_chars) A full conversation, oldest first
tb_get_message(message_id, body_chars) One message with its complete body
tb_folders() All folders with per-folder message counts
tb_list_accounts() Configured accounts and their IMAP servers
tb_stats() Total indexed messages and their date range

Install

Requires Python 3.11+ and a local Thunderbird install.

git clone https://github.com/agimenez-dev/thunderbird-mcp
cd thunderbird-mcp
uv sync          # or: pip install -e .

Use with Claude Desktop / Claude Code

Add the server to your MCP config (claude_desktop_config.json, or .mcp.json for Claude Code):

{
  "mcpServers": {
    "thunderbird": {
      "command": "uv",
      "args": ["--directory", "/path/to/thunderbird-mcp", "run", "thunderbird-mcp"]
    }
  }
}

Restart the client and ask it about your mail.

Configuration

The server auto-detects the default Thunderbird profile. Override it when Thunderbird lives elsewhere — for example, querying a Windows install from WSL:

export THUNDERBIRD_PROFILE="/mnt/c/Users/You/AppData/Roaming/Thunderbird/Profiles/xxxx.default-release"

THUNDERBIRD_PROFILE must point at the profile directory — the folder that contains global-messages-db.sqlite.

How it works

Thunderbird
  └─ <profile>/global-messages-db.sqlite   (GLODA full-text index, WAL mode)
          │
          │  snapshot.py — SQLite online-backup API (read-only + immutable),
          │  atomic publish, retries on lock. Refreshes lazily (>15 min old).
          ▼
  ~/.cache/thunderbird-mcp/snapshot.sqlite  (read-only copy)
          │
          │  db.py — LIKE queries over messagesText_content
          ▼
  server.py — FastMCP, 7 tools

Two implementation notes worth knowing:

  • Why a snapshot? Thunderbird keeps the index open in WAL mode. Reading it live risks a database is locked error or an inconsistent read, so the server copies it with SQLite's online-backup API before querying — never touching the original.
  • Why LIKE instead of FTS? GLODA's full-text table uses a custom mozporter tokenizer that isn't compiled into a standard Python sqlite3. Rather than ship a patched SQLite, the server queries the precomputed text columns GLODA already maintains (c0body, c1subject, …) with LIKE.

What it deliberately does not do

  • Send, move, delete or modify mail. Read-only, full stop.
  • Touch IMAP or store any credential.
  • Re-index. It trusts the index Thunderbird already keeps current.
  • Return attachment binaries — only their file names.

Development

uv sync --extra dev
uv run pytest        # query + parsing layers are covered without Thunderbird installed
uv run ruff check .

License

MIT — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured