Skip to main content

claude-archive-mcp

Local stdio MCP server that exposes your unified chat history (claude.ai, claude code and chatgpt) to Claude Code as ranked, scoped, structured search.

Status: v1.15.0 · Author: Mike Andersen · License: PolyForm Noncommercial 1.0.0

When you reference past work — "did we settle this in nortam_dev last month?", "find the TAP routing analysis", "what did Claude Code commit on April 14?" — Claude Code reaches for this server instead of asking you to summarize.

Quickstart

One supported path, from nothing to a cited answer you can open: a wheel from PyPI and six shipped commands, in this order. Windows PowerShell 5.1 (unchanged under PowerShell 7) and Python 3.11 or newer. Your own paths, a scheduled reindex, the plugin route and the container are advanced setup, in docs/INSTALL.md.

No export yet? scripts/make_demo_export.py is one standard-library file; download it or run it from a checkout. It writes a tiny synthetic export -- a decision approved, a test failing against it, a second decision replacing it -- and prints one line per source root. Paste those lines into the same window. With your own exports in the default places, skip this.

python make_demo_export.py $env:TEMP\archive-demo
$env:CLAUDE_ARCHIVE_AI_SOURCE = 'C:\Users\you\AppData\Local\Temp\archive-demo\claude_ai'
...

1. Install into a virtual environment:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install claude-archive-mcp

2. Register the server with Claude Code. It writes the claude-archive entry of ~\.claude.json, validated before and after and backed up first:

claude-archive-install-mcp
Preserved operator keys: (none)
OK: no existing config; creating C:\Users\you\.claude.json
OK: registered 'claude-archive' (user scope) in C:\Users\you\.claude.json
...

3. Ask the doctor what this machine has, before indexing. Its sources line names each registered source it found, with the root it found it at; an absent one is named as absent, never counted as empty. With no index yet it reads no counts, says so, and exits 2 naming the next command:

claude-archive-doctor
  [PASS] sources     3 of 3 registered sources present -- claude_ai C:\...\archive-demo\claude_ai (store not read); ...
  [FAIL] database    no archive database at C:\Users\you\AppData\Local\claude-archive-mcp\archive.db
                 -> Run: claude-archive-index reindex
7 pass, 1 warn, 1 fail (exit 2: setup-broken -- fix the FAIL above before trusting anything else)

4. Build the index. One line per registered source, with what it saw and wrote; run the doctor again afterwards and it exits 0, each source now with its indexed count:

claude-archive-index reindex
mode: full
  claude_ai: seen=2 written=2 skipped=0
  ...

5. Ask the first question. Start a NEW Claude Code session and ask, verbatim:

What did we decide about the sync store and what replaced it?

Claude answers from search_chats. On the demo export the top hit is the conversation in which decision B replaced decision A, at the message that says so -- conversation 00000541-0000-4000-8000-00000000000b, message 1: Decision B replaces decision A: we decided to move the sync store from notes_sync.json to SQLite in WAL mode ... -- and the decision it replaced ranks right below it.

6. Open the cited passage in the read-only viewer the wheel ships:

python -m claude_archive_mcp.webui

It serves http://127.0.0.1:8766/ (pass --port if that port is taken). The cited passage is http://127.0.0.1:8766/chat?uuid=00000541-0000-4000-8000-00000000000b#m1: the conversation page, at message 1.

Sources, one index

Source source Origin
claude.ai claude_ai ~/.claude/Exported_Chats/conversations.json + projects/
claude code claude_code ~/.claude/projects/**/*.jsonl
chatgpt chatgpt ~/.claude/Exported_ChatGPT/conversations.json + conversations-<n>.json

All feed one conversations table; the same tools search across every source.

Tools

