MailCraft MCP Server
<p align="center"><img src="icon.png" width="120" alt="MailCraft Bridge icon"></p>
<h1 align="center">MailCraft MCP Server</h1>
<p align="center">
<b>English</b> · <a href="README.es.md">Español</a> · <a href="README.pt-BR.md">Português</a> · <a href="README.fr.md">Français</a> · <a href="README.de.md">Deutsch</a> · <a href="README.ru.md">Русский</a> · <a href="README.zh-CN.md">简体中文</a> · <a href="README.ja.md">日本語</a> · <a href="README.ko.md">한국어</a>
</p>
<p align="center">
Let Claude read and organise mail files with the <b>MailCraft</b> installed on your computer — <b>Windows, macOS and Linux</b>:<br>
messages of mailboxes, .eml, .mbox and Outlook .pst files, calendars and contacts, conversion between mail formats, and drafts saved as .eml. It never sends mail.
</p>
---
## Why
[MailCraft](https://github.com/UCSLabs/mailcraft) is an open-source, Outlook-class mail, calendar and contacts program with a headless CLI (`mailcraft-cli`) and an MCP mode that only lets agents do what the owner allows. This [Model Context Protocol](https://modelcontextprotocol.io) server turns it into **file-in / file-out tools** for Claude, so you can ask things like:
> *"List the unread messages from last week in this .pst and summarise them."*
> *"Merge these .eml files into one .mbox."*
> *"What is on the calendar in this .ics next week?"*
> *"Draft a reply to Ana's latest message saying I will send the invoice on Monday."*
Sibling of [designcraft-mcp-server](https://github.com/jhonsu01/designcraft-mcp-server), [effectcraft-mcp-server](https://github.com/jhonsu01/effectcraft-mcp-server), [lightcraft-mcp-server](https://github.com/jhonsu01/lightcraft-mcp-server), [photocraft-mcp-server](https://github.com/jhonsu01/photocraft-mcp-server), [vectorcraft-mcp-server](https://github.com/jhonsu01/vectorcraft-mcp-server), [filmcraft-mcp-server](https://github.com/jhonsu01/filmcraft-mcp-server), [pdfcraft-mcp-server](https://github.com/jhonsu01/pdfcraft-mcp-server), [wordcraft-mcp-server](https://github.com/jhonsu01/wordcraft-mcp-server), [soundcraft-mcp-server](https://github.com/jhonsu01/soundcraft-mcp-server), [deckcraft-mcp-server](https://github.com/jhonsu01/deckcraft-mcp-server), [gridcraft-mcp-server](https://github.com/jhonsu01/gridcraft-mcp-server), [figcraft-mcp-server](https://github.com/jhonsu01/figcraft-mcp-server), [anicraft-mcp-server](https://github.com/jhonsu01/anicraft-mcp-server), [texturecraft-mcp-server](https://github.com/jhonsu01/texturecraft-mcp-server), [materialcraft-mcp-server](https://github.com/jhonsu01/materialcraft-mcp-server), [solidcraft-mcp-server](https://github.com/jhonsu01/solidcraft-mcp-server) and [audacity-mcp-server](https://github.com/jhonsu01/audacity-mcp-server).
## Platforms
| OS | MailCraft package to install | Where the server finds it (no setup needed) | Status |
| --- | --- | --- | --- |
| **Windows** 10/11 (x64, x86, arm64) | MSI or portable zip | `C:\Program Files\MailCraft`, `C:\Program Files\ArtCraft\MailCraft`, `%LOCALAPPDATA%\Programs\MailCraft`, `PATH` | ✅ Verified (Windows 11) |
| **Linux** (x86_64, aarch64, riscv64) | `.deb`, `.rpm` or `.tar.gz` | `/usr/bin`, `/usr/local/bin`, `/opt/mailcraft/bin`, `~/.local/bin`, `PATH` | ✅ Verified (Debian 12, headless) |
| **macOS** 11+ (Apple silicon and Intel) | `.dmg` (the app) **plus** `mailcraft-cli-<version>-macos-universal.zip` | `/Applications/MailCraft.app`, `/usr/local/bin`, `/opt/homebrew/bin`, `~/.local/bin`, `~/bin`, `PATH` | 🟡 Supported, not yet tested on a Mac |
All downloads: [MailCraft releases](https://github.com/storytold/mailcraft/releases) (there is also a FreeBSD tar.gz; set `MAILCRAFT_DIR` to it). Anywhere else: set `MAILCRAFT_DIR` (folder, `.tar.gz` root or `MailCraft.app`) or `MAILCRAFT_CLI`.
- **macOS:** the DMG contains only the app. Unzip the separate `mailcraft-cli` zip and move `mailcraft-cli` to `/usr/local/bin` (or point `MAILCRAFT_CLI` at it). The first run checks Apple's notarization online.
- **Linux:** the AppImage and Flatpak contain only the app, not `mailcraft-cli`; use the deb, rpm or tar.gz. For an AppImage app, set `MAILCRAFT_APP` so `open_in_mailcraft` can start it. On a server without a GPU, the verified setup used `libxkbcommon0 libvulkan1 libegl1 mesa-vulkan-drivers libasound2 fontconfig`.
## How it works
| Part | What it is |
| --- | --- |
| **MailCraft engine** (`mailcraft-cli mcp`) | MailCraft's own mail store and readers (.mailcraft, .eml, .mbox, .pst, .ics, .vcf), search, the composer and the exporters. Started fresh for each job, confined to a private temporary folder, with sending, permanent deletion, accounts and the mailbox file left to the owner. |
| **MCP server** (Node.js) | 10 high-level tools. Opens a mailbox only from a temporary copy, imports loose files into an empty mailbox, passes every message text on marked as untrusted, and saves drafts as .eml files without sending them. |
## Tools
| Tool | What it does |
| --- | --- |
| `list_messages` | Messages of a mailbox or of .eml / .mbox / .pst files, newest first, by folder and search (from:, to:, subject:, has:attachment, is:unread, before: / after:) |
| `read_message` | One message in full with its attachments and the SPF / DKIM / DMARC results |
| `get_mailbox_info` | Accounts, folders with message and unread counts, events, contacts, tasks and rules |
| `list_calendar_and_contacts` | Events between two days (recurring ones expanded), contacts or tasks of mailboxes, .ics and .vcf files |
| `convert_mail` | Mail files merged or converted into one .mailcraft mailbox or .mbox; calendars into .ics; contacts into .vcf; a message into .eml |
| `draft_message` | A new message or a reply (with attachments) saved as an .eml draft; never sent |
| `list_mailcraft_catalog` | Engine commands with what an agent may run (safe, owner, never) and formats |
| `run_mailcraft_commands` | MailCraft's agent-safe engine commands in one session (owner-only ones are refused) |
| `open_in_mailcraft` | Open mail files in the MailCraft app |
| `get_mailcraft_status` | Platform, installation, version and how many commands an agent may run |
| | |
| --- | --- |
| **Reads** | .mailcraft, .eml, .mbox, Outlook .pst, .ics, .vcf |
| **Writes** | .mailcraft, .mbox, .eml (messages and drafts), .ics, .vcf |
The text of messages, events and contacts was written by other people: the engine frames it as untrusted data, and the assistant reads it but never follows instructions found in it.
## Example
```json
{
"input_paths": ["C:\\Mail\\archive.pst"],
"folder": "inbox",
"query": "from:ana@example.com is:unread after:2026-11-01",
"limit": 20
}
```
## Requirements
- **MailCraft** with `mailcraft-cli` (tested with **0.16.0**); see [Platforms](#platforms)
- Node.js ≥ 20 (bundled with Claude Desktop for `.mcpb` installs)
## Installation
### Claude Desktop (recommended, all platforms)
1. Download `mailcraft-mcp-server.mcpb` from the [latest release](https://github.com/jhonsu01/mailcraft-mcp-server/releases/latest).
2. Double-click it (or drag it into Claude Desktop → *Settings → Extensions*) and click **Install**.
3. Optional: if MailCraft is not in a standard location, fill in its folder or the `mailcraft-cli` path in the extension settings.
### Claude Code and Cowork (plugin)
Add the marketplace `jhonsu01/sunsam-plugins` (in Claude Code: `/plugin marketplace add jhonsu01/sunsam-plugins`; in the Claude app: *Plugins → Add → Add marketplace*) and install **mailcraft-bridge**.
### Sunsam Code
Install **MailCraft Bridge** from the [Sunsam Code marketplace](https://github.com/jhonsu01/marketplace-SunsamCode), or drop the `.mcpb` into *MCP → Install extension*.
### Codex (OpenAI)
**Recommended — the marketplace (gets updates):** *Plugins → Add → Add marketplace*, source `jhonsu01/craft-marketplace`, reference `main`, then install **MailCraft Bridge** from **Craft Bridges** ([craft-marketplace](https://github.com/jhonsu01/craft-marketplace)). New versions arrive by refreshing the marketplace. Or upload the zip (Codex then keeps it in your account and refuses a newer zip with the same name):
1. Download `mailcraft-mcp-server-<version>-codex.zip` from the [latest release](https://github.com/jhonsu01/mailcraft-mcp-server/releases/latest).
2. In Codex: *Plugins → Add → New plugin*, choose the zip and click **Add plugin**.
3. Codex starts the server with `node`, so Node.js ≥ 20 must be on `PATH`. If MailCraft is not in a standard location, set `MAILCRAFT_DIR` or `MAILCRAFT_CLI` as system environment variables (Codex has no settings form for local plugins).
### DeepSeek Harness
1. *Plugins → Add plugin*, enter `github:jhonsu01/craft-marketplace#path:/plugins/mailcraft-mcp-server` and click **Install**, then **Enable now**.
2. Harness runs the server with its own MCP client and `node` (Node.js ≥ 20 on `PATH`); the tools appear as `mcp__mailcraft__<tool>` and the output files as cards that open in Harness.
3. Harness does not update plugins by itself yet: to upgrade, uninstall the plugin and install it again with the same address.
### Claude Code / other MCP clients
```bash
git clone https://github.com/jhonsu01/mailcraft-mcp-server.git
cd mailcraft-mcp-server
npm install
npm run build
```
Windows:
```bash
claude mcp add mailcraft -- node "%CD%\dist\bundle.cjs"
```
macOS / Linux:
```bash
claude mcp add mailcraft -- node "$PWD/dist/bundle.cjs"
```
## Configuration
| Variable | Meaning |
| --- | --- |
| `MAILCRAFT_DIR` | MailCraft folder, one of its executables, a `.tar.gz` root (with `bin/`) or `MailCraft.app`. Default: auto-detect |
| `MAILCRAFT_CLI` | Path of `mailcraft-cli` / `mailcraft-cli.exe` (wins over `MAILCRAFT_DIR`) |
| `MAILCRAFT_APP` | Path of the desktop app when it lives elsewhere (e.g. a Linux AppImage) |
| `MAILCRAFT_MCP_TIMEOUT` | Maximum seconds per engine call (default 3600) |
## Safety
- Files are **never overwritten** unless `overwrite: true`: a free name (`_2`) is used in folders and an existing `output_path` is an error. Inputs are only read; an edited file is saved only as a new copy (`_edited`).
- All paths must be absolute. The engine runs headless, confined to a private temporary folder for each job (the inputs are copied in, the outputs moved out), and never touches the MailCraft app.
- Everything runs locally with no network access. Each job uses a private engine in a temporary folder that is deleted at the end.
## Development
```bash
npm run build # TypeScript + single-file bundle (dist/bundle.cjs)
npm test # unit tests (Windows, macOS and Linux path logic)
npm run test:e2e # 23 end-to-end checks over real MCP stdio (synthetic messages, calendar and contacts)
npm run pack:mcpb # mailcraft-mcp-server.mcpb
npm run pack:codex # Codex / DeepSeek Harness plugin zip
```
Linux test in Docker (unpack `mailcraft-<version>-linux-x86_64.tar.gz` first):
```bash
docker run --rm -v "$PWD:/work:ro" -v "/path/to/mailcraft-0.16.0-linux-x86_64:/opt/mailcraft:ro" -e MAILCRAFT_DIR=/opt/mailcraft -w /work node:22-bookworm bash -c "apt-get update && apt-get install -y libxkbcommon0 libvulkan1 libegl1 mesa-vulkan-drivers libasound2 fontconfig && node scripts/e2e.mjs"
```
## License
Apache-2.0. MailCraft is © its authors (UCS Labs), MIT or Apache-2.0.
This project is not affiliated with or endorsed by MailCraft or UCS Labs. Outlook is a trademark of Microsoft.
TDQS
Scored across 10 tools
Most tools target a clearly distinct resource+action (list_messages vs read_message vs draft_message vs convert_mail), and mailbox-level vs message-level reads are separated by get_mailbox_info. The main overlap is get_mailcraft_status vs list_mailcraft_catalog (both describe MailCraft itself) and run_mailcraft_commands, which re-exposes engine tools like list_messages/read_message and can be confused with the dedicated versions. Descriptions mitigate these but the boundaries between the 'advanced' runner and the first-class tools remain fuzzy.
All names are snake_case verb_noun (list_messages, read_message, draft_message, convert_mail, run_mailcraft_commands), so the pattern is predictable. Minor deviations: compound multi-domain resources like list_calendar_and_contacts (bundles events/contacts/tasks) and the prepositional open_in_mailcraft break the strict verb_noun shape.
Ten tools is squarely in the well-scoped range for a mail-file inspection/drafting server. The only slight redundancy is having both get_mailcraft_status and list_mailcraft_catalog alongside run_mailcraft_commands for capability discovery, but each still earns a place.
The surface covers reading (messages, folders, calendar, contacts, tasks), conversion, drafting, opening in the app, and an escape hatch for engine commands (which supplies calendar/task creation and search variants). Sending and permanent deletion are deliberately absent per the design (owner-only), and there is no standalone search tool beyond list_messages query syntax, but these are documented, workable gaps rather than dead ends.