Skip to main content
Glama

sacred-texts-mcp

Python 3.10+ MCP server License: MIT

A local Model Context Protocol server for semantic search, close-reading, and cross-tradition comparison across sacred, mythological, and foundational texts.

It turns heterogeneous source material into citable textual units, embeds them in a filtered vector index, and gives AI clients seven focused tools for retrieval and textual analysis.

What you can do

  • Search passages by meaning across multiple traditions and works.

  • Find cross-cultural parallels starting from a known passage.

  • Retrieve complete, citable passages instead of isolated search snippets.

  • Search exact words, lemmas, and Strong numbers where lexical data exists.

  • Inspect original-language tokens, morphology, and translation alignment.

  • Discover which works are available and what kind of analysis each supports.

Example questions:

Where do flood narratives appear across different traditions?

Which creation passages resemble Genesis 1:1?

How is a specific Hebrew or Greek lemma used across the indexed texts?

See real tool output from three example sessions.

Related MCP server: tripitaka-mcp

How it works

flowchart LR
    A[Heterogeneous sources] --> B[Format-aware parsers]
    B --> C[Citable text units]
    C --> D[Gemini embeddings]
    D --> E[(SQLite + sqlite-vec)]
    E --> F[FastMCP server]
    F --> G[Codex, Claude Code, or another MCP client]

The index is local and distributed as a single SQLite file. No API key is needed to search the prebuilt public index. A Gemini API key is required only if you choose to rebuild its embeddings.

For implementation details, see Architecture and Normalization.

MCP tools

Tool

Purpose

list_works

List available works, traditions, unit counts, and original-language coverage

semantic_search

Search by meaning, optionally filtered by tradition or work

similar_to

Find passages semantically close to a known reference

lexical_search

Search exact terms, lemmas, or Strong numbers

compare

Inspect word-level apparatus for one passage

passage

Retrieve a passage with optional surrounding context

passage_range

Retrieve a continuous range within one work

Quick start

1. Install

Requirements: Git and Python 3.10 or newer.

git clone https://github.com/alessandrodalpozzo/sacred-texts-mcp.git
cd sacred-texts-mcp
python -m pip install -r requirements.txt

On Windows, use py -3 instead of python if Python is installed through the Windows launcher.

2. Download the prebuilt index

Download index-open.db from the latest release and save it locally as:

data/index.db

The names differ intentionally: index-open.db is the downloadable release asset; data/index.db is the path expected by the server.

PowerShell:

Invoke-WebRequest `
  -Uri "https://github.com/alessandrodalpozzo/sacred-texts-mcp/releases/latest/download/index-open.db" `
  -OutFile "data/index.db"

macOS or Linux:

curl -L \
  https://github.com/alessandrodalpozzo/sacred-texts-mcp/releases/latest/download/index-open.db \
  -o data/index.db

3. Connect an MCP client

Codex

The project-scoped .codex/config.toml registers the server automatically. Open the repository as a trusted project, restart Codex, and check Settings > MCP servers or run /mcp.

Codex reads the project instructions from AGENTS.md.

Claude Code

Claude Code discovers the committed .mcp.json automatically. Its one-line CLAUDE.md imports AGENTS.md, so Claude and Codex follow the same project guidance.

You can also register the server manually:

claude mcp add sacred-texts -- python /absolute/path/to/sacred-texts-mcp/server/mcp_server.py

Other MCP clients

Configure a standard stdio server with:

{
  "command": "python",
  "args": ["/absolute/path/to/sacred-texts-mcp/server/mcp_server.py"]
}

Rebuilding the index

The repository includes the compressed open corpus, so a rebuild does not require downloading the original source collection:

cp .env.example .env
# Add GEMINI_API_KEY to .env
python index/build_index.py

Rebuilding is optional. The released index is ready for local retrieval.

Engineering highlights

  • Format-aware ingestion: reusable parsers normalize TSV, TEI XML, JSON, HTML, OCR-derived text, PDFs, and Wikisource material.

  • Citation-preserving chunking: retrieval units follow each work's own verse, section, chapter, or tablet structure rather than arbitrary character windows.

  • Incremental embedding pipeline: unchanged units are detected and are not embedded again.

  • Native filtered vector search: work and tradition metadata participate directly in SQLite vector retrieval.

  • Self-correcting tool interface: ambiguous work or tradition names return candidates that an MCP client can use to refine its request.

  • License-aware publishing: the public export is mechanically restricted to works approved for redistribution.

  • Automated verification: tests cover corpus schemas, indexing, query behavior, vocabulary resolution, diffing, and public-export enforcement.

Documentation

Document

Contents

Architecture

Pipeline, storage, retrieval, and design decisions

Normalization

Source-format problems and normalization choices

Data sources and licensing

Included and excluded sources, licenses, and attribution

Example sessions

Real MCP calls and outputs

Work license registry

Authoritative per-work source and redistribution status

Scope and limitations

The public artifacts include only openly licensed or public-domain material. They are a curated subset of the editions supported by the ingestion pipeline, not a comprehensive library of every sacred or ancient text.

Semantic similarity is a retrieval aid, not a historical or theological judgment. Results depend on the available edition, translation, and embedding quality. Some works are translation-only and therefore do not support word-level analysis.

This project applies the same neutral retrieval interface to every tradition and does not endorse a theological interpretation. See Data sources and licensing for the exact public scope.

License

The source code is released under the MIT License. Textual data retains its original per-work license and attribution as recorded in data/work_licenses.tsv.

A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    MCP server for the full Pāli Tipiṭaka — ~444,000 segments at parity with SuttaCentral (Sutta + Vinaya + Abhidhamma). Hybrid search, full-sutta fetch with cross-references, segment-aligned translation comparison, and Pāli word lookup. Offered as Dhamma Dāna.
    11
    6
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP server to search and retrieve passages from a corpus of 7,872 classical Islamic books via the Sahifah API, with full citations and mu'tabar filtering.
    MIT

View all related MCP servers

Related MCP Connectors

  • Bible corpus MCP server: scripture, Greek/Hebrew interlinear data, cross-refs, semantic search.

  • MCP server for Project Gutenberg — 75,000+ public-domain ebooks with full plain-text retrieval.

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alessandrodalpozzo/sacred-texts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server