Development setup
Prerequisites
- Rust 1.85 or later
- Cargo, included with Rust
Building
# Development build
cargo build
# Release build
cargo build --release
Testing
cargo test
Quality checks
# Format check
cargo fmt --check
# Lint check
cargo clippy -- -D warnings
# All quality checks
cargo check
Workspace structure
cerebro/
├── crates/
│ ├── cerebro/ # CLI tool
│ ├── cerebro-core/ # Shared types
│ ├── cerebro-mcp/ # MCP server
│ └── cerebro-tui/ # Terminal UI
├── docs/ # Documentation
└── book.toml # mdbook config
Running locally
# Build and run
cargo run -- build
# With arguments
cargo run -- build --project my-project
MCP server
The MCP server lives in crates/cerebro-mcp/ and provides standard MCP tools for querying cortex data.
Building
cargo build --release -p cerebro-mcp
The binary is output to target/release/cerebro-mcp.
Running
# Via cargo
cargo run -p cerebro-mcp
# Or directly
./target/release/cerebro-mcp
Environment variables
| Variable | Default | Description |
|---|---|---|
CORTEX_PATH | ~/Projects/cortex (MCP) / unset (CLI, TUI) | Path to the cortex data directory. Used by cerebro-mcp to read generated content; legacy fallback for cerebro/cerebro-tui config lookup. The CLI/TUI prefer the XDG config (~/.config/cerebro/config.toml) and only fall through to CORTEX_PATH if no XDG config exists. |
RUST_LOG | info | Log level: debug, info, warn, or error |