Логотип Thunderbird MCP

Thunderbird MCP

Спільнота
TKasperczyk

MCP server for Thunderbird - enables AI assistants to access email, contacts, and calendars

ВидавецьTKasperczyk
Репозиторійthunderbird-mcp
МоваJavaScript
Форки
101
Зірки
337
Доступні інструменти
35
Тип транспортуstdio
Категорії
Посилання
  • Підключайте інструменти до робочих процесів із ШІ

    Thunderbird MCP надає можливості MCP, які можуть використовувати сумісні клієнтські ШІ-застосунки та агенти.

  • Доступні інструменти: 35

    Перегляньте нижче дії, які можна викликати, з назвами й описами, якщо сервер їх надає.

  • Готова конфігурація для копіювання

    Скористайтеся прикладами конфігурації, щоб налаштувати цей сервер у вибраному клієнті MCP.

  • Показники інтересу до відкритого коду

    Зірки: 337, форки: 101 — у пов’язаному репозиторії.

Thunderbird MCP

CI Tools Localhost Only Thunderbird License: MIT

Give your AI assistant full access to Thunderbird -- search mail, compose messages, manage filters, and organize your inbox. All through the Model Context Protocol.

Inspired by bb1/thunderbird-mcp. Rewritten from scratch with a bundled HTTP server, proper MIME decoding, and UTF-8 handling throughout.


Why?

Thunderbird has no official API for AI tools. Your AI assistant can't read your email, can't help you draft replies, can't organize your inbox. This extension fixes that -- it exposes 40 tools over MCP so any compatible AI (Claude, GPT, local models) can work with your mail the way you'd expect.

Mail sends and event/task creation require review by default because Block skipReview starts enabled. skipReview: true is honored only after you explicitly disable that safety setting. By default, nothing is sent or created without your review.


How it works

                    stdio              HTTP (localhost:8765-8774)
  MCP Client  <----------->  Bridge  <--------------------->  Thunderbird
  (Claude, etc.)           mcp-bridge.cjs                    Extension + HTTP Server

The Thunderbird extension embeds a local HTTP server with session-scoped auth tokens. The Node.js bridge translates between MCP's stdio protocol and HTTP, discovering the port and token automatically via a connection file. The bridge handles MCP lifecycle methods (initialize, ping) locally, so clients can connect even before Thunderbird is fully loaded.


What you can do

Mail

ToolDescription
listAccountsList all email accounts and their identities
listFoldersBrowse folder tree with message counts -- filter by account or subtree
searchMessagesSearch by subject, sender, recipient, body preview, date range, or tags. Multi-word queries are AND-of-tokens (every word must appear somewhere). Prefix with from:, subject:, to:, or cc: to restrict to one field. Set searchBody: true for full-text body search via Thunderbird's Gloda index. Supports includeSubfolders, countOnly, and offset-based pagination. Results include threadId and preview snippet. By default, dedupByMessageId collapses the same RFC Message-ID found in multiple folders/labels into one row and reports the other folder paths in dupLocations; set dedupByMessageId: false to return every location.
getMessageRead full email content -- bodyFormat: markdown (default), text, or html. Set rawSource: true for the complete RFC 2822 source (all headers + MIME parts). Optional attachment saving. Set includeInlineImages: true to append supported inline CID images as MCP image blocks (PNG, JPEG, GIF, or WebP; max 1 MiB base64 per image and 4 MiB total). Skipped images are reported in attachment metadata.
getMessagesRead full email content for up to the configured batch limit in one call (default 10, max 20). Uses the same bodyFormat, rawSource, and attachment options as getMessage; each item supplies messageId and folderPath.
getRecentMessagesGet recent messages with date, unread, and tag filtering. Supports pagination. Results include threadId and preview.
displayMessageOpen a message in Thunderbird's GUI -- 3pane (default), tab, or window mode
updateMessageMark read/unread, flag/unflag, add/remove tags, move between folders, or trash -- supports bulk via messageIds
deleteMessagesDelete messages -- drafts are safely moved to Trash
createFolderCreate new subfolders to organize your mail
renameFolderRename an existing mail folder
deleteFolderDelete a folder (moves to Trash, or permanently deletes if already in Trash)
moveFolderMove a folder to a new parent within the same account
emptyTrashPermanently delete all messages in Trash (including subfolders)
emptyJunkPermanently delete all messages in Junk/Spam (including subfolders)

