Skip to content

kdcokenny/lsbible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

30 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LSBible SDK Monorepo

Python Version License: MIT Code style: ruff

Multi-language SDK for the LSBible API at read.lsbible.org.

Disclaimer: This is an unofficial, third-party SDK and is not affiliated with, endorsed by, or connected to LSBible or its creators. This project is an independent client library for educational and development purposes.

Why the LSB?

The Legacy Standard Bible (LSB) is a modern literal translation that prioritizes accuracy and consistency:

  • πŸ“– Formal Equivalence - Word-for-word translation philosophy preserving original structure
  • ✝️ Based on NASB95 - Built on the respected New American Standard Bible, updated for modern scholarship
  • πŸ”€ Consistent Translation - Same Hebrew/Greek words translated consistently throughout
  • 🌟 Divine Name - Uses "Yahweh" for the Tetragrammaton (YHWH) instead of "LORD"
  • πŸ†“ Freely Accessible - Available for use in applications and tools
  • πŸ“… Modern Scholarship - Published in 2021 with latest textual research

The LSB's literal approach makes it ideal for serious Bible study, and its structured HTML output is perfect for SDK development, preserving formatting like red-letter text for Jesus' words and italics for translator clarifications.

Table of Contents

What Can You Do With LSBible?

LSBible provides three powerful ways to access the Legacy Standard Bible:

πŸ€– As an MCP Server (for AI applications)

Integrate Bible content directly into Claude Desktop, Claude Code, Cursor, or any MCP-compatible LLM application:

  • βœ… Natural language queries - Ask Claude to "get John 3:16" or "search for verses about love"
  • βœ… Zero setup coding - Just add to your MCP config, no programming required
  • βœ… 20+ supported clients - Works with Cursor, VS Code, Claude Desktop, Windsurf, and more
  • βœ… Bible study tools - Generate study guides and cross-reference analyses with built-in prompts
  • βœ… Search distribution - Understand which parts of the Bible discuss specific topics
  • βœ… Bible structure info - Query metadata about all 66 books, chapters, and verses

View MCP Server Installation Guide β†’

πŸ“¦ As a TypeScript SDK (for developers)

