Scriptorium
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Scriptorium search my Chekhov corpus for passages about loneliness and show citations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Scriptorium (scriptorium-mcp)
English | Español
Turn messy, multilingual web archives into citable evidence for your AI agents — local-first, no GPU.
Scriptorium (scriptorium-mcp) is an open-source, retrieval-only Model Context Protocol (MCP) knowledge engine designed for researchers, analysts, and agent builders who need a dedicated, verifiable assistant over a specific historical, literary, or web corpus.

100% live stdio tool calls against scriptorium-mcp serve over chekhov_bilingual_v1 (16 works, 989 chunks) running on local CPU (paraphrase-multilingual-MiniLM-L12-v2, $0 inference API cost). Also available as 1080p MP4 and Poster PNG.
Disambiguation: Scriptorium (scriptorium-mcp) is a retrieval-only MCP engine for web and document archives. It is not affiliated with eScriptorium (the OCR/HTR platform for handwritten text recognition).
When to Use Scriptorium (vs. NotebookLM & Web Agents)
The Tipping Point: For < 5 live web pages, a single-prompt web agent is faster; for 5–30 clean, public PDFs or URLs, NotebookLM is usually the better fit. Use Scriptorium once your project crosses any of these thresholds:
Scale & heterogeneity:
50–1,000+messy HTML captures, long-form e-books, or mixed formats.Archival friction: Downed websites recoverable only via the Wayback Machine or legacy encodings (
windows-1251,koi8-r,.fb2.zip).Strict privacy & zero API cost: 100% local CPU execution with zero documents uploaded to third-party clouds (
$0inference API cost).Zero-hallucination auditability: Every quote must be backed by a deterministic
sha256hash and exactchar_start:char_endoffsets.Programmatic agent workflows: Your AI coding or research agent needs structured, read-only MCP tool calls (
search,get_source,extract_axes).
Capability | Single-Prompt Web Agent | NotebookLM | Scriptorium ( |
Ideal Corpus Size & State |
|
|
|
Legacy Encodings & Wayback | Fails on downed URLs / mojibake | Assumes clean UTF-8 / text | Strict |
Citation Verifiability | Page URL only (no offset proof) | UI snippets (not hash-verifiable) | Deterministic |
Privacy & Inference Cost | Sends context to cloud LLM | Uploads corpus to Google cloud | 100% local CPU · |
Cross-Lingual & Acronym Control | Prompt-dependent | Built-in Q&A, opaque ranking | Hybrid RRF + language stopwords + acronym boundaries |
Agent Integration (MCP) | Built into chat UI | Closed web UI (no MCP server) | 4 read-only MCP tools ( |
Related MCP server: Advanced Web Search MCP Server
How It Works in 3 Steps
Ingest & index locally once: Run
scriptorium-mcp ingestandscriptorium-mcp indexon your config (or runuv run scriptorium-mcp demoto test end-to-end on the public-domain Chekhov corpus).Connect your MCP host in 6 lines of JSON: Add
scriptorium-mcp serveto Antigravity, Claude Code, Cursor, or any MCP-compatible client (see Connecting to an MCP Host).Ask in your language & verify every quote: Your agent searches across scripts (
search), inspects surrounding context (get_source), and proves every claim againstsha256and exact character offsets—never fabricating prose.
Why Scriptorium? (Manifesto & Engineering Safeguards)
Most off-the-shelf RAG pipelines assume clean, UTF-8 PDFs and emit free-form answers without proof. Real archival research faces harder constraints:
Messy, legacy, and multilingual corpora: Primary sources live across legacy encodings (
windows-1251,koi8-r), HTML templates (~88%boilerplate in real web captures), downed websites preserved only in the Wayback Machine, and languages outside the researcher's native fluency.Zero-tolerance for silent corruption or fabricated citations: An AI agent analyzing primary sources must return machine-verifiable evidence—not ungrounded summaries or silently corrupted spans.
Scriptorium solves this on standard CPU hardware ($0 inference API cost) with two core pillars and six field-tested safeguards:
Resilient Local-First ETL: Normalizes legacy encodings and multi-format archives into clean UTF-8 Markdown under explicit memory governance (
ResourceGuard).Deterministic Verifiable Citations: Every indexed chunk carries
doc_id,source_url,heading_path,lang, exactchar_start:char_endoffsets, temporal provenance (date_value,date_source,technical_format), and the normalized document'ssha256digest (content_hash). The engine never generates prose—it returns verified evidence payloads for your host agent (Antigravity, Claude Code, Cursor) to synthesize.
Six Field-Tested Safeguards (docs/DESIGN.md § 5.4)
Strict encoding & double-mojibake guard: Bans silent
errors="replace"across HTML, text, and e-book connectors, and catches double-decodedU+FFFDtriplets before indexing.Auto language detection & near-duplicate control: Infers language from normalized content, filters configurable stubs, and deduplicates by
content_hashand canonicalnormalized_url.Temporal provenance & format stratification: Separates verified
publisheddates fromfirst_seen_archiveupper bounds and tagstechnical_formatto prevent timeline distortion.Hard embedding-model guard & hash-based chunk IDs: Persists model name, dimensions, and metric in the corpus manifest, rejecting mismatched queries and preventing duplicate re-indexing.
Post-indexing vector-density anomaly check: Flags anomalous non-adjacent similarity clusters (
cos > 0.99) caused by corrupted text or boilerplate collapse.Language-aware BM25 & Unicode word boundaries: Strips query-language stopwords during lexical search and enforces script-aware boundaries for short technical acronyms.
Architecture
flowchart LR
subgraph CLI["CLI (Human-Controlled Ingestion)"]
W["connectors/web<br/>robots.txt + delay + cache"]
A["connectors/wayback"]
F["connectors/files<br/>HTML, TXT, MD, EPUB, FB2"]
end
W --> N["ingest/encoding<br/>strict decode + mojibake guard"]
A --> N
F --> N
N --> M["ingest/html_to_md<br/>Markdown + lang + dedup"]
M --> C["index/chunker<br/>hierarchical + offsets + sha256"]
C --> V[("ChromaDB<br/>multilingual dense")]
C --> B[("BM25<br/>stopwords + lexical")]
V --> R["retrieve/hybrid<br/>RRF fusion"]
B --> R
R --> S["mcp/server<br/>read-only"]
S --> H["Host Agent<br/>Antigravity, Claude Code, Cursor"]
R --> E["evaluate/<br/>benchmarks & anomaly gate"]MCP Interface (Read-Only)
Ingestion runs strictly through the human-controlled CLI to enforce polite crawling (robots.txt, rate limits) and hardware governance. The MCP server exposes four read-only tools:
Tool | Inputs | Purpose |
| — | List indexed corpora, document/chunk counts, languages, and embedding contract metadata. |
|
| Run hybrid (BM25 + dense RRF), dense, or lexical retrieval returning scored chunks and citation objects. |
|
| Fetch the exact normalized substring ( |
|
| Structured retrieval across user-defined conceptual or analytical axes defined in YAML or passed as a list. |
A companion agent skill is included at skills/scriptorium/SKILL.md.
Two-Layer Evidence & Benchmarks
Scriptorium separates why the architecture exists (real archival friction observed in practice) from how anyone can audit it end-to-end (an open, public-domain benchmark):
Layer 1 — Real-World Field Study (Anonymized)
Scriptorium originated from an archival research commission spanning multi-format, predominantly non-Latin web and book collections with downed URLs and legacy encoding failures. Every safeguard in docs/DESIGN.md traces directly to measured incidents from that commission (including silent e-book double-mojibake, mixed embedding spaces, and archive-vs-publication date skew).
Published field study: Read the complete anonymized English study and 10 empirical charts at
docs/field_study.md(159 independently audited metrics, zero-leak privacy verified).
Layer 2 — Reproducible Public-Domain Benchmark (chekhov_bilingual_v1)
Published & Reproducible (Milestone M4): Full CPU benchmark results over 16 parallel Russian/English Anton Chekhov stories (Wikisource RU pinned oldid + Project Gutenberg EN Constance Garnett, 989 chunks, 32 curated queries) are published in docs/benchmarks.md. Reproduce locally with uv run scriptorium-mcp demo ($0 API cost).
Benchmark Dimension | Metric | Baseline Comparison | Observed Result ( |
Retrieval Quality |
| BM25-only ( | Hybrid: |
Citation Verifiability | Deterministic exact-span & | Target: |
|
ETL Encoding & Corruption Resilience | Exact-match recovery rate, CER & double-mojibake recall | Naive UTF-8 ( |
|
Hardware Efficiency | Process RSS peak RAM, CPU latency & index footprint | Local CPU-only ( | Hybrid warm latency |
Quickstart
Requires Python 3.11–3.13 and uv.
# Install dependencies (pinned to Python 3.12 via .python-version)
uv sync --dev
# Inspect CLI and validate the sample config
uv run scriptorium-mcp --help
uv run scriptorium-mcp version
uv run scriptorium-mcp validate-config configs/example.yaml
# Run the reproducible public-domain bilingual Chekhov demo & CPU benchmark ($0 API cost)
uv run scriptorium-mcp demo --output-json data/corpora/chekhov_bilingual_v1/benchmark_report.json
# Run lint and offline unit tests
uv run ruff check .
uv run pytest -vConnecting to an MCP Host
Configure your MCP client (Antigravity, Claude Code, Cursor, etc.) to launch the read-only stdio server from your cloned repository:
{
"mcpServers": {
"scriptorium": {
"command": "uv",
"args": ["--directory", "/path/to/scriptorium-mcp", "run", "scriptorium-mcp", "serve"]
}
}
}(Once published to PyPI, this simplifies to "command": "uvx", "args": ["scriptorium-mcp", "serve"].)
Roadmap
M0 — Scaffold: Package structure,
Citation&Chunkcontracts, config validation, read-only MCP server skeleton, pytest & GitHub Actions CI.M0.5 — Narrative Alignment & M1 Blueprint: Two-layer validation narrative, extended
Citation/CorpusInfoprovenance contracts, six field-tested engineering gates,docs/M1_PLAN.md, and Node 24 CI.M1 — Resilient Ingestion:
files,web, andwaybackconnectors, process-RSSResourceGuard, strict encoding + double-mojibake guard, HTML→Markdown converter, and ETL CER benchmark.M2 — Indexing & Hybrid Retrieval: Hierarchical offset-preserving chunker (
chunk_idhashes), hard embedding-model guard, ChromaDB + stopword-awarebm25s, RRF fusion, post-index vector anomaly check, and 100% citation verifiability.M3 — Full MCP Wiring: End-to-end tool execution backed by persisted corpora +
SKILL.mdhost verification.M4 — Reproducible Evaluation & Demo:
scriptorium-mcp demo(chekhov_bilingual_v1), 32-query monolingual & cross-lingual golden set, and published CPU benchmarks (docs/benchmarks.md).M5 — Post-MVP Extensions: Generic forum (phpBB/SMF) and blog connectors, optional LLM-as-a-Judge faithfulness suite, and published time-saved case study.
See docs/DESIGN.md for the technical specification and docs/M1_PLAN.md for the M1 implementation plan.
License
Licensed under the Apache License 2.0.
Available Tools
4 toolsextract_axesC
Gather structured evidence grouped across user-defined axes (list, dicts, or YAML).
Inputs: axes (required), corpus (required), k, lang, +1 more. Returns: object
get_sourceB
Fetch an exact verified substring and surrounding context window by chunk or doc ID.
Inputs: corpus, doc_id, window, chunk_id. Returns: object
list_corporaA
List all indexed corpora, document/chunk counts, languages, and embedding metadata.
Inputs: no named parameters. Returns: object
searchC
Search an indexed corpus and return scored chunks with verifiable citations.
Inputs: query (required), corpus (required), k, lang, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct stage of the retrieval workflow: enumerate corpora, free-text search, fetch an exact verified span, and aggregate evidence by axes. The only mild overlap is between search and extract_axes, both of which retrieve evidence, but the descriptions make the difference (scored chunks vs. structured axis-grouped evidence) clear enough.
Three of four tools follow a verb_noun pattern (list_corpora, get_source, extract_axes) in consistent snake_case. The bare verb 'search' is a minor deviation but is unambiguous and readable in context.
Four tools is a lean but coherent surface for a read-only corpus retrieval server; each tool covers a distinct step (discover, search, verify, structure). It is slightly minimal, but nothing feels redundant or missing for the core loop.
The read path is fully covered: list corpora, search, fetch verified source text, and structured extraction, which closes the loop from discovery to citation. Write-side operations (indexing or creating corpora) appear intentionally out of scope, leaving only minor gaps such as metadata-only or filtered listing.
Maintenance
Related MCP Connectors
SEC filings, Wikipedia, arXiv, US Census and more for AI agents, with every answer source-linked.
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Structured, cited, real-world data from 300+ sources and the open web for your AI agents.
Real-time fact-check, citation verification, and source-freshness for AI agents.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides AI agents with multi-format document indexing, hybrid dense and sparse search with reranking, and relational SQL querying over extracted tables.12-
- FlicenseNot gradedqualityCmaintenanceProvides AI agents and RAG pipelines with production-grade web search, deep research, news, academic, extraction, crawling, and source verification tools. Enables citation-anchored, deduplicated, fresh, and security-hardened evidence gathering from across the web.-
- AlicenseNot gradedqualityCmaintenanceEnables agents to run hybrid retrieval, build token-budgeted attributed context packs, answer questions with citation and groundedness-gated release, explore temporal graph entities, evaluate claim support, and ingest screened, embedded documents through typed MCP tools.Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and applications to find authoritative primary data sources from natural-language queries, receive step-by-step website navigation guidance, and integrate evidence-backed external facts into their workflows.-