Compose

ToolDescription
sendMailCompose a new email -- opens a review window; direct sending requires explicitly disabling the skipReview safety block
replyToMessageReply with quoted original and proper threading -- skipReview is subject to the same safety block
forwardMessageForward with all original attachments preserved -- skipReview is subject to the same safety block

All compose tools open a window for you to review and edit before sending by default. The Block skipReview preference is on by default, so skipReview: true is rejected until you explicitly disable the preference; only then can it send directly. Attachments can be file paths or inline base64 objects.

Compose tools validate the from identity strictly -- if the specified sender doesn't match any configured Thunderbird identity, the tool returns an error instead of silently substituting another account.

Filters

ToolDescription
listFiltersList all filter rules with human-readable conditions and actions
createFilterCreate filters with structured conditions (from, subject, date...) and actions (move, tag, flag...)
updateFilterModify a filter's name, enabled state, conditions, or actions
deleteFilterRemove a filter by index
reorderFiltersChange filter execution priority
applyFiltersRun filters on a folder on demand -- let your AI organize your inbox

Full control over Thunderbird's message filters. Changes persist immediately. Your AI can create sorting rules, adjust priorities, and run them on existing mail.

Contacts

ToolDescription
searchContactsSearch contacts across all address books by email or name and return full contact details. Supports maxResults.
getContactRead full contact details by UID
createContactCreate a contact with optional email/name, phones, postal addresses, organization, title, note, and birthday. Phone-only contacts are supported.
updateContactUpdate contact fields; omitted fields stay unchanged, while empty phone/address arrays clear those collections
deleteContactDelete a contact by UID

Calendar

ToolDescription
listCalendarsList all calendars with read-only, event, and task support flags
createEventCreate a calendar event -- opens a review dialog; direct creation via skipReview requires explicitly disabling the default safety block. Accepts status: tentative | confirmed | cancelled (VEVENT STATUS per iCal RFC 5545).
listEventsQuery events by date range with recurring event expansion. Returns status on each event.
updateEventModify an event's title, dates, location, description, or status
deleteEventDelete a calendar event by ID
createTaskOpen a pre-filled task dialog for review; direct creation via skipReview requires explicitly disabling the default safety block
listTasksList tasks/to-dos from calendars -- filter by completion status, due date, or calendar
updateTaskUpdate a task's title, due date, description, priority, completion status, or percent complete

Access Control

ToolDescription
getAccountAccessView which accounts the MCP server can access

Account and tool access are configured via the extension settings page (Tools > Add-ons > Thunderbird MCP > Options). Access control is not MCP-exposed -- only the user can change it.

The same settings page has a "Send Safety" section. Block skipReview is enabled by default and rejects skipReview: true for sendMail, replyToMessage, forwardMessage, createEvent, and createTask; their review window or dialog still opens normally. skipReview is honored only after you explicitly disable this preference.


Setup

1. Install the extension

bash
git clone https://github.com/TKasperczyk/thunderbird-mcp.git

Install dist/thunderbird-mcp.xpi in Thunderbird (Tools > Add-ons > Install from File), then restart. A pre-built XPI is included in the repo -- no build step needed.