Perfect for building modern Bible applications with full type safety:

  • βœ… 100% Type-Safe - Full TypeScript support with Zod validation
  • βœ… Structured Parameters - No string parsing! Use client.getVerse(BookName.JOHN, 3, 16)
  • βœ… Rich formatting preserved - Access red-letter text (Jesus' words), italics, small-caps, and more
  • βœ… MCP Server included - Built-in Model Context Protocol server for AI integration
  • βœ… IDE autocomplete - Enum-based book names for all 66 books (no typos!)
  • βœ… Modern runtime support - Works with Node.js 18+, Bun, and Deno

View TypeScript SDK Documentation β†’

🐍 As a Python SDK (for developers)

Perfect for building Bible applications, study tools, or integrating Scripture into Python projects:

  • βœ… Fetch verses with type safety - Get any Bible verse with full validation of book/chapter/verse
  • βœ… Search with analytics - Find verses by text and see distribution across Bible sections and books
  • βœ… Rich formatting preserved - Access red-letter text (Jesus' words), italics, small-caps, and more
  • βœ… Structured data models - Work with immutable Pydantic models, not raw HTML or strings
  • βœ… IDE autocomplete - Enum-based book names for all 66 books (no typos!)
  • βœ… Response caching - Built-in TTL cache reduces API calls

View Python SDK Documentation β†’

Quick Start

Choose Your Path

πŸ€– MCP Server Integration

The easiest way to get started - no coding required! Just add LSBible to your MCP client config.

πŸ“š Complete Installation Guide β†’

Supports 20+ MCP clients including Cursor, Claude Code, VS Code, Claude Desktop, Windsurf, and more. Both local (npx) and remote (https://lsbible.kdco.dev/mcp) options available.

πŸ“¦ TypeScript SDK Usage

Install and use programmatically with full type safety:

# Install SDK
npm install lsbible
import { LSBibleClient, BookName } from "lsbible";

const client = new LSBibleClient();

// Fetch a verse with type-safe parameters
const verse = await client.getVerse(BookName.JOHN, 3, 16);
console.log(verse.verses[0].plainText);
// Output: "For God so loved the world, that He gave His only Son..."

// Access rich formatting
for (const segment of verse.verses[0].segments) {
  if (segment.isRedLetter) {
    console.log(`Jesus said: "${segment.text}"`);
  }
}

// Search with distribution analytics
const results = await client.search("love");
console.log(`Found ${results.matchCount} matches across the Bible`);

// Get an entire chapter
const chapter = await client.getChapter(BookName.PSALMS, 23);
console.log(`Psalm 23 has ${chapter.verseCount} verses`);

🐍 Python SDK Usage

Install and use programmatically:

# Install SDK
uv pip install lsbible
from lsbible import LSBibleClient, BookName

with LSBibleClient() as client:
    # Fetch a verse with type-safe parameters
    passage = client.get_verse(BookName.JOHN, 3, 16)
    print(passage.verses[0].plain_text)
    # Output: "For God so loved the world, that He gave..."

    # Access rich formatting
    for segment in passage.verses[0].segments:
        if segment.is_red_letter:
            print(f'Jesus said: "{segment.text}"')

    # Search with distribution analytics
    results = client.search("love")
    print(f"Found {results.match_count} matches across the Bible")

    # See which sections discuss "love" most
    if results.has_search_metadata:
        for section, count in results.counts_by_section.items():
            print(f"{section}: {count} matches")

Key Features

🎯 Structured Parameters Over String Parsing

Unlike traditional Bible APIs that parse strings like "John 3:16", LSBible uses explicit, validated parameters:

# βœ… GOOD - Type-safe with IDE autocomplete and validation
client.get_verse(BookName.JOHN, 3, 16)

# ❌ NOT SUPPORTED - String parsing (error-prone, no type safety)
client.get_verse("John 3:16")

Why?

  • Full IDE autocomplete for all 66 books
  • Early validation before API calls (catch errors instantly)
  • No parsing ambiguity (is "1 John" a book or chapter?)
  • Better testing (easy to generate test cases programmatically)
  • Language agnostic (works consistently across all SDKs)

πŸ“– Complete Bible Coverage

  • 66 books (39 Old Testament + 27 New Testament)
  • 1,189 chapters total
  • 31,102 verses total
  • Full validation of all book/chapter/verse combinations
  • 8 Bible sections for search distribution analytics

🎨 Rich Text Formatting

All formatting from the LSB translation is preserved:

  • Red-letter text - Words of Jesus highlighted
  • Italics - Clarifying words added by translators
  • Small caps - "LORD" representing YHWH (Yahweh)
  • Bold text - Emphasis in original text
  • Poetry/prose detection - Structural formatting preserved
  • Subheadings - Section titles and chapter markers

πŸ“Š Search Distribution Analytics

For text searches (not Bible references), get rich metadata showing:

  • Total match count across all of Scripture
  • Distribution by section (Pentateuch, History, Wisdom, Prophets, Gospels, Epistles)
  • Distribution by book (which books contain the most matches)
  • Filtered vs total counts (see how filters affect results)

Example: Searching for "love" shows 436 total matches, with 101 in Pauline Epistles and 95 in Wisdom/Poetry.

πŸ”’ Type Safety & Validation

  • Pydantic models for all data structures
  • Immutable models (frozen=True) prevent accidental mutations
  • Validation before API calls - catch errors early
  • Comprehensive error messages - know exactly what's wrong

Available SDKs

βœ… TypeScript SDK (Stable)

Status: Production ready Version: 0.3.0 Node.js: 18+

npm install lsbible

Key Stats:

  • πŸ›οΈ Full TypeScript support with Zod validation
  • βœ… Comprehensive test suite
  • πŸ“¦ Built with MCP SDK, Zod, LinkedOM
  • πŸ€– Model Context Protocol (MCP) server included

Full TypeScript SDK Documentation β†’ MCP Server Installation Guide β†’

βœ… Python SDK (Stable)

Status: Production ready Version: 0.3.0 Python: 3.12+

uv pip install lsbible

Key Stats:

  • πŸ›οΈ 10 core modules
  • βœ… Comprehensive test suite with >80% coverage
  • πŸ“¦ Built with Pydantic v2, httpx, BeautifulSoup

Full Python SDK Documentation β†’

πŸ’‘ Want Another Language?

We follow a community-driven approach for additional language SDKs. If you'd like to see LSBible in another language (Rust, Go, Java, C#, etc.):

  1. Check existing issues - Someone may have already requested it
  2. Open a feature request - Tell us which language and why
  3. Contribute! - Follow our SDK Specification to build one

All SDKs should follow these principles:

  • Structured parameter design (no string parsing)
  • Full type safety in the target language
  • Complete Bible validation
  • Rich formatting support

Open an Issue β†’ | Read Contributing Guidelines β†’

Documentation

πŸ“š Core Documentation

πŸ› οΈ Development Documentation

πŸ”— External Resources

Repository Structure

lsbible/
β”œβ”€β”€ README.md                  # This file - project overview
β”œβ”€β”€ CONTRIBUTING.md            # Contribution guidelines
β”œβ”€β”€ LICENSE                    # MIT license
β”œβ”€β”€ turbo.json                 # Turborepo configuration
β”œβ”€β”€ package.json               # Root package.json with workspaces
β”‚
β”œβ”€β”€ .specs/                    # Technical specifications
β”‚   β”œβ”€β”€ SPEC.md                # SDK specification (all languages)
β”‚   └── python-sdk-mcp-server.md  # MCP server specification
β”‚
└── packages/
    β”œβ”€β”€ typescript-sdk/        # βœ… TypeScript SDK (stable) + MCP Server
    β”‚   β”œβ”€β”€ src/               # SDK source code
    β”‚   β”‚   β”œβ”€β”€ client.ts      # API client
    β”‚   β”‚   β”œβ”€β”€ models.ts      # Zod schemas
    β”‚   β”‚   β”œβ”€β”€ parser.ts      # HTML parser
    β”‚   β”‚   β”œβ”€β”€ validators.ts  # Reference validation
    β”‚   β”‚   β”œβ”€β”€ books.ts       # Bible structure data
    β”‚   β”‚   └── mcp/           # MCP server module
    β”‚   β”‚       β”œβ”€β”€ server.ts  # MCP server factory
    β”‚   β”‚       β”œβ”€β”€ stdio.ts   # STDIO entry point
    β”‚   β”‚       β”œβ”€β”€ tools.ts   # MCP tools
    β”‚   β”‚       └── resources.ts # MCP resources
    β”‚   β”œβ”€β”€ tests/             # Test suite
    β”‚   β”œβ”€β”€ examples/          # Usage examples
    β”‚   β”œβ”€β”€ mcp/               # MCP server documentation
    β”‚   β”‚   └── README.md      # MCP installation guide
    β”‚   β”œβ”€β”€ README.md          # TypeScript SDK docs
    β”‚   └── package.json       # Package configuration
    β”‚
    └── python-sdk/            # βœ… Python SDK (stable)
        β”œβ”€β”€ lsbible/           # SDK source code
        β”‚   β”œβ”€β”€ client.py      # API client
        β”‚   β”œβ”€β”€ models.py      # Pydantic data models
        β”‚   β”œβ”€β”€ parser.py      # HTML parser
        β”‚   β”œβ”€β”€ validators.py  # Reference validation
        β”‚   β”œβ”€β”€ books.py       # Bible structure data
        β”‚   β”œβ”€β”€ cache.py       # Response caching
        β”‚   └── exceptions.py  # Custom exceptions
        β”œβ”€β”€ tests/             # Test suite
        β”œβ”€β”€ examples/          # Usage examples
        β”œβ”€β”€ README.md          # Python SDK docs
        └── pyproject.toml     # Python project config

Development

This monorepo uses Turborepo for build orchestration and Bun as the package manager.

Setup

# Clone repository
git clone https://github.com/kdcokenny/lsbible.git
cd lsbible

# Install monorepo dependencies
bun install

# Setup Python SDK for local development
cd packages/python-sdk
uv sync

Common Commands

# Build all packages
bun run build

# Run all tests
bun run test

# Run linters
bun run lint

# Run type checking
bun run type-check

# Run specific package commands
bun run --filter python-sdk test
bun run --filter python-sdk lint

TypeScript SDK Development

cd packages/typescript-sdk

# Install dependencies
bun install

# Run tests
bun test

# Build the project
bun run build

# Type checking
bun run type-check

# Linting and formatting
bun run lint
bun run lint:fix

# Run MCP server locally
bun run dist/mcp/stdio.js
# Or use the built binary
npx lsbible-mcp

Python SDK Development

cd packages/python-sdk

# Run tests with coverage
uv run pytest

# Type checking (ty - Rust-based type checker)
uv run ty check lsbible

# Linting and formatting
uv run ruff check lsbible
uv run ruff format lsbible

Contributing

We welcome contributions! Whether you want to:

  • πŸ› Report bugs
  • πŸ’‘ Suggest features
  • πŸ“ Improve documentation
  • πŸ”§ Submit code changes
  • 🌍 Add new language SDKs

Please read our Contributing Guidelines first.

Quick Contribution Tips

  • Bug reports: Include Python version, SDK version, and minimal reproduction
  • Feature requests: Explain use case and expected behavior
  • Code changes: Follow existing code style, add tests, update docs
  • New SDKs: Follow the SDK Specification

API Integration

All SDKs integrate with the LSBible API:

  • Base URL: https://read.lsbible.org
  • Endpoint: /_next/data/{buildId}/index.json
  • Query Parameter: q (verse reference or search text)
  • Build ID Management: Automatically handled by SDK
  • Response Caching: Configurable TTL (default: 3600s)

License

MIT License - See LICENSE file for details.

This project is independently developed and is not affiliated with the creators of the Legacy Standard Bible or read.lsbible.org.


Install MCP Server β†’ | TypeScript SDK β†’ | Python SDK β†’

Made with ❀️ for Bible software developers

About

Multi-language SDK for the LSBible API - structured, type-safe Bible client

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published