bible
# local-bible-library
An owned, verifiable Bible study library on your own disk, with tools for the terminal and for Claude (via MCP).
Commercial Bible software rents you a library that its servers can revoke, alter, or lock. This project builds the opposite: open-licensed sources downloaded straight from their publishers, kept byte-for-byte as published, proven unchanged by hash, and indexed so that scripts and AI assistants can query them without ever being able to change them.
## Principles
1. **Sources are never modified.** Every download is hashed, recorded in a committed manifest, and locked read-only. Nothing (no script, no LLM, no import step) writes into a source after ingest. New upstream releases go into a new version directory; old ones are kept.
2. **Download, don't distribute.** This repository holds code, recipes and manifests only. `lbl ingest` fetches each source from its publisher. No source data is redistributed here.
3. **Everything derived is rebuildable and labeled.** The search index is a cache built from the library. Every row records where it came from and whether it is verbatim source text, a deterministic parse, or machine output (OCR, LLM).
4. **Reference, not interpretation.** The tools surface texts, lexicons, commentaries and data. AI is used as a clerk that fetches and cites, never as an authority.
## Status
Early. See the [milestones](https://github.com/justinsovine/local-bible-library/milestones) for the roadmap.
| Milestone | Scope |
|---|---|
| M0 Foundation | Integrity layer (`ingest`, `verify`, locks), repo conventions |
| M1 Core data | STEPBible-Data, OpenBible, BSB; build the SQLite index |
| M2 Access | CLI and MCP server |
| M3 Library | Public-domain commentaries, modern open resources, church fathers |
| M4 Notes | Verse-referenced Markdown notes indexed alongside sources |
| M5 Readers and local models | Ezra, STEPBible desktop, LM Studio, semantic search |
| M6 Language growth | Vocabulary, reader's editions, guided morphology |
## Quick start
Requires [uv](https://docs.astral.sh/uv/) and git.
```sh
uv sync
uv run lbl status # recipes and what is ingested
uv run lbl ingest <id> # fetch, hash, lock, write manifest
uv run lbl verify # prove library/ matches the manifests
```
Commit the new file under `manifests/` after every ingest. A manifest only protects anything once it is in git history.
## Studying
```sh
uv run lbl build # verify, then rebuild the index (about 10 seconds)
uv run lbl verify-db # re-derive every index row from its source line
uv run lbl passage John 1:1-5 -i # text, original language, word by word
uv run lbl word G26 # lexicon, occurrences, renderings, forms
uv run lbl word reshit # by transliteration or lemma
uv run lbl search "living water" # translation, lexicon and original text
uv run lbl xrefs Rom 8:28 # cross-references ranked by votes
uv run lbl commentary John 3:16 -m RWP # what each commentary says (--list for modules)
uv run lbl fathers John 1:1 # church fathers on a passage, oldest first
uv run lbl notes John 1:1 # unfoldingWord translation notes on each Greek/Hebrew phrase
uv run lbl dict Bethel # Easton, ISBE, Smith, Nave, Abbott-Smith, ... (--list)
uv run lbl quote "In the beginning was the Word" # exact, normalized or not found
uv run lbl sql "SELECT ..." # read-only SQL; see docs/SCHEMA.md
```
Every command takes `--json`, and every result carries a citation: `source@version:file:line`.
## With Claude (MCP)
`.mcp.json` registers a read-only MCP server named `bible` (`uv run lbl mcp`). Claude Code asks once to enable it. It provides the tools `passage`, `word`, `search`, `xrefs`, `commentary`, `commentary_modules`, `church_fathers`, `translation_notes`, `dictionary`, `dictionary_modules`, `check_quote`, `sql`, `schema` and `sources`, and the prompts `/passage_guide` and `/word_study`. The server instructs Claude to quote only tool output, cite every quotation, confirm quotes with `check_quote`, and keep interpretation separate and labeled.
## Layout
```
sources/<id>.toml recipe: where a source comes from, its license (committed)
manifests/<id>/<version>.toml what was ingested: every file's SHA-256 (committed)
library/<id>/<version>/ the source itself, as published, locked (never committed)
build/ derived index, rebuildable (never committed)
notes/ your study notes, a separate private repo (never committed here)
src/lbl/ the tooling
docs/ INTEGRITY.md, SOURCES.md
```
## Licenses
The code in this repository is MIT licensed. Each source keeps its own license, recorded in its recipe and manifest; check it before you share anything built from it.
TDQS
Scored across 14 tools
Most tools target clearly distinct resources: passage (text), word (Strong's/lemma study), commentary, church_fathers, translation_notes, xrefs, dictionary, and search each have a distinct corpus or action. There is mild overlap between word and dictionary (both return lexicon entries for a Strong's number/lemma) and between search and dictionary (dictionary falls back to full-text search), plus four tools that all answer 'what does X say about this passage' — differentiated only by corpus, which the descriptions do clarify.
Names follow a consistent resource-oriented convention (passage, word, search, commentary, dictionary, xrefs, sources, schema), with the *_modules suffix used predictably for commentary_modules and dictionary_modules. Minor deviations are check_quote (verb_noun) and the sql/schema escape-hatch pair, but everything remains readable and predictable.
14 tools sits squarely in the well-scoped 3-15 range for a domain as broad as Bible study. Each tool covers a distinct corpus or operation, and the schema/sql pair serves as a deliberate escape hatch rather than filler.
Coverage is strong: text, original language, interlinear morphology, word studies, full-text search, three commentary corpora, dictionaries, cross-references, translation notes, provenance (sources), and a SQL fallback for anything uncovered. Minor gaps: passage appears to expose only the BSB translation even though sources tracks multiple versions, and grammatical/morphology search is only reachable through raw sql rather than a first-class tool.