Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/exegia/corpora-py/llms.txt

Use this file to discover all available pages before exploring further.

Context Fabric (corpora-py) is a Python library and MCP server that lets AI assistants and developers query deeply annotated religious texts — Bible, Quran, Tanakh, commentaries, lexicons — as a graph. Every word, verse, chapter, and book is a typed node with queryable features like lemma, morphology, and gloss. The cf-mcp CLI starts a FastMCP server exposing 11 tools over stdio, SSE, or HTTP transports.

Quickstart

Install the package and run your first corpus query in minutes

MCP Server

Connect AI assistants like Claude to any Text-Fabric corpus

Corpus Management

Fetch datasets from git or convert EPUB and HTML into queryable corpora

API Reference

Full reference for all 11 MCP tools and the Python API

What You Can Do

Query Annotated Texts

Search across Hebrew Bible, Greek New Testament, and custom corpora using pattern templates with morphological and lexical filters

Connect AI Assistants

Expose any corpus to Claude Desktop, GPT, or any MCP-compatible client with a single CLI command

Import Custom Books

Convert EPUB or HTML documents into Text-Fabric datasets and query them alongside canonical corpora

How It Works

1

Install the package

Install corpora-py with uv (Python 3.13+ required):
uv add corpora-py
2

Download a corpus

Fetch a Text-Fabric dataset from a git repository or use an existing local dataset:
# Or fetch from git programmatically
from exegia.corpus.fetch_from_git import fetch_datasets_from_git
paths = fetch_datasets_from_git("https://github.com/ETCBC/bhsa")
3

Start the MCP server

Launch the cf-mcp server pointing at your corpus directory:
uv run cf-mcp --corpus ~/.exegia/datasets/bibles/BHSA
4

Query your corpus

Use the 11 MCP tools from your AI assistant or Python code to search, browse features, and retrieve passages:
from exegia.mcp import mcp, corpus_manager

corpus_manager.load("~/.exegia/datasets/bibles/BHSA", name="BHSA")
mcp.run(transport="sse", host="localhost", port=8000)

Key Features

  • 11 MCP tools covering corpus discovery, pattern search, pagination, CSV export, and passage retrieval
  • Multiple transports: stdio for Claude Desktop, SSE and HTTP for remote clients
  • Multi-corpus support: load and switch between named corpora in a single server session
  • EPUB/HTML converters: turn any ebook or web content into a queryable Text-Fabric dataset
  • Supabase auth: email OTP, Apple/Google OIDC, and anonymous session support
Context Fabric requires Python 3.13+ and uses uv for dependency management. See the Installation guide for full prerequisites.

Build docs developers (and LLMs) love