Skip to content
GitHub stars
msgvault TUI showing the Senders view

msgvault

Archive a lifetime of email and chat. Analytics and search in milliseconds. Query with AI, entirely offline.

Supports Gmail sync, IMAP, MBOX import, Apple Mail import, and text message import (WhatsApp, iMessage, Google Voice).

Read the Introduction to learn more about why this project was created.

Install

Terminal window
curl -fsSL https://msgvault.io/install.sh | bash

Windows (PowerShell):

Terminal window
powershell -ExecutionPolicy ByPass -c "irm https://msgvault.io/install.ps1 | iex"

Then set up OAuth credentials and start syncing. You can also build from source.

Why msgvault?

Your email and message data is yours. msgvault downloads a complete local copy of your email (from Gmail, IMAP, or local archives) and imports text messages from WhatsApp, iMessage, and Google Voice. Then everything runs offline against that archive. Search, analytics, the TUI, and the MCP server all query local SQLite and Parquet files. Nothing touches the network outside of sync and deletion commands that you run explicitly. No background OAuth sessions, no persistent API connections, no risk of an AI assistant or a compromised token silently accessing your live mailbox.

Years of PDFs, photos, documents, and spreadsheets buried in your inbox become ordinary files on your filesystem, deduplicated and instantly searchable. Your data is no longer locked behind a web interface or an API. It’s just files on disk that you own and control.

Features

Full Email Backup

Downloads complete messages from Gmail or any IMAP server, including raw MIME, labels, metadata, and every attachment. Every PDF, photo, spreadsheet, and document you’ve ever received or sent is extracted and stored locally, deduplicated by content hash. Once synced, everything works offline.

Lightning-Fast TUI

Explore hundreds of thousands of messages with instant aggregation and drill-down. Powered by DuckDB over Parquet, hundreds of times faster than SQL JOINs, in a small footprint.

Full-Text Search

SQLite FTS5-powered search with Gmail-like query syntax. Search by sender, date, label, size, attachments, and more.

Multi-Account

Archive multiple email accounts (Gmail and IMAP) in a single database with cross-account search.

Incremental Sync

Uses Gmail History API for efficient updates after initial full sync. Resumable checkpoints for interrupted syncs.

MCP Server

Expose your archive to AI assistants like Claude Desktop via the Model Context Protocol. Search, read, and analyze your messages from any MCP-compatible LLM.

Web Server

REST API for programmatic access to your archive. Optional cron-based background sync scheduling. Build dashboards, automations, and integrations.

Local Import

Import MBOX archives, Apple Mail .emlx exports, and text messages from WhatsApp, iMessage, and Google Voice. Messages are deduplicated, fully indexed, and searchable alongside your email data.

Safe Deletion

Stage messages for deletion in the TUI or via AI assistant, review manifests, then permanently delete from Gmail or IMAP provider.

How It Works

msgvault architecture: Gmail API syncs to SQLite, then offline Parquet analytics, FTS5 search, TUI, and MCP Server