This guide walks you through installing theDocumentation 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.
corpora-py package, downloading a Text-Fabric corpus from a public git repository, and running your first query — either through the cf-mcp server or directly from Python. By the end you will have a working MCP server ready to connect to Claude Desktop or any other MCP-compatible AI client.
Prerequisites
Context Fabric requires Python 3.13 or later and uv 0.9 or later. Verify that both are available before continuing:You will also need git on your
PATH if you plan to fetch corpus datasets directly from GitHub.Install corpora-py
Install the package into your project with This installs the
uv (recommended) or pip:cf-mcp CLI entry point along with all dependencies, including fastmcp, context-fabric, and text-fabric.Obtain a corpus
Text-Fabric datasets are stored locally under The function returns a list of
~/.exegia/datasets/. Use fetch_datasets_from_git to shallow-clone a public corpus repository and locate its TF dataset directories automatically:Path objects, each pointing to a directory that contains both otext.tf and otype.tf — the two files required by every valid TF dataset.Corpus repositories can be several hundred megabytes. The fetch is a shallow clone, so only the latest commit is downloaded. Subsequent calls for the same repository skip the download if the directory already exists.
Start the MCP server
Pass the corpus path to To start with SSE transport on port 8000 instead (useful for remote or browser-based clients):You can load multiple corpora in a single server process by repeating
cf-mcp with --corpus. The server defaults to stdio transport, which is what Claude Desktop and most MCP clients expect:--corpus and --name:For Claude Desktop, use the stdio transport (no
--sse flag) and add the cf-mcp command to your Claude Desktop MCP server configuration. The AI assistant will then have access to all 11 corpus tools automatically.Recommended AI Workflow
When an AI assistant connects to the Context Fabric MCP server, the following tool sequence gives it a solid understanding of the corpus before issuing expensive queries:describe_corpus() to see the section hierarchy (e.g. book > chapter > verse) and the count of each node type. Then call list_features() to discover what annotation columns are available — lex, pos, gloss, and so on. Once you understand the corpus structure, use search_syntax_guide() to review the template query syntax before writing your first pattern. Always call search with return_type="count" first to check how many results a template will produce before fetching the full result set.