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.

The cf-mcp command starts a FastMCP 2 server that exposes 11 corpus query tools to any MCP-compatible AI client. Assistants like Claude and GPT can use these tools to search annotated religious texts, retrieve passages, inspect node features, and paginate large result sets — all through the Model Context Protocol without writing a single line of Python.

The 11 Tools

CategoryToolDescription
Discoverylist_corporaList loaded corpora and the active one
Discoverydescribe_corpusNode types with counts, section hierarchy
Discoverylist_featuresBrowse features, filter by node type
Discoverydescribe_featureMetadata + top values by frequency
Discoveryget_text_formatsAvailable text encodings with samples
SearchsearchPattern search — results / count / statistics / passages
Searchsearch_continuePaginate large result sets via cursor
Searchsearch_csvExport results to a local CSV file
Searchsearch_syntax_guideInline query syntax documentation
Dataget_passagesRetrieve text by section reference
Dataget_node_featuresBatch feature lookup for a list of nodes

Starting the Server

Pass at least one --corpus flag pointing to a local corpus directory. The server defaults to stdio transport, which is the right choice for Claude Desktop and other local MCP clients.
# stdio — for Claude Desktop and other local MCP clients
uv run cf-mcp --corpus ~/.exegia/datasets/bibles/BHSA

# SSE on port 8000 — for remote/desktop app connections
uv run cf-mcp --corpus ~/.exegia/datasets/bibles/BHSA --sse 8000

# Streamable HTTP on port 8000
uv run cf-mcp --corpus ~/.exegia/datasets/bibles/BHSA --http 8000

Server Instructions

When a client first connects, the server sends this instruction string to orient the AI agent:
“Query annotated text corpora via Context-Fabric. Start with describe_corpus() to understand the structure, then list_features() to see what data is available, then search() with a template to find patterns, then get_passages() to read the matching text.”
This primes the agent with the recommended discovery-first workflow before it makes any tool calls.

Programmatic Use

You can embed the MCP server directly in a Python script by importing mcp and corpus_manager from the exegia.mcp package:
from exegia.mcp import mcp, corpus_manager

corpus_manager.load("~/.exegia/datasets/bibles/BHSA", name="BHSA")
mcp.run(transport="sse", host="localhost", port=8000)
corpus_manager.load() resolves the path, loads the corpus via Context-Fabric, and registers it as the default. Calling mcp.run() blocks and serves requests until the process is terminated.

Transports

stdio, SSE, and streamable HTTP — when to use each and how to configure them.

Multi-Corpus

Load multiple named corpora in one server session and switch between them.

AI Workflow

The recommended six-step sequence for AI agents exploring a corpus.

Search Tool

Full reference for the search() tool and its return types.

Build docs developers (and LLMs) love