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 uses pydantic-settings to load configuration from .env.{ENVIRONMENT} files — for example, .env.development or .env.production. The active file is resolved from the ENVIRONMENT environment variable at import time, before any module-level constants are evaluated.

Environment Files

Start by copying the provided example file:
cp .env.example .env.development
# Edit .env.development with your project values
Files are resolved in this order at startup:
  1. .env.{ENVIRONMENT} — the file matching the current ENVIRONMENT value (e.g. .env.production)
  2. .env.development — the fallback when the named file does not exist on disk
This means you can maintain separate credential sets for each environment without changing any code.

All Environment Variables

VariableRequiredDescription
SUPABASE_URLAuth onlySupabase project URL (e.g. https://<ref>.supabase.co). Stored in settings.supabase_url; for local OrbStack setups the internal client URL is constructed from PROJECT_REF instead.
SUPABASE_ANON_KEYAuth onlyPublic/anonymous API key for client-side operations
SUPABASE_SERVICE_ROLE_KEYAuth onlyService-role key used by the server-side client (bypasses RLS). Maps to SUPABASE_SECRET_KEY in the Settings class.
SUPABASE_STORAGE_BUCKETAuth onlyStorage bucket name for file uploads
DATABASE_URLAuth onlyFull PostgreSQL connection URL
DATASETS_BASE_PATHOptionalBase directory path for local dataset files
ENVIRONMENTOptionalActive environment name: development, staging, or production
CORS_ORIGINSOptionalComma-separated list of allowed CORS origins
OPEN_AI_KEYOptionalOpenAI API key for AI-powered features

MCP Server: No Auth Required

The cf-mcp server reads corpora from the --corpus flag only and does not use Supabase at runtime. Supabase environment variables are not required to run the MCP server.
uv run cf-mcp --corpus /data/BHSA

Setting the Active Environment

Pass ENVIRONMENT inline or export it before running any command:
# Inline — uses .env.production
ENVIRONMENT=production uv run cf-mcp --corpus /data/BHSA

# Shell export — applies to the current session
export ENVIRONMENT=staging
uv run your-script.py
SUPABASE_SERVICE_ROLE_KEY grants elevated database access and bypasses Row Level Security. Never expose it in client-side code, public repositories, or any environment where untrusted users can read process variables. Use it exclusively in server-side or backend contexts.

Build docs developers (and LLMs) love