### Install textual-criticism-mcp with CLI support Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Use this command to install the library with command-line interface support. ```bash pip install textual-criticism-mcp[cli] ``` -------------------------------- ### Install textual-criticism-mcp with all features Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Use this command to install the library with all available features, including MCP server and CLI support. ```bash pip install textual-criticism-mcp[all] ``` -------------------------------- ### Install textual-criticism-mcp with MCP server support Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Use this command to install the library with support for the MCP server. ```bash pip install textual-criticism-mcp[mcp] ``` -------------------------------- ### Parse verse with syntax detail Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Example of using `parse_verse` with `detail_level='syntax'` to get comprehensive morphological and syntactic information for a verse. ```python parse_verse("Gen 1:1", detail_level="syntax") ``` -------------------------------- ### Install textual-criticism-mcp in development mode Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Commands to clone the repository, navigate to the directory, and install the library in editable mode with all dependencies for development. ```bash git clone https://github.com/yourusername/textual-criticism-mcp cd textual-criticism-mcp pip install -e ".[all]" ``` -------------------------------- ### Install Textual Criticism MCP Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Install the core library, with MCP server support, with CLI support, or all components. ```bash # Core library only pip install textual-criticism-mcp ``` ```bash # With MCP server support pip install textual-criticism-mcp[mcp] ``` ```bash # With CLI pip install textual-criticism-mcp[cli] ``` ```bash # Everything pip install textual-criticism-mcp[all] ``` -------------------------------- ### Configure MCP server in Claude Desktop Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Add this JSON configuration to your Claude Desktop config file to enable the textual-criticism-mcp server. This example uses 'python' as the command. ```json { "mcpServers": { "textual-criticism": { "command": "python", "args": ["-m", "textual_criticism_mcp.mcp.server"] } } } ``` -------------------------------- ### Search by morphology Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Example of using `search_morphology` to find Hebrew verbs in the 'qal' stem and 'imperative' mood. ```python search_morphology(language="hebrew", pos="verb", stem="qal", mood="imperative") ``` -------------------------------- ### Download Text-Fabric corpora Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Demonstrates how to get the corpus manager and trigger the download of Hebrew (BHSA) and Greek (N1904) corpora by accessing `cm.hebrew` and `cm.greek`. This download occurs automatically on first use. ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager # This will download BHSA and N1904 on first run cm = get_corpus_manager() cm.hebrew # Downloads Hebrew corpus cm.greek # Downloads Greek corpus ``` -------------------------------- ### Search for a lemma Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Example of using `search_lemma` to find all occurrences of a specific Greek word ('ἀγάπη') in the New Testament corpus, with a limit of 100 results. ```python search_lemma("ἀγάπη", corpus="nt", limit=100) ``` -------------------------------- ### Get Textual Apparatus for a Passage with `get_variants` Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Loads STEPBible TAGNT data for a New Testament verse and returns a structured textual apparatus. Includes base text, variation count, and details on each variation unit. ```python from textual_criticism_mcp.lib.apparatus import get_variants # Theologically significant passage variants = get_variants("Mark 16:9") print(f"Reference: {variants['reference']}") print(f"Base text (NA28): {variants['base_text']}") print(f"Total variations: {variants['total_variations']}") print(f"Has meaningful variants: {variants['has_meaningful_variants']}") for v in variants['variations']: print(f"\n Location: {v['location']}") print(f" Type: {v['type']}") print(f" Affects meaning: {v['affects_meaning']}") for reading in v['readings']: print(f" {reading['type']:10s}: \"{reading['text']}\"" print(f" witnesses: {reading['witnesses']}") print(f" text_type: {reading['text_type']}") # Filter to only translation-affecting variants meaningful = get_variants("1 John 5:7", significance="meaningful") for v in meaningful['variations']: if v['affects_meaning']: print(f"Meaningful variant at {v['location']}") # Expected output structure: # { # "reference": "Mark 16:9", # "base_text": "Ἀναστὰς δὲ πρωῒ ...", # "total_variations": 3, # "has_meaningful_variants": True, # "variations": [ # { # "location": "word 2", # "type": "ancient_only", # "affects_meaning": True, # "readings": [ # {"text": "δέ", "type": "primary", "witnesses": ["NA28", "SBL"], # "text_type": "alexandrian"}, # {"text": "τε", "type": "variant", "witnesses": ["TR", "Byz"], # "text_type": "byzantine"} # ] # } # ] # } ``` -------------------------------- ### Get passage text in multiple translations Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Example of using `get_passage` to retrieve text for a passage (Rom 8:1-4) in specified translations (KJV, WEB, ASV) and also include the original text. ```python get_passage("Rom 8:1-4", translations=["KJV", "WEB", "ASV"], include_original=True) ``` -------------------------------- ### BibleAPIClient - Get Chapter Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Retrieves an entire chapter from the Bible with a specified translation. ```APIDOC ## BibleAPIClient.get_chapter ### Description Retrieves an entire chapter from the Bible with the specified translation. ### Method Signature `get_chapter(reference: str, translation: str)` ### Parameters - **reference** (str) - Required - The biblical reference for the chapter (e.g., "John 1"). - **translation** (str) - Required - The translation to use (e.g., "KJV"). ### Response An object containing the chapter text. #### Success Response - **text** (str) - The text of the chapter. ### Example ```python from textual_criticism_mcp.lib.translations import BibleAPIClient client = BibleAPIClient() chapter = client.get_chapter("John 1", translation="KJV") print(chapter.text[:200]) ``` ``` -------------------------------- ### Get Bible Verse and Chapter using BibleAPIClient Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Use BibleAPIClient for lower-level access to retrieve specific verses or entire chapters with specified translations. Ensure the translation code is valid. ```python from textual_criticism_mcp.lib.translations import BibleAPIClient client = BibleAPIClient() verse = client.get_verse("Philippians 4:13", translation="WEB") print(verse.text) # "I can do all things through Christ..." print(verse.copyright) # "Public Domain (WEB)" chapter = client.get_chapter("John 1", translation="KJV") print(chapter.text[:200]) # "[1] In the beginning was the Word..." ``` -------------------------------- ### Get textual variants for a passage Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Example of using `get_variants` to retrieve variant readings for a specified passage (Mark 16:9-20), including manuscript and edition support, with `include_manuscripts=True`. ```python get_variants("Mark 16:9-20", include_manuscripts=True) ``` -------------------------------- ### BibleAPIClient - Get Verse Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Retrieves a specific verse from the Bible with a specified translation. ```APIDOC ## BibleAPIClient.get_verse ### Description Retrieves a specific verse from the Bible with the specified translation. ### Method Signature `get_verse(reference: str, translation: str)` ### Parameters - **reference** (str) - Required - The biblical reference for the verse (e.g., "Philippians 4:13"). - **translation** (str) - Required - The translation to use (e.g., "WEB"). ### Response An object containing the verse text and copyright information. #### Success Response - **text** (str) - The text of the verse. - **copyright** (str) - The copyright information for the translation. ### Example ```python from textual_criticism_mcp.lib.translations import BibleAPIClient client = BibleAPIClient() verse = client.get_verse("Philippians 4:13", translation="WEB") print(verse.text) print(verse.copyright) ``` ``` -------------------------------- ### Configure MCP Server for Claude Desktop Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Register the MCP server with Claude Desktop by adding configuration to `claude_desktop_json`. Alternatively, run the server directly using Python. ```json // ~/Library/Application Support/Claude/claude_desktop_json { "mcpServers": { "textual-criticism": { "command": "uvx", "args": ["textual-criticism-mcp"] } } } ``` ```json { "mcpServers": { "textual-criticism": { "command": "python", "args": ["-m", "textual_criticism_mcp.mcp.server"] } } } ``` -------------------------------- ### Configure MCP server with uvx Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md An alternative configuration for the textual-criticism-mcp server using 'uvx' as the command. Add this JSON to your Claude Desktop config. ```json { "mcpServers": { "textual-criticism": { "command": "uvx", "args": ["textual-criticism-mcp"] } } } ``` -------------------------------- ### Parse a verse with full morphology in Python Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Demonstrates parsing a verse using the `parse_verse` function and iterating through its words to print their text, lemma, and part of speech. Requires importing `parse_verse` and `search` from `textual_criticism_mcp.lib`. ```python from textual_criticism_mcp.lib import parse_verse, search # Parse a verse with full morphology verse = parse_verse("John 3:16") for word in verse.words: print(f"{word.text} ({word.lemma}) - {word.pos}") # Search for a lemma results = search("word lex=ἀγάπη", corpus="greek") ``` -------------------------------- ### Run tests for textual-criticism-mcp Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Command to execute the test suite for the textual-criticism-mcp project using pytest. ```bash pytest ``` -------------------------------- ### Python Library - get_corpus_manager Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Initializes and returns a corpus manager, which handles the downloading and access of Text-Fabric corpora for Hebrew and Greek. ```APIDOC ## get_corpus_manager ### Description Get an instance of the Corpus Manager. This is used to access and manage the Text-Fabric corpora for Hebrew and Greek. The corpora will be downloaded automatically on first use. ### Method `get_corpus_manager() -> CorpusManager` ### Parameters None ### Request Example ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager cm = get_corpus_manager() # Access Hebrew corpus (downloads if not present) hebrew_corpus = cm.hebrew # Access Greek corpus (downloads if not present) greek_corpus = cm.greek ``` ### Response #### Success Response (CorpusManager Object) - **CorpusManager** - An object that provides access to the downloaded corpora. - **hebrew** - Access to the Hebrew corpus data. - **greek** - Access to the Greek corpus data. ### Response Example ```python # The returned object is an instance of CorpusManager # Example of accessing corpus data (actual structure depends on Text-Fabric) print(cm.hebrew.version) print(cm.greek.version) ``` ``` -------------------------------- ### analyze_passage.py Script - Programmatic Usage Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Programmatic equivalent of the analyze_passage.py script, demonstrating how to fetch translations, parse morphology, and retrieve variants using the library. ```APIDOC ## analyze_passage.py (Programmatic) ### Description Demonstrates the programmatic usage of the Textual Criticism MCP library to perform passage analysis, including fetching translations, parsing morphological data, and retrieving textual variants. ### Example ```python import os os.environ['TF_SILENT'] = 'deep' # suppress Text-Fabric progress output from textual_criticism_mcp.lib.corpus import parse_verse from textual_criticism_mcp.lib.translations import get_passage from textual_criticism_mcp.lib.apparatus import get_variants ref = "John 3:16" # Translations trans_result = get_passage(ref, ['KJV', 'WEB']) for t, d in trans_result['translations'].items(): print(f"{t}: {d['text']}") # Morphology table verse = parse_verse(ref, 'full') for w in verse.words: morph = " ".join(filter(None, [w.pos, w.tense, w.voice, w.mood, w.case, w.number, w.gender])) print(f"{w.text:<18} {w.lemma:<15} {(w.gloss or '')[:20]:<22} {morph}") # Variants (meaningful only) variants_result = get_variants(ref, 'meaningful') print(f"Variation units: {variants_result.get('total_variations', 0)}") ``` ``` -------------------------------- ### Lint textual-criticism-mcp code Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Command to check the source code of the textual-criticism-mcp project for style and potential errors using ruff. ```bash ruff check src/textual_criticism_mcp ``` -------------------------------- ### textual_criticism_mcp.lib - Convenience Functions Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Provides direct Python scripting access to core functionalities like parsing verses, retrieving variants, and fetching translations. ```APIDOC ## textual_criticism_mcp.lib Functions ### Description This module provides convenience functions for direct use in Python scripts, enabling functionalities such as verse parsing, variant retrieval, and translation fetching. ### Functions - **`parse_verse(reference: str, format: str)`**: Parses a biblical verse and returns a verse object. The `format` parameter specifies the level of detail (e.g., 'full'). - **`get_variants(reference: str, type: str)`**: Retrieves textual variants for a given reference. The `type` parameter specifies the kind of variants (e.g., 'meaningful'). - **`get_passage(reference: str, translations: list[str])`**: Fetches translations for a given reference and a list of translation codes. Returns a dictionary of translations. ### Example ```python from textual_criticism_mcp.lib.corpus import parse_verse from textual_criticism_mcp.lib.translations import get_passage from textual_criticism_mcp.lib.apparatus import get_variants ref = "John 3:16" # Get translations trans_result = get_passage(ref, ['KJV', 'WEB']) # Parse verse for morphology verse = parse_verse(ref, 'full') # Get meaningful variants variants_result = get_variants(ref, 'meaningful') ``` ``` -------------------------------- ### Analyze Passage from CLI using analyze_passage.py Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt The analyze_passage.py script provides a command-line interface for full passage analysis, generating a formatted console report of translations, morphological tables, and textual variants. It accepts single or multiple verse references. ```bash # Analyze a single verse python scripts/analyze_passage.py "John 1:1" # Analyze multiple verses python scripts/analyze_passage.py "Mark 16:9" "1 John 5:7" "Romans 3:23" ``` -------------------------------- ### get_variants Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Loads STEPBible TAGNT data and returns a structured apparatus for any NT verse. Provides base text, variation count, and details on competing readings, their witnesses, and significance. ```APIDOC ## `get_variants` — Textual Apparatus for a Passage Loads STEPBible TAGNT data and returns a structured apparatus for any NT verse: base text (NA28), total variation count, and a list of variation units each containing all competing readings, their manuscript/edition witnesses, text-type classification (Alexandrian, Byzantine, or both), and whether the variant affects translation meaning. ### Parameters - **reference** (string) - Required - The biblical reference for which to retrieve the textual apparatus (e.g., "Mark 16:9"). - **significance** (string) - Optional - Filters variants to include only those that affect translation meaning. Accepted values: `"meaningful"`. ### Request Example ```python from textual_criticism_mcp.lib.apparatus import get_variants variants = get_variants("Mark 16:9") print(f"Reference: {variants['reference']}") print(f"Base text (NA28): {variants['base_text']}") print(f"Total variations: {variants['total_variations']}") print(f"Has meaningful variants: {variants['has_meaningful_variants']}") for v in variants['variations']: print(f"\n Location: {v['location']}") print(f" Type: {v['type']}") print(f" Affects meaning: {v['affects_meaning']}") for reading in v['readings']: print(f" {reading['type']:10s}: \"{reading['text']}\"" print(f" witnesses: {reading['witnesses']}") print(f" text_type: {reading['text_type']}") ``` ### Response - **reference** (string) - The biblical reference. - **base_text** (string) - The base text of the passage (e.g., NA28). - **total_variations** (integer) - The total number of variations found in the passage. - **has_meaningful_variants** (boolean) - Indicates if any variants affect the translation meaning. - **variations** (list of dict) - A list of variation units. - **location** (string) - The location of the variation within the verse (e.g., "word 2"). - **type** (string) - The type of variation (e.g., "ancient_only"). - **affects_meaning** (boolean) - True if the variant affects the translation meaning, False otherwise. - **readings** (list of dict) - A list of competing readings for this variation unit. - **text** (string) - The text of the reading. - **type** (string) - The type of reading (e.g., "primary", "variant"). - **witnesses** (list of string) - The manuscripts or editions supporting this reading. - **text_type** (string) - The text-type classification (e.g., "alexandrian", "byzantine"). ### Response Example ```json { "reference": "Mark 16:9", "base_text": "Ἀναστὰς δὲ πρωῒ ...", "total_variations": 3, "has_meaningful_variants": True, "variations": [ { "location": "word 2", "type": "ancient_only", "affects_meaning": True, "readings": [ {"text": "δέ", "type": "primary", "witnesses": ["NA28", "SBL"], "text_type": "alexandrian"}, {"text": "τε", "type": "variant", "witnesses": ["TR", "Byz"], "text_type": "byzantine"} ] } ] } ``` ``` -------------------------------- ### Programmatic Passage Analysis with Translations, Morphology, and Variants Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt This Python code demonstrates programmatic usage equivalent to the analyze_passage.py script. It retrieves translations, parses verse morphology, and fetches meaningful textual variants. Set the TF_SILENT environment variable to suppress Text-Fabric progress output. ```python import os os.environ['TF_SILENT'] = 'deep' # suppress Text-Fabric progress output from textual_criticism_mcp.lib.corpus import parse_verse from textual_criticism_mcp.lib.translations import get_passage from textual_criticism_mcp.lib.apparatus import get_variants ref = "John 3:16" # Translations trans_result = get_passage(ref, ['KJV', 'WEB']) for t, d in trans_result['translations'].items(): print(f"{t}: {d['text']}") # Morphology table verse = parse_verse(ref, 'full') for w in verse.words: morph = " ".join(filter(None, [w.pos, w.tense, w.voice, w.mood, w.case, w.number, w.gender])) print(f"{w.text:<18} {w.lemma:<15} {(w.gloss or '')[:20]:<22} {morph}") # Variants (meaningful only) variants_result = get_variants(ref, 'meaningful') print(f"Variation units: {variants_result.get('total_variations', 0)}") ``` -------------------------------- ### Parse Verse for Morphological Analysis Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Loads a specified verse from the BHSA (Hebrew OT) or N1904 (Greek NT) corpus. The `detail_level` parameter controls the amount of morphological data returned. Use 'basic' for text and POS, 'full' for all morphology, or 'syntax' for phrase function and clause type. ```python from textual_criticism_mcp.lib.corpus import parse_verse # Greek NT verse — full morphology verse = parse_verse("John 3:16", detail_level="full") print(verse.reference) # John 3:16 print(verse.language) # Language.GREEK print(verse.text) # Οὕτως γὰρ ἠγάπησεν ὁ θεὸς τὸν κόσμον... for word in verse.words: print(f"[{word.position}] {word.text} / {word.lemma}") print(f" POS={word.pos} tense={word.tense} voice={word.voice}") print(f" mood={word.mood} case={word.case} number={word.number}") print(f" Strong's={word.strongs} gloss={word.gloss}") # Expected output (first word): # [0] Οὕτως / οὕτως # POS=adverb tense=None voice=None # mood=None case=None number=None # Strong's=G3779 gloss=thus # Hebrew OT verse — includes stem and state gen = parse_verse("Gen 1:1", detail_level="full") print(gen.language) # Language.HEBREW for word in gen.words: print(f"{word.text} | stem={word.stem} state={word.state} " f ``` -------------------------------- ### Search Morphology in Hebrew and Greek Corpora Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Searches the Hebrew or Greek corpus for words matching specific morphological criteria. All parameters are optional except for `language`. Results include reference, text, lemma, gloss, and a morphology dictionary. The `books` parameter can filter results to specific biblical books. ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager cm = get_corpus_manager() # Hebrew: all Qal imperatives (masculine plural) results = cm.search_morphology( language="hebrew", pos="verb", stem="qal", mood=None, # Hebrew mood handled differently number="plural", gender="masculine", limit=20, ) for r in results: print(f"{r['reference']:20s} {r['text']} ({r['lemma']})") print(f" stem={r['morphology']['stem']} number={r['morphology']['number']}") # Greek: aorist passive subjunctives in Paul's letters results = cm.search_morphology( language="greek", pos="verb", tense="aorist", voice="passive", mood="subjunctive", books=["Romans", "Galatians", "Ephesians", "Philippians", "Colossians", "1 Corinthians", "2 Corinthians"], limit=50, ) for r in results: print(f"{r['reference']:20s} {r['text']} lemma={r['lemma']}") # Hebrew construct nouns in Genesis results = cm.search_morphology( language="hebrew", pos="noun", state="construct", books=["Genesis"], limit=30, ) print(f"Found {len(results)} construct nouns in Genesis") # Expected result structure: # { # "reference": "Romans 6:3", # "text": "ἐβαπτίσθημεν", # "lemma": "βαπτίζω", # "gloss": "to baptize", # "morphology": { # "pos": "verb", # "tense": "aorist", # "voice": "passive", # "mood": "indicative", # "person": "1", # "number": "plural", # "gender": None, # "case": None # } # } ``` -------------------------------- ### Python Library - search_morphology Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Searches for words based on specific morphological criteria within a given language. ```APIDOC ## search_morphology ### Description Search for words based on detailed morphological criteria such as part of speech, stem, and mood. ### Method `search_morphology(language: str, pos: str, stem: str = None, mood: str = None, **kwargs) -> list` ### Parameters #### Path Parameters - **language** (str) - Required - The language of the text to search (e.g., "hebrew", "greek"). - **pos** (str) - Required - The part of speech to filter by (e.g., "verb"). - **stem** (str) - Optional - The grammatical stem to filter by (e.g., "qal"). - **mood** (str) - Optional - The grammatical mood to filter by (e.g., "imperative"). - **kwargs** - Additional keyword arguments for other morphological filters. ### Request Example ```python from textual_criticism_mcp.lib import search_morphology results = search_morphology(language="hebrew", pos="verb", stem="qal", mood="imperative") print(f"Found {len(results)} imperative verbs in Qal stem.") ``` ### Response #### Success Response (List of Words) - Returns a list of words matching the specified morphological criteria. Each item in the list may contain details like the word text, lemma, and verse reference. ### Response Example ```json [ { "text": "כתבו", "lemma": "כתב", "verse": "Jer 30:2" } // ... more results ] ``` ``` -------------------------------- ### MCP Tool: get_passage Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Integrates translation retrieval, original-language text, and apparatus into one call for comprehensive passage study. ```APIDOC ## get_passage_impl ### Description Retrieves translations, original language text, and textual apparatus for a given biblical reference. ### Method Signature `get_passage_impl(input: GetPassageInput) -> dict` ### Parameters - **input** (GetPassageInput) - Required - An object containing the parameters for the passage retrieval. - **reference** (str) - Required - The biblical reference (e.g., "Mark 1:1"). - **translations** (list[str]) - Required - A list of desired translation codes (e.g., ["KJV", "WEB"]). - **include_original** (bool) - Optional - Whether to include the original language text. - **include_apparatus** (bool) - Optional - Whether to include textual variants (apparatus). ### Response A dictionary containing the requested data: - **translations** (dict) - A dictionary where keys are translation codes and values are objects containing the translation text. - **original** (dict) - An object containing the original language text and language identifier (if `include_original` is true). - **apparatus** (dict) - An object containing textual variant information (if `include_apparatus` is true). ### Example ```python from textual_criticism_mcp.mcp.server import GetPassageInput, get_passage_impl result = get_passage_impl(GetPassageInput( reference="Mark 1:1", translations=["KJV", "WEB"], include_original=True, include_apparatus=True, )) # Translations for trans, data in result['translations'].items(): print(f"{trans}: {data['text']}") # Original Greek print(result['original']['text']) print(result['original']['language']) # Apparatus app = result['apparatus'] print(f"Variations: {app['total_variations']}") for v in app['variations']: print(f" {v['location']}: {[r['text'] for r in v['readings']]}") ``` ``` -------------------------------- ### CorpusManager Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Provides direct access to Text-Fabric corpora for raw API operations. It manages lazy loading of Hebrew and Greek corpora and offers methods for searching morphology and performing general searches. It can also be initialized with a custom data directory. ```APIDOC ## `CorpusManager` — Direct Text-Fabric Corpus Access The `CorpusManager` class manages lazy loading of the Hebrew and Greek corpora and provides the `search_morphology` and `search` methods. Access corpora directly for raw Text-Fabric API operations. ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager cm = get_corpus_manager() # singleton; corpora load on first access # Access raw Text-Fabric App objects hebrew_app = cm.hebrew # Downloads BHSA ~300 MB on first use greek_app = cm.greek # Downloads N1904 ~100 MB on first use # Low-level Text-Fabric search results = cm.search("word sp=verb vs=qal", corpus="hebrew", limit=20) print(f"Found {len(results)} results") # Use the corpus manager from a custom data directory from pathlib import Path from textual_criticism_mcp.lib.corpus import CorpusManager custom_cm = CorpusManager(data_dir=Path("/data/tf-corpora")) verse = custom_cm.parse_verse("Psalms 23:1", detail_level="basic") print(verse.text) ``` ``` -------------------------------- ### Type check textual-criticism-mcp code Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Command to perform static type checking on the Python source code of the textual-criticism-mcp project using mypy. ```bash mypy src/textual_criticism_mcp ``` -------------------------------- ### Retrieve Passage with Original Text and Apparatus using get_passage_impl Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt The get_passage_impl function integrates translation retrieval, original-language text, and apparatus into a single call. This is useful for comprehensive passage study in an AI context. Ensure GetPassageInput is correctly configured. ```python from textual_criticism_mcp.mcp.server import GetPassageInput, get_passage_impl result = get_passage_impl(GetPassageInput( reference="Mark 1:1", translations=["KJV", "WEB"], include_original=True, include_apparatus=True, )) # Translations for trans, data in result['translations'].items(): print(f"{trans}: {data['text']}") # Original Greek print(result['original']['text']) # Ἀρχὴ τοῦ εὐαγγελίου Ἰησοῦ Χριστοῦ... print(result['original']['language']) # "greek" # Apparatus app = result['apparatus'] print(f"Variations: {app['total_variations']}") for v in app['variations']: print(f" {v['location']}: {[r['text'] for r in v['readings']]}") ``` -------------------------------- ### Access Text-Fabric Corpora Directly Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt The `CorpusManager` class provides lazy loading for Hebrew and Greek corpora, enabling direct access to raw Text-Fabric API operations. It can also be initialized with a custom data directory for corpora. ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager cm = get_corpus_manager() # singleton; corpora load on first access # Access raw Text-Fabric App objects hebrew_app = cm.hebrew # Downloads BHSA ~300 MB on first use greek_app = cm.greek # Downloads N1904 ~100 MB on first use # Low-level Text-Fabric search results = cm.search("word sp=verb vs=qal", corpus="hebrew", limit=20) print(f"Found {len(results)} results") # Use the corpus manager from a custom data directory from pathlib import Path from textual_criticism_mcp.lib.corpus import CorpusManager custom_cm = CorpusManager(data_dir=Path("/data/tf-corpora")) verse = custom_cm.parse_verse("Psalms 23:1", detail_level="basic") print(verse.text) ``` -------------------------------- ### search_morphology Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Searches the Hebrew or Greek corpus for words matching specified morphological criteria. It returns results including reference, text, lemma, gloss, and a morphology dictionary. All parameters are optional except for `language`. ```APIDOC ## `search_morphology` — Grammar-Filtered Word Search Searches the Hebrew or Greek corpus for all words matching a combination of morphological criteria. All parameters are optional — only the `language` argument is required. Results include reference, surface text, lemma, gloss, and a morphology dict. ```python from textual_criticism_mcp.lib.corpus import get_corpus_manager cm = get_corpus_manager() # Hebrew: all Qal imperatives (masculine plural) results = cm.search_morphology( language="hebrew", pos="verb", stem="qal", mood=None, # Hebrew mood handled differently number="plural", gender="masculine", limit=20, ) for r in results: print(f"{r['reference']:20s} {r['text']} ({r['lemma']})") print(f" stem={r['morphology']['stem']} number={r['morphology']['number']}") # Greek: aorist passive subjunctives in Paul's letters results = cm.search_morphology( language="greek", pos="verb", tense="aorist", voice="passive", mood="subjunctive", books=["Romans", "Galatians", "Ephesians", "Philippians", "Colossians", "1 Corinthians", "2 Corinthians"], limit=50, ) for r in results: print(f"{r['reference']:20s} {r['text']} lemma={r['lemma']}") # Hebrew construct nouns in Genesis results = cm.search_morphology( language="hebrew", pos="noun", state="construct", books=["Genesis"], limit=30, ) print(f"Found {len(results)} construct nouns in Genesis") # Expected result structure: # { # "reference": "Romans 6:3", # "text": "ἐβαπτίσθημεν", # "lemma": "βαπτίζω", # "gloss": "to baptize", # "morphology": { # "pos": "verb", # "tense": "aorist", # "voice": "passive", # "mood": "indicative", # "person": "1", # "number": "plural", # "gender": None, # "case": None # } # } ``` ``` -------------------------------- ### Python Library - parse_verse Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Parses a given biblical verse and returns a detailed word-by-word breakdown including morphology and syntax. ```APIDOC ## parse_verse ### Description Parse a verse with complete morphological analysis, including original text, transliteration, lemma, Strong's number, full morphological parsing, and syntactic information. ### Method `parse_verse(verse: str, detail_level: str = "morphology") -> Verse` ### Parameters #### Path Parameters - **verse** (str) - Required - The biblical verse to parse (e.g., "John 3:16"). - **detail_level** (str) - Optional - The level of detail to return. Options include "morphology" and "syntax". Defaults to "morphology". ### Request Example ```python from textual_criticism_mcp.lib import parse_verse verse_data = parse_verse("Gen 1:1", detail_level="syntax") for word in verse_data.words: print(f"{word.text} ({word.lemma}) - {word.pos}") ``` ### Response #### Success Response (Verse Object) - **words** (list) - A list of Word objects, each containing detailed information about a word in the verse. - **text** (str) - The original text of the word. - **transliteration** (str) - The transliteration of the word. - **lemma** (str) - The lemma (base form) of the word. - **strongs_number** (str) - The Strong's number associated with the word. - **pos** (str) - Part of speech. - **person** (str) - Grammatical person. - **gender** (str) - Grammatical gender. - **number** (str) - Grammatical number. - **tense** (str) - Grammatical tense. - **voice** (str) - Grammatical voice. - **mood** (str) - Grammatical mood. - **case** (str) - Grammatical case. - **state** (str) - Grammatical state. - **stem** (str) - Grammatical stem. - **phrase_function** (str) - Syntactic phrase function. - **clause_type** (str) - Syntactic clause type. ### Response Example ```json { "words": [ { "text": "In", "transliteration": "", "lemma": "", "strongs_number": "", "pos": "prep", "person": null, "gender": null, "number": null, "tense": null, "voice": null, "mood": null, "case": "acc", "state": null, "stem": null, "phrase_function": "prep", "clause_type": null } // ... more words ] } ``` ``` -------------------------------- ### analyze_passage.py Script - CLI Usage Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt A command-line script to generate a formatted console report for passage analysis, including translations, morphology, and textual variants. ```APIDOC ## analyze_passage.py (CLI) ### Description Analyzes a biblical passage and outputs a formatted console report including translations, morphological data, and textual variants. ### Usage ```bash # Analyze a single verse python scripts/analyze_passage.py "John 1:1" # Analyze multiple verses python scripts/analyze_passage.py "Mark 16:9" "1 John 5:7" "Romans 3:23" ``` ``` -------------------------------- ### parse_verse Source: https://context7.com/noveltydreams/textual-criticism-mcp/llms.txt Loads a specified Text-Fabric corpus (BHSA for Hebrew OT, N1904 for Greek NT), finds a given verse, and returns detailed information about its words. The `detail_level` parameter can be set to 'basic', 'full', or 'syntax' to control the amount of morphological and syntactic data returned. ```APIDOC ## `parse_verse` — Morphological Analysis of a Single Verse Loads the appropriate Text-Fabric corpus (BHSA for Hebrew OT, N1904 for Greek NT), finds the verse, and returns a `VerseInfo` with a list of `WordInfo` objects carrying text, transliteration, lemma, Strong's number, gloss, and full morphological tags. The `detail_level` parameter controls how much data is returned: `"basic"` (text + POS only), `"full"` (all morphology), or `"syntax"` (adds phrase function and clause type). ```python from textual_criticism_mcp.lib.corpus import parse_verse # Greek NT verse — full morphology verse = parse_verse("John 3:16", detail_level="full") print(verse.reference) # John 3:16 print(verse.language) # Language.GREEK print(verse.text) # Οὕτως γὰρ ἠγάπησεν ὁ θεὸς τὸν κόσμον... for word in verse.words: print(f"[{word.position}] {word.text} / {word.lemma}") print(f" POS={word.pos} tense={word.tense} voice={word.voice}") print(f" mood={word.mood} case={word.case} number={word.number}") print(f" Strong's={word.strongs} gloss={word.gloss}") # Expected output (first word): # [0] Οὕτως / οὕτως # POS=adverb tense=None voice=None # mood=None case=None number=None # Strong's=G3779 gloss=thus # Hebrew OT verse — includes stem and state gen = parse_verse("Gen 1:1", detail_level="full") print(gen.language) # Language.HEBREW for word in gen.words: print(f"{word.text} | stem={word.stem} state={word.state} " f ``` ```APIDOC gender={word.gender} number={word.number}") # Syntactic analysis jn_syntax = parse_verse("John 1:1", detail_level="syntax") for word in jn_syntax.words: print(f"{word.text}: phrase_function={word.phrase_function}, " f ``` ```APIDOC clause_type={word.clause_type}") ``` ``` -------------------------------- ### Python Library - get_variants Source: https://github.com/noveltydreams/textual-criticism-mcp/blob/main/README.md Retrieves textual variants for a specified biblical passage, with options to include manuscript and edition support. ```APIDOC ## get_variants ### Description Get textual variants for a given passage, including information about manuscript and edition support, as well as variant classification. ### Method `get_variants(passage: str, include_manuscripts: bool = False) -> VariantInfo` ### Parameters #### Path Parameters - **passage** (str) - Required - The biblical passage to retrieve variants for (e.g., "Mark 16:9-20"). - **include_manuscripts** (bool) - Optional - Whether to include detailed manuscript support in the results. Defaults to `False`. ### Request Example ```python from textual_criticism_mcp.lib import get_variants variants = get_variants("Mark 16:9-20", include_manuscripts=True) print(variants) ``` ### Response #### Success Response (VariantInfo Object) - **variants** (list) - A list of variant readings for the passage. - **manuscript_support** (dict) - Information about manuscript support for variants (if `include_manuscripts` is True). - **edition_support** (dict) - Information about support in different critical editions (e.g., NA28, SBLGNT). - **classification** (dict) - Analysis of variant classifications and transcriptional units. ### Response Example ```json { "variants": [ { "text": "...", "witnesses": "א, B, W, 33, ..." } ], "manuscript_support": { "P46": { "variants": ["..."], "support_level": "high" } // ... more manuscripts }, "edition_support": { "NA28": "variant_id", "SBLGNT": "variant_id" }, "classification": { "variant_id": { "type": "orthographic", "description": "..." } } } ``` ```