search_chats · get_chat · list_projects · list_recent_chats · search_within_chat · archive_stats · timeline · find_related_chats · get_digest · recall · get_session_lineage — eleven read-only, source-aware tools. See docs/TOOLS.md. The server also exposes a per-project resource (claude-archive://project/{source}/{identifier}) — a dynamic markdown project overview.

Digest: get_digest (tool) or python scripts/digest.py --weekly (also /digest) — a markdown activity recap over a rolling daily/weekly window; both share one aggregator.

Semantic search (optional): find_related_chats ranks conversations by embedding cosine. It needs the optional extra — pip install -e .[embeddings], then python scripts/embed.py --backfill (also /embed). The server itself stays inference-free.

Comprehension sidecars (v1.4.0): search_chats and find_related_chats each carry an additive semantic sidecar tier — matches against per-conversation, LLM-authored comprehension sidecars (an abstract plus entities/identifiers), searched by FTS and typed separately from the lexical and embedding rows. It is graceful under partial coverage (an un-covered conversation simply cannot appear), so it never regresses the existing results. Keeping the sidecar store current is an attended, Mike-armed task — see docs/SIDECAR_REFRESH.md.

Briefing packs (v1.10.0): claude-archive-brief --project <slug> writes a deterministic, read-only markdown pack answering what happened here recently, what is still open, what was decided, and what to open next -- every line carrying a locator you can open. Same library behind python scripts\brief.py, the viewer's /brief page, and the plugin's /archive:brief. It is an out-of-process surface, not a twelfth tool. See docs/BRIEFING.md.

Curated memory (v1.10.0, opt-in): an append-only store of Decision / Entity / Thread objects in a separate memory.db beside the archive. Curation is out of process -- claude-archive-curate carries six verbs (correct, supersede, dispute, pin, merge, forget), each an append, so no wording is ever rewritten; claude-archive-memory (the console entry point, v1.12.0), python scripts\memory.py and the viewer's /memory page read it. When the store exists, search_chats and find_related_chats rows gain a curated_status label (current / superseded / disputed / null) -- a label only, changing no count, no ordering and no selection. With no memory.db the key is absent, so responses are byte-identical to an install that never curated anything. No archive migration and no new MCP tool.

Curated notes (v1.11.0, opt-in): python scripts\curated_notes.py --out <vault> --force renders those same memory objects as plain markdown notes with flat YAML frontmatter, into a curated\ folder beside -- never inside -- the conversation tree the markdown exporter writes. Generated Maps of Content per kind and per project, a prune pass so a forgotten object's note leaves the vault, and byte-identical re-export when nothing changed. With no memory.db it is a clean no-op, not an error. Read-only against both stores; no plugin and no new dependency is required to read any of it. See docs/KNOWLEDGE.md.

Context planner (v1.11.0, prompt-side): the recall-past-work skill that ships with the archive plugin carries a four-rung disclosure ladder over these same eleven tools -- candidates, then curated memory objects, then the specific passage, then the whole conversation -- climbing only when the current rung has not answered, inside a 24,000-character budget across the first three rungs, and disclosing where it stopped and why. It is prompt-side text with no server component: no twelfth tool, no hook, and no change to any tool response.

Continuity Capsule (v1.12.0, opt-in): claude-archive-brief --capsule [--json] [--select startup|resume|compact|fork] [--since <ISO>] emits one typed continuity object per (subject, window) -- ten closed fields of rows, each row carrying its own evidence locator, provenance class, confidence tier and recorded_at. It is assembled purely from the collections the briefing pack already gathers, so it adds no database read. Opt-in throughout: without --capsule the entry point emits the briefing pack byte-for-byte as before. Out-of-process, like the pack it is projected from: no twelfth tool, no schema change. The bounded, opt-in, default-off SessionStart integration that consumes it is built and registered in plugin/hooks/hooks.json; it injects nothing unless CLAUDE_ARCHIVE_SESSIONSTART is on, and only into a session whose directory is authorized in the brief directory's pack-aliases.json, written by claude-archive-brief --project S --alias ROOT. See docs/design/session_start.md, and docs/PROGRAM.md section 18 for its provenance.

Runs in a hardened container (v1.15.0, optional): docker compose build, then docker compose run --rm worker reindex, a first-run claude_archive_mcp.memory.populate, docker compose run --rm worker publish and docker compose run --rm serve. Non-root, no network interface at all, read-only root filesystem, dropped capabilities. The container serves a published generation -- an identified, hash-verified copy of the corpus that claude-archive-index publish mints; serve mounts it read-only and nothing else, verifies every hash before opening anything, refuses with one line and exit 2 if a byte moved, and rolls back by rewriting one pointer. It has no path to the live working store at all. Native and containerized runs over the same fixture produce the same application result for all eleven tools, compared against the published-generation topology the deployment files select rather than only the legacy flat mount -- a test, not a promise (tests/test_container_equivalence.py). Nine of the eleven are compared over payloads carrying content; find_related_chats and get_session_lineage agree as structurally empty answers this fixture cannot make answer, so the measured floor is nine. Setup, the Gateway's control gaps, the legacy flat mode and the evidence: docs/INSTALL.md section 15, reports/container_runtime_1.md and reports/snapshot_publisher_measurements_1.md.

Release truth is machine-generated (v1.15.0): claude-archive-doctor capabilities [--json] prints what a build actually ships -- package, archive-schema and memory-schema versions, the F20 baseline hash, the eleven tool names and their reviewed MCP annotations, the console entry points, the plugin manifest version, the registered hooks, the transports and the MCP revision the installed SDK implements, the serve plane's read-only declaration, the maintenance entry point, the registered sources with their capability flags, the migration list, and the default of every CLAUDE_ARCHIVE_* control. Read-only and offline: it opens no database and binds no socket, and resolves defaults with the environment cleared so the manifest reports what an unconfigured install does. --json is byte-stable (sorted keys, LF, trailing newline).

Install

The supported install is the Quickstart above. Everything beyond it is one link away in docs/INSTALL.md: section 0 is the same wheel path with every option (your own source and database paths, pinned versions, artifact checks), and sections 1-13 are the editable development checkout that the scripts\ helpers assume.

Web viewer (read-only, localhost)

A plain, server-rendered web UI for browsing the same index in a browser — a second, read-only consumer of the query layer (it adds no MCP tool and changes no contract).

python -m claude_archive_mcp.webui                 # opens http://127.0.0.1:8766/
python -m claude_archive_mcp.webui --port 9000     # same, on a different port
  • Pages (twelve): Home (recent conversations), Search (full-text, ranked), Conversation (with within-chat search, and a link to its Related page -- related is no longer rendered inline), Related (one conversation's neighbours from the embedding and sidecar tiers, as its own actively-visited page; the viewer attaches no structural index, so the structural tier the MCP tool can add does not appear here), Timeline (a topic's activity over time, filterable by source/project), Digest (rolling daily/weekly activity digest), Stats (archive statistics with near-duplicate project names collapsed for reading), Observability (read-only adoption panels: archive tool adoption, web-UI engagement, and sidecar coverage), Brief (a briefing pack for one project or query), Cockpit (ten continuity health sections on one page, eleven with the opt-in capsule), Memory (the curated-memory objects, read-only), and the Guide (/guide, linked from every page's header and footer; ?tab=start|pages|recipes|glossary|troubleshooting): what each page answers, worked recipes, the glossary behind every info marker, and troubleshooting. The Guide reads no database, so it still answers when the archive cannot be opened. The query logic is reused from the same handlers the MCP tools wrap -- no duplicate logic, no MCP transport.
  • Stylesheet (one route): /static/viewer.css, the one stylesheet every page links rather than repeating inline (dispatch 000494). It is served from a module constant -- no file is read from disk -- for exactly that path: nothing else under /static is served.
  • Posture (all enforced in code, proven by tests): binds 127.0.0.1 only (no config to widen it); opens the SQLite DB mode=ro, so it can never write or migrate; GET-only; no JavaScript; stdlib http.server (no extra dependencies).
  • Port: defaults to 8766; override with CLAUDE_ARCHIVE_WEBUI_PORT or the --port flag (the flag wins). The host is a hard rail — --port changes the port only, never the loopback bind. Index first (claude-archive-index reindex, or python scripts\reindex.py in a development checkout) — the viewer reads an existing DB and will not create one.
  • Freshness: the long-running viewer records a running-code stamp when it starts; python scripts\check_webui_stale.py reports whether the live process is serving stale code. Restarting the live process is a deliberate, attended action.

Documentation

Plan of record:

  • ROADMAP.md -- the canonical product roadmap (north star, principles, horizons, release sequence, do-not-reopen register)
  • docs/PROGRAM.md -- the operational truth layer (per-horizon state, evidence gates, closed rulings, dated baselines, recorded policies)
  • docs/ROADMAP-archive-mcp.md -- FROZEN-HISTORICAL as of 2026-08-13; prior-cycle evidence, not a plan

Reference:

Development

pip install -e .[dev]
ruff check .
ruff format --check .
mypy --strict src/
pytest

Conventions live in CLAUDE.md. The project is built in gated phases; do not chain past a phase gate.

Export tools (tools/)

Standalone scripts for payloads the archive does not index: the claude.ai parser stores each tool call's placeholder line, not its input. They open the export's conversations.json read-only, stream it with ijson, never touch archive.db, and are not part of the installed package.

  • tools/extract_tool_inputs.py -- one JSONL line per tool_use block for the named tools (--tool, repeatable), a census of every tool name (--list-tools), and markdown dumps of listed conversations (--prose-candidates).
  • tools/recipes_to_box.py -- converts recipe_display_v0 calls to Recipe Box schema v1 documents (tools/recipe_box_schema_v1.json) and validates them.

Both take --check, which re-derives the counts and outputs and exits non-zero on any difference. Run them with the project venv's interpreter, which carries ijson and jsonschema.

License

Beginning with v1.14.0, Claude Archive MCP is licensed under PolyForm Noncommercial 1.0.0. Personal and other qualifying noncommercial use, modification and redistribution remain free. Any commercial use requires a separate commercial license from the copyright holder. Releases through v1.13.0 remain available under the MIT terms under which they were originally released.

The last MIT release is tagged v1.13.0; its license text is preserved at LICENSES/MIT-through-v1.13.0.txt. The current license text is LICENSE. Contributing is covered in CONTRIBUTING.md; its CLA and trademark drafts are not yet in effect.

Metadata

Release files for claude-archive-mcp 1.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-archive-mcp 1.15.0
File Size Uploaded Provenance Actions
claude_archive_mcp-1.15.0.tar.gz 2.4 MB Without provenance Details for claude_archive_mcp-1.15.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for claude-archive-mcp 1.15.0
File Interpreter ABI Platform Actions
claude_archive_mcp-1.15.0-py3-none-any.whl Python 3 none any Details for claude_archive_mcp-1.15.0-py3-none-any.whl

Total release size: 3.4 MB

Release files / claude_archive_mcp-1.15.0.tar.gz

Download URL claude_archive_mcp-1.15.0.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
73e592c0a4f43e74511226a309270ee492c0c6423a67caa898354db4c83c3502
BLAKE2b-256 checksum
How to use checksums
1df30041a3844238ab043c501add2ac8db7e2c94ebcb03332ed35525d9504420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / claude_archive_mcp-1.15.0-py3-none-any.whl

Download URL claude_archive_mcp-1.15.0-py3-none-any.whl
Size 975.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eed9ee027bd91d27e2f2531b12e60d884dd427dedf7287d479e9cb4c4aab48db
BLAKE2b-256 checksum
How to use checksums
4d41b4cd1119fb4fe148ab4209b5687fbce04c5c295291fc6e1bb4fa2bea08b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.16

Security for claude-archive-mcp 1.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page