mbox-mcp
Allows reading and searching local Gmail archives exported via Google Takeout (.mbox format), enabling analysis of email history without a live connection.
Allows reading and searching local Thunderbird mail archives (.mbox format) by indexing exported messages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mbox-mcp Open my Gmail Takeout archive and tell me who I emailed most."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mbox-mcp
An MCP server for local email archives. Point it at a Google Takeout .mbox export or a folder of .eml files and ask Claude things like:
"Who did I email most in this archive?"
"Find the message where the landlord mentioned the lease renewal."
"Summarize my correspondence with bob@example.com from early 2026."
Everything stays on your machine. No OAuth, no app passwords, no IMAP connection, no cloud. Every other email MCP server connects to a live account — this one reads the archive files you already have, which is exactly what you want for the 15 years of Gmail sitting in a Takeout export.
Quick start
Claude Code
claude mcp add mbox -- npx -y mbox-mcpClaude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"mbox": {
"command": "npx",
"args": ["-y", "mbox-mcp"]
}
}
}Then: "Open C:\Takeout\Mail\All mail Including Spam and Trash.mbox and tell me about it."
Related MCP server: work-assistant
Tools
Tool | What it does |
| Index an .mbox file or .eml directory: message count, date range, top senders |
| Search by keyword, sender, subject, date range — plus bounded body-text search |
| Fully parse one message: decoded body, headers, attachment names/sizes |
Built for large archives
A Takeout mbox is often multiple gigabytes with 100k+ messages. The design reads the minimum, lazily:
Streaming index — one pass in 8 MiB chunks, recording byte offsets; only the current message's first 16 KiB is ever held for envelope parsing (sender, subject, date, RFC 2047 decoding).
Full MIME on demand — reading a message parses just that message (postal-mime: nested multipart, charsets, quoted-printable/base64). Attachments are listed with names and sizes, never dumped into context.
Honest body search —
body_queryonly full-parses messages that already match your envelope filters, stops at a scan cap, and reports how many it scanned, so the model knows to narrow by sender or date first.Staleness-aware cache — archives are indexed once per process and re-indexed if the file changes.
Notes and limitations
mbox variants: Takeout and Thunderbird produce
mboxrd(bodyFromlines are quoted as>From), which splits cleanly. Plainmboxoarchives with unquoted bodyFromlines can over-split.Attachment contents are never returned or written anywhere.
PST/OST and Maildir are out of scope for now.
Development
npm install
npm test # offline tests — synthetic archives built in-suite
npm run build # tsc → dist/
node scripts/smoke.mjs # end-to-end: generates an archive, drives the server over stdioArchitecture: src/archive.ts (streaming indexer, header decoding, envelope filtering) and src/reader.ts (per-message MIME parsing) are pure logic; src/index.ts is the MCP wiring. The test suite includes a chunk-seam property test: indexing with pathological 17-byte chunks must produce an identical index to whole-file reads.
License
MIT
Available Tools
3 toolsget_messageRead a messageA
Fully parse one message by its id (from search_messages): headers, decoded text body (truncated if huge), and attachment names/types/sizes. Attachment contents are never returned.
Inputs: id (required), path (required).
open_archiveOpen a local email archiveA
Index an .mbox file (Google Takeout, Thunderbird) or a directory of .eml files — entirely locally, nothing leaves the machine. Returns message count, date range, and top senders. Large archives are indexed once and cached.
Inputs: path (required).
search_messagesSearch the archiveA
Search indexed envelopes (from/to/subject/date). query matches sender and subject. body_query additionally full-parses candidate messages to search body text — it is capped, so narrow with sender/date filters first; the result reports how many candidates were scanned.
Inputs: path (required), from, after, limit, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct role: open_archive indexes, search_messages queries the index, get_message retrieves full message details. There is no functional overlap between tools.
All tool names follow the verb_noun pattern (open_archive, search_messages, get_message) with consistent snake_case, making the API predictable and easy to navigate.
Three tools is a reasonable, well-scoped number for a focused email archive server. Each tool is necessary and covers the core workflow without unnecessary bloat.
The core workflow of indexing, searching, and retrieving messages is covered, but there is no way to list or manage multiple open archives, and no delete/close operation for archives, which is a minor gap for long-running workflows.
Maintenance
Related MCP Connectors
Read and search folders on your own computer with explicit consent. Files are never uploaded.
Your own AI reads, searches and drafts in your mailbox, on your Windows computer.
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Search your private marketing email archive and organize collections with optional write access.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query and recall your entire Gmail inbox locally, providing fast summarization and semantic search without relying on Gmail's search API.100 npm4MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search and read a local, provider-independent email archive, reconstruct contacts and interactions, and prepare draft responses without sending anything.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to search a local email archive using hybrid keyword and semantic search, and retrieve individual emails with thread context.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query a local, read-only Apple Mail archive, letting them search messages by keyword, sender, subject, date or account and retrieve summaries, individual message bodies, pending action items and stored daily briefs. All tools are annotated read-only, so assistants can consult mail without sending, deleting, moving or editing anything.MIT