Automatic updates: From v0.7.3 on, the add-on auto-updates through Thunderbird's add-on update check. Thunderbird downloads updates in the background and applies them on the next restart; because this add-on uses an experiment API, updates are not live hot-swapped. v0.7.3 is the last build you need to install by hand because older builds have no update_url and cannot auto-discover it. Thunderbird ships with xpinstall.signatures.required=false, so unsigned auto-updates work out of the box; a profile hardened to require signatures blocks both manual and automatic installs. If updates do not arrive, check the Add-ons gear menu and make sure Update Add-ons Automatically is enabled.

2. Configure your MCP client

Add to your MCP client config (e.g. ~/.claude.json for Claude Code):

json
{
  "mcpServers": {
    "thunderbird-mail": {
      "command": "node",
      "args": ["/absolute/path/to/thunderbird-mcp/mcp-bridge.cjs"]
    }
  }
}

Sandbox-aware connection discovery

The bridge re-discovers connection.json on every cache miss. It tries these locations in order:

  1. THUNDERBIRD_MCP_CONNECTION_FILE, if set
  2. Native temp dir: <os.tmpdir()>/thunderbird-mcp/connection.json
  3. macOS fallback: /var/folders/*/*/T/thunderbird-mcp/connection.json owned by the current user
  4. Linux Snap: Thunderbird's live TMPDIR from /proc/<pid>/environ, plus the official snap fallback under ~/Downloads/thunderbird.tmp
  5. Linux Flatpak / Betterbird Flatpak: $XDG_RUNTIME_DIR/app/*/thunderbird-mcp/connection.json

This covers native installs, the official Thunderbird snap, Thunderbird Flatpak, Thunderbird Beta Flatpak, and Betterbird Flatpak without changing the extension side. If multiple sandbox candidates exist at once, the bridge tries the newest file first. Set THUNDERBIRD_MCP_CONNECTION_FILE to force a single explicit path.

Example override:

json
{
  "mcpServers": {
    "thunderbird-mail": {
      "command": "node",
      "args": ["/absolute/path/to/thunderbird-mcp/mcp-bridge.cjs"],
      "env": {
        "THUNDERBIRD_MCP_CONNECTION_FILE": "/absolute/path/to/connection.json"
      }
    }
  }
}

That's it. Your AI can now access Thunderbird.


Security

  • Auth tokens: The HTTP server requires a session-scoped bearer token. Generated on startup, written to <TmpD>/thunderbird-mcp/connection.json with 0600 permissions. The bridge re-discovers that file automatically across native installs, Snap, Flatpak, Betterbird Flatpak, and macOS temp directories.
  • Dynamic port: Tries ports 8765-8774, records the actual port in the connection file. No hardcoded port dependency.
  • Account access control: Restrict which email accounts are visible to MCP clients via the settings page. Changes take effect immediately.
  • Tool access control: Disable specific tools via the settings page. Disabled tools are hidden from tools/list and blocked at dispatch.
  • Localhost only: By default, the server binds to localhost only. The "Listen on all interfaces" option in settings binds to all IPv4 interfaces for WSL, Docker, or remote access. This exposes the MCP server to every device on your local network. Only enable on trusted networks. Auth token is always required.
  • Auto-update integrity: Auto-update is a code-delivery channel whose integrity depends on continued control of the GitHub repository, the GitHub Actions token, and the tomaszkasperczyk.name registration.

Troubleshooting

ProblemFix
Extension not loadingCheck Tools > Add-ons and Themes. Errors: Tools > Developer Tools > Error Console
Connection refusedMake sure Thunderbird is running and the extension is enabled
Bridge can't find connection.jsonSet THUNDERBIRD_MCP_CONNECTION_FILE explicitly if your environment uses a non-standard temp/runtime path
Missing recent emailsIMAP folders can be stale. Click the folder in Thunderbird to sync, or right-click > Properties > Repair Folder
Tool not found after updateReconnect MCP (/mcp in Claude Code) to pick up new tools
searchBody returns no resultsIMAP accounts need offline sync enabled for Gloda to index message bodies
rawSource fails on IMAPRequires local/offline message copy. Enable offline sync or click the message first to cache it.

Development

bash
# Build the extension
./scripts/build.sh

# Test via the bridge (handles auth automatically)
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node mcp-bridge.cjs

# Test the HTTP API directly.
# On Snap / Flatpak / Betterbird Flatpak / macOS, point CONN_FILE at the
# real file or export THUNDERBIRD_MCP_CONNECTION_FILE first.
CONN_FILE="${THUNDERBIRD_MCP_CONNECTION_FILE:-/tmp/thunderbird-mcp/connection.json}"
TOKEN=$(jq -r .token "$CONN_FILE")
PORT=$(jq -r .port "$CONN_FILE")
curl -X POST http://127.0.0.1:$PORT \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Dev-only extension reload: After changing extension source locally, remove the add-on from Thunderbird, restart, reinstall the XPI, and restart again. Thunderbird caches aggressively. Regular users should install v0.7.3 once and let auto-update handle later releases.


Project structure

thunderbird-mcp/
├── mcp-bridge.cjs              # stdio <-> HTTP bridge (auth, port discovery)
├── extension/
│   ├── manifest.json
│   ├── background.js           # Extension entry point
│   ├── httpd.sys.mjs           # Embedded HTTP server (Mozilla)
│   ├── options.html            # Settings page UI
│   ├── options.js              # Settings page logic
│   ├── icons/                  # Extension icons
│   └── mcp_server/
│       ├── api.js              # All 40 MCP tools + auth + access control
│       └── schema.json
├── test/                       # Test suite (node:test, zero dependencies)
└── scripts/
    ├── build.sh
    └── install.sh

Known issues

  • IMAP folder databases can be stale until you click on them in Thunderbird
  • HTML-only emails are converted to plain text (original formatting is lost)
  • Recurring calendar event CRUD operates on the series, not individual occurrences
  • IMAP folder operations (rename, delete, move) are async -- verify with listFolders after
  • Combining tags with move/trash on IMAP may not preserve tags on the moved copy -- use separate calls
  • Pre-existing Thunderbird filters with cross-account move/copy targets are not restricted by account access control
  • searchBody on IMAP without offline sync only searches headers (Gloda limitation)
  • rawSource requires offline message copy for IMAP -- online-only messages will error

License

MIT. The bundled httpd.sys.mjs is from Mozilla and licensed under MPL-2.0.

Встановлення

TypingMind
{
  "mcpServers": {
    "thunderbird-mcp": {
      "command": "node",
      "args": [
        "mcp-bridge.cjs"
      ]
    }
  }
}

Доступні інструменти

  • listAccounts

    List all email accounts and their identities

  • listFolders

    List all mail folders with URIs and message counts

  • searchMessages

    Search message headers and return IDs/folder paths you can use with getMessage to read full email content

  • getMessage

    Read the full content of an email message by its ID

  • sendMail

    Compose a new email. By default opens a compose window for review; set skipReview to send directly.

  • listCalendars

    Return the user's calendars

  • createEvent

    Create a calendar event. By default opens a review dialog; set skipReview to add directly.

  • listEvents

    List calendar events within a date range

  • updateEvent

    Update an existing calendar event's title, dates, location, or description

  • deleteEvent

    Delete a calendar event

  • createTask

    Open a pre-filled task dialog in Thunderbird for user review before saving

  • listTasks

    List tasks/to-dos from Thunderbird calendars, optionally filtered by completion status or due date

  • searchContacts

    Search contacts across all address books by email address or name

  • createContact

    Create a new contact in an address book

  • updateContact

    Update an existing contact's properties

  • deleteContact

    Delete a contact from its address book

  • replyToMessage

    Reply to a message. By default opens a compose window with quoted original text for review; set skipReview to send directly.

  • forwardMessage

    Forward a message. By default opens a compose window with original content for review; set skipReview to send directly.

  • getRecentMessages

    Get recent messages sorted newest-first from a specific folder or all Inboxes, with date and unread filtering

  • displayMessage

    Open or navigate to a message in the Thunderbird GUI. Use '3pane' (default) to select the message in the mail view, 'tab' to open in a new tab, or 'window' to open in a standalone window.

  • deleteMessages

    Delete messages from a folder. Drafts are moved to Trash instead of permanently deleted.

  • updateMessage

    Update one or more messages' read/flagged/tagged state and optionally move them. Supply messageId for a single message or messageIds for bulk operations. Tags are Thunderbird keywords (e.g. '$label1' for Important, '$label2' for Work, or any custom string). Note: combining tags with moveTo/trash on IMAP may not preserve tags on the moved copy — use separate calls if needed.

  • createFolder

    Create a new mail subfolder under an existing folder. Note: on IMAP accounts, server-side completion is asynchronous; verify with listFolders.

  • renameFolder

    Rename an existing mail folder. Note: on IMAP accounts, server-side completion is asynchronous; verify with listFolders.

  • deleteFolder

    Delete a mail folder and all its contents. Moves to Trash, or permanently deletes if already in Trash. Note: permanent deletion may prompt the user for confirmation. On IMAP accounts, server-side completion is asynchronous; verify with listFolders.

  • emptyTrash

    Permanently delete all messages in the Trash folder for an account.

  • emptyJunk

    Permanently delete all messages in the Junk/Spam folder for an account.

  • moveFolder

    Move a mail folder to a new parent folder within the same account. Note: on IMAP accounts, server-side completion is asynchronous; verify with listFolders.

  • listFilters

    List all mail filters/rules for an account with their conditions and actions

  • createFilter

    Create a new mail filter rule on an account

  • updateFilter

    Modify an existing filter's properties, conditions, or actions

  • deleteFilter

    Delete a mail filter by index

  • reorderFilters

    Move a filter to a different position in the execution order

  • applyFilters

    Manually run all enabled filters on a folder to organize existing messages

  • getAccountAccess

    Get the current account access control list. Shows which accounts the MCP server can access. Account access is configured by the user in the extension settings page (Tools > Add-ons > Thunderbird MCP > Options) and cannot be changed via MCP tools.

Використовуйте MCP Thunderbird MCP з різними моделями ШІ

TypingMind підключає інструменти MCP на рівні робочого простору, тож після підключення Thunderbird MCP ви можете використовувати їх із різними моделями ШІ в TypingMind, а не налаштовувати окремо для кожної моделі. Ця інтеграція MCP працює локально через конектор MCP TypingMind на вашому пристрої.

Інструкція з налаштування локального конектора

Виберіть цей варіант, якщо серверу MCP потрібен доступ до локальних файлів, програм або приватних ресурсів на вашому комп’ютері.

1

Відкрийте налаштування MCP

У TypingMind перейдіть до розділу «Налаштування», відкрийте «Розширені налаштування», потім «Протокол контексту моделі» й виберіть «Параметри конектора».

  1. Відкрийте TypingMind у браузері.
  2. Натисніть значок налаштувань.
  3. Перейдіть до розділу «Розширені налаштування».
  4. Відкрийте розділ «Протокол контексту моделі».
  5. Натисніть «Параметри конектора» й виберіть «Цей пристрій».
Екран налаштування конектора MCP у TypingMind з вибраним варіантом «Цей пристрій»
2

Виконайте команду конектора

Виберіть «Цей пристрій», скопіюйте команду з TypingMind і виконайте її в терміналі. Не зупиняйте процес, поки користуєтеся MCP.

  1. Скопіюйте команду налаштування, показану в TypingMind.
  2. Відкрийте «Термінал» у macOS або Windows Terminal у Windows.
  3. Вставте й виконайте команду.
  4. Підтвердьте встановлення пакета, якщо термінал запитає дозволу продовжити.
  5. Не закривайте вікно термінала й не зупиняйте процес, поки користуєтеся інструментами MCP.
3

Додайте Thunderbird MCP як сервер

Коли статус конектора зміниться на «Готово», натисніть «Змінити сервери» та вставте конфігурацію сервера MCP.

  1. Зачекайте, доки статус конектора зміниться на «Готово».
  2. Натисніть «Змінити сервери».
  3. Вставте конфігурацію сервера MCP Thunderbird MCP.
  4. Збережіть список серверів.
  5. Оновіть дані, щоб переконатися, що конектор досі готовий до роботи.
Налаштування MCP у TypingMind з активним сервером і кнопкою «Змінити сервери»
{
  "mcpServers": {
    "thunderbird-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "thunderbird-mcp"
      ]
    }
  }
}
4

Використовуйте підключення з різними моделями

Збережіть список серверів, відкрийте «Плагіни», увімкніть інструменти MCP для Thunderbird MCP, а потім виберіть будь-яку підтримувану модель ШІ в TypingMind і використовуйте інструменти в чаті або призначте їх агенту ШІ.

  1. Відкрийте сторінку «Плагіни» в TypingMind.
  2. Увімкніть інструменти MCP для Thunderbird MCP.
  3. Почніть чат і виберіть модель ШІ, яку хочете використовувати.
  4. Використовуйте інструменти MCP у чаті або призначте їх агенту ШІ.
  5. За потреби перемикайтеся на іншу модель ШІ без повторного підключення MCP.
Чат TypingMind із використанням увімкнених інструментів MCP і вибраної моделі ШІ
Допоможете з цим завданням через Thunderbird MCP?
Thunderbird MCP
Звісно. Я це прочитав.
Ось що я знайшов за допомогою Thunderbird MCP.

Поширені запитання

Для чого використовується сервер MCP Thunderbird MCP?

Thunderbird MCP — це сервер MCP, який дає змогу сумісним клієнтам ШІ підключатися до зовнішніх інструментів і контексту. У TypingMind ви можете додати цей сервер MCP один раз і зробити його інструменти доступними у своєму робочому просторі ШІ.

Чи можу я використовувати MCP Thunderbird MCP з кількома моделями ШІ в TypingMind?

Так. TypingMind підключає інструменти MCP на рівні робочого простору, тому ви можете використовувати Thunderbird MCP з різними моделями ШІ, як-от Claude, ChatGPT, Gemini або іншими моделями, які ви налаштували в TypingMind, без окремого налаштування сервера MCP для кожної моделі.

Навіщо використовувати MCP Thunderbird MCP із TypingMind?

TypingMind — один із найкращих інтерфейсів для чату з великими мовними моделями, адже він об’єднує різні моделі ШІ, промпти, плагіни, агентів ШІ, ключі API та інструменти MCP в одному робочому просторі. Підключивши Thunderbird MCP, ви зможете використовувати його інструменти MCP з вибраними моделями та впорядковано працювати з чатами в TypingMind.

Як підключити MCP Thunderbird MCP до TypingMind?

Thunderbird MCP працює через локальний конектор MCP TypingMind. Це найкращий варіант, коли серверу MCP потрібен доступ до локальних файлів, настільних застосунків, інструментів командного рядка або приватних ресурсів на вашому комп’ютері.

Які інструменти надає MCP Thunderbird MCP у TypingMind?

Thunderbird MCP надає інструменти MCP (35), які можна ввімкнути на сторінці «Плагіни» в TypingMind і використовувати в чаті або призначати агентам ШІ.

Чи потрібно передавати свої ключі API в TypingMind, щоб використовувати MCP Thunderbird MCP?

Ні. TypingMind орієнтований насамперед на локальну роботу й дає змогу зберігати контроль над постачальниками моделей, ключами API, промптами та конфігурацією MCP. Якщо Thunderbird MCP потребує автентифікації, під час створення підключення додайте потрібні заголовки, налаштування OAuth або локальну конфігурацію для цього сервера MCP.

Схожі сервери MCP

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