# From backend/ directorypython -m venv .venvsource .venv/bin/activate # Windows: .venv\Scripts\activatepip install -e ".[dev]"# Copy and configure environmentcp .env.example .env# Edit .env: set SUPABASE_URL, SUPABASE_KEY, ANTHROPIC_API_KEY, MEM0_API_KEY# Optional: VOYAGE_API_KEY, VAULT_PATH, GRAPHITI_ENABLED# Apply database migrations (run in Supabase SQL editor, in order 001–016)# See: backend/supabase/migrations/
Running the MCP Server
# Local (stdio — default, used by Claude Code)python -m second_brain.mcp_server# Docker (HTTP transport)docker compose up -d# With custom transportMCP_TRANSPORT=http MCP_PORT=8000 python -m second_brain.mcp_server
# All tests (from repo root or backend/)pytest backend/tests/# Verbosepytest backend/tests/ -v -s# Single test filepytest backend/tests/test_ingest.py# With coverage (if installed)pytest backend/tests/ --cov=second_brain