Scriptorium MCP
Local-First, No-GPU Knowledge Engine Turning Messy Multilingual Archives into Citable Evidence
An open-source (Apache-2.0), read-only MCP server engineered for archival research over 50–1,000+ messy HTML captures, Wayback Machine snapshots, and legacy encodings (windows-1251, koi8-r, .fb2.zip)—returning hash-verified spans at $0 inference API cost.
- Inference Cost
- $0 · 100% Local CPU
- Citation Proof
- SHA-256 + char_start:end
- Live Demo Corpus
- 16 Chekhov works · 989 chunks
- Legacy Support
- cp1251 · koi8-r · .fb2.zip
Why Standard RAG Breaks on Real Archives
Most off-the-shelf RAG pipelines assume clean UTF-8 PDFs, send your entire corpus to a third-party cloud, and emit fluent summaries with no way to prove a quote actually came from the primary text.
Real historical, literary, and OSINT research looks nothing like that:
- Sources live across downed websites recoverable only through the Wayback Machine (
CDX id_), legacy Cyrillic encodings (windows-1251,koi8-r),.fb2.zipe-books, and messy HTML captures where~88%of bytes are navigation boilerplate. - Researchers frequently query in English or Spanish across Russian or multilingual primary sources.
- Silent text corruption or fabricated quotes invalidate the entire analysis.
Scriptorium (scriptorium-mcp) solves this cleanly on a normal laptop CPU with zero cloud uploads and $0 inference API cost.
When Scriptorium Is the Right Tool
I am explicit about tool boundaries rather than pitching one engine for everything:
- Under 5 live web pages? A single-prompt web agent is faster.
- 5–30 clean public PDFs? NotebookLM is usually the better fit.
- 50–1,000+ messy captures, legacy encodings, private corpora, or programmatic coding/research agents? That is where Scriptorium crosses the tipping point—exposing four structured, read-only MCP tools (
search,get_source,extract_axes, and corpus inspection) overstdio.
Architecture & Engineering Safeguards
- Resilient Local-First ETL: Decodes legacy encodings (
cp1251,koi8-r,.fb2.zip) and strips archival HTML boilerplate into clean, normalized UTF-8 Markdown under explicit memory governance (ResourceGuard). - Cross-Lingual Hybrid Retrieval on CPU: Combines dense multilingual embeddings (
paraphrase-multilingual-MiniLM-L12-v2) with lexical signals via Reciprocal Rank Fusion (RRF), language-aware stopwords, and strict acronym boundary controls—running completely locally without a GPU. - Deterministic Verifiable Citations: Every indexed chunk retains
doc_id,source_url,heading_path,lang, exactchar_start:char_endoffsets, and a deterministicsha256hash. The agent retrieves verifiable primary spans instead of improvising prose.
Verified End-to-End Demo
Running uv run scriptorium-mcp demo executes live stdio MCP tool calls against scriptorium-mcp serve over the bundled public-domain chekhov_bilingual_v1 corpus (16 works, 989 chunks)—demonstrating live cross-lingual EN → RU retrieval, SHA-256 span verification, and multi-axis extraction completely offline on CPU.