Skip to main content

Per-project Outlook PST/live-folder mail archive with incremental sync and pluggable AI query surfaces.

Project description

mail-archive

Per-project Outlook PST / live-folder mail archive with incremental sync. Designed to be driven either from a plain CLI or from any AI assistant (Claude, Gemini, ChatGPT, local LLMs) via an MCP server or by piping JSON output.

Status: pre-alpha. APIs and config schema will change.

What it does

Given one or more Outlook folders (or PST files) already split by project, mail-archive incrementally ingests new mail into a per-project local archive stored as JSON. Downstream tools (an AI, a script, a MCP client) can then answer questions about that history without re-parsing Outlook every time.

Requirements

  • Windows + Outlook desktop (for the live-folder / COM source)
  • Python 3.11+
  • pip install mail-archive[outlook] for the pywin32 dependency

Only pywin32 is required for basic use; [mcp] adds AI-client support.

Quick start

# 1. Install
pip install "mail-archive[outlook]"

# 2. Create a config file (edit projects afterwards)
mail-archive init

# 3. Ingest the first batch (Outlook must be running)
mail-archive ingest --project "ProjectA"

# 4. Later, sync everything incrementally
mail-archive update-all

Config

~/.mail-archive/config.toml:

storage_dir = "~/.mail-archive/storage"

[[project]]
name = "ProjectA"
source = "outlook-folder"
folder = "Inbox/ProjectA"
auto_update = true

[[project]]
name = "ProjectB"
source = "outlook-folder"
folder = "Inbox/ProjectB"

Using it from an AI assistant (MCP)

mail-archive ships a Model Context Protocol server so any MCP-capable client — Claude Desktop, Cursor, Cline, Zed, Continue, and others — can query the archive directly.

pip install "mail-archive[outlook,mcp]"

Then point your client at the mail-archive-mcp command. Example config for Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json on Windows):

{
  "mcpServers": {
    "mail-archive": {
      "command": "mail-archive-mcp",
      "args": ["--config", "C:/Users/you/.mail-archive/config.toml"]
    }
  }
}

Cursor / Cline / Zed use the same shape — look for their mcpServers JSON block and drop in the same command + args.

The server exposes four tools: list_projects, query_emails, update_project, and update_all. Once loaded, you can ask the AI things like "show me the three most recent emails about topic X in ProjectA" and it will pick the right tool and arguments on its own.

Design

  • Storage layout is stable: <storage_dir>/_index.json + <storage_dir>/<project>/emails.jsonl.
  • Every CLI subcommand is pure Python and prints JSON on stdout (except update-all, which is quiet by default).
  • The MCP server is a thin wrapper over the same library functions — no subprocesses, no duplicated logic.
  • Sources are pluggable: implement one function in mail_archive.sources and dispatch to it from fetch_for_project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mail_archive-0.1.0.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mail_archive-0.1.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file mail_archive-0.1.0.tar.gz.

File metadata

  • Download URL: mail_archive-0.1.0.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for mail_archive-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a34a5c0d4afbd704cd112d908abf7653d1c9f16069e012a293ec2e705ec36a02
MD5 8516b1c2e6902f9f4bf92b66e0df0c42
BLAKE2b-256 33246a365ed09fb097476f14daf2ee758dcfc2c3ed7ab6cf14e95eb741a1c0de

See more details on using hashes here.

File details

Details for the file mail_archive-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mail_archive-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for mail_archive-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25caf9ff82ccdd4ea8d7b934e810f4d6cb2932c12fbb3afa128c2d19d14db113
MD5 de2c8ba61ae8347c8882469dd9e02505
BLAKE2b-256 0f0c2fdebc6cdaaa8548b8373ff6e586d2a8b8058d593a68cef921319cade0e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page