msgvault: Lightning Fast Private Email Archive and Search

⬅️ Back to Tools

msgvault: Your Email, Liberated

Gmail’s search is broken. After 20 years of emails, finding that one attachment or old conversation feels like digging through a digital landfill. msgvault https://msgvault.io/ is a local-first email archive that downloads your entire Gmail history-millions of emails, hundreds of thousands of attachments-and lets you search it at the speed of thought, entirely offline.

Built by Wes McKinney (creator of pandas), it’s a love letter to data liberation: your messages stay on your machine, searchable in milliseconds, queryable via natural language through MCP, and deletable from Google’s servers while keeping your local copy.

Key Features

⚡ Lightning Fast Local Search

Powered by DuckDB over Parquet indexes:

  • Millisecond queries across millions of emails
  • Full-text search with FTS5 and Gmail-like query syntax (from:, has:attachment, date ranges)
  • Deduplicated attachments stored content-addressed by SHA-256
  • Incremental sync - history API picks up only new and changed messages

🖥️ Interactive Terminal UI

A slick, fast TUI for exploring your email history:

  • Drill-down analytics - slice and dice your entire message history
  • Attachment browser - find that PDF from 2019 in seconds
  • Deletion staging - mark emails for permanent removal from Gmail while keeping local copies
  • Real-time stats - email volume by sender, domain, year, and more

🤖 MCP Server for AI Integration

Expose your email archive to AI assistants via Model Context Protocol:

  • Claude Desktop integration - search and summarize correspondence conversationally
  • Local LLM support - works with any MCP-capable agent
  • Privacy-first - queries run locally, no data leaves your machine

🔒 True Data Ownership

  • Complete local backup - raw MIME, attachments, labels, metadata
  • Works offline - search, analytics, and MCP all work without network
  • Multi-account support - archive several Gmail accounts in one database
  • Export anytime - your data in standard formats (.eml, SQLite, Parquet)

Tech Stack

  • Language: Go 1.25+ (single static binary)
  • Database: SQLite (authoritative store)
  • Analytics: DuckDB over Parquet indexes
  • Search: FTS5 for full-text
  • Sync: Gmail OAuth API with incremental updates
  • AI: MCP (Model Context Protocol) server

Platforms

msgvault ships as a single static binary for:

  • 🍎 macOS
  • 🐧 Linux
  • 🪟 Windows

Get Started

Installation

macOS / Linux:

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

Windows (PowerShell):

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

Or download directly from GitHub Releases.

Quick Start

# Initialize the database
msgvault init-db

# Add your Gmail account (opens browser for OAuth)
msgvault add-account you@gmail.com

# Full sync (use --limit for testing)
msgvault sync-full you@gmail.com --limit 100

# Launch the interactive TUI
msgvault tui

Search Examples

# Gmail-style queries
msgvault search "from:boss@company.com has:attachment after:2024-01-01"

# Full-text search
msgvault search "quarterly report Q4"

# JSON output for scripting
msgvault search "project alpha" --json

MCP Server Setup

Connect to Claude Desktop or other MCP-capable agents:

# Start the MCP server
msgvault mcp

Then configure your AI assistant to connect to msgvault mcp and start querying your email archive conversationally.

🔗 Website: msgvault.io

🔗 GitHub: github.com/wesm/msgvault

🔗 Docs: msgvault.io/docs

Why This Tool Rocks

  • Escape Gmail’s Enshittification: Google won’t fix search because they have no incentive-msgvault gives you the power to actually find things
  • Your Data, Your Rules: Everything stays local. No API limits, no ads, no “Gemini AI” upsells-just pure, fast search
  • AI-Native Architecture: MCP server means your email becomes a first-class citizen in your AI workflow, not an afterthought
  • Built for Scale: Handles 2+ million emails without breaking a sweat-Wes McKinney’s own 20-year Gmail archive is the test case
  • Delete with Confidence: Stage deletions in the TUI, sync them to Gmail, keep your local copy. Smells like… victory

Crepi il lupo! 🐺