Code Context Engine is a local-first code index and MCP server for AI coding agents. It indexes a local repository, returns compact context before an edit, fetches exact source on demand, and reports likely impact afterward.
Source code stays on the local machine unless an optional external provider is configured to do otherwise.
- Indexes Rust, Java, TypeScript/TSX, and Python source.
- Stores chunks, symbols, graph edges, search data, and project memories in file-backed SQLite storage.
- Provides lexical search, deterministic local hash-vector search, reference lookup, context expansion, and impact analysis.
- Exposes the workflow through both a
contextCLI and an MCP stdio server. - Supports optional compiler or type-checker reference providers.
- Runs without Java, Node.js, Python, or external providers for the basic local indexing workflow.
- Open GitHub Releases.
- Download the archive matching your operating system and architecture.
- Extract the archive.
- Run
context --helpon Linux/macOS orcontext.exe --helpon Windows.
Each archive has a matching .sha256 file. See
Installation for checksum commands and PATH setup.
Install stable Rust, clone this repository, and run:
cargo build --locked --release -p context-cliThe executable is written to target/release/context on Linux/macOS or
target/release/context.exe on Windows.
You can also install it into Cargo's binary directory:
cargo install --locked --path crates/context-cliIndex a local project into a file-backed SQLite database:
context index --repo /absolute/path/to/project --db /absolute/path/to/project/.context/code-index.sqliteSearch the index:
context search --db /absolute/path/to/project/.context/code-index.sqlite --query "authentication middleware" --limit 10Gather context before editing:
context pre-change-context --repo /absolute/path/to/project --db /absolute/path/to/project/.context/code-index.sqlite --task "change authentication middleware" --limit 10 --depth 1Use context get-chunk with a returned chunk ID when exact source text is
needed. Run context post-change-impact after the edit to inspect likely
affected symbols and recommended tests.
On Windows, absolute paths such as C:\work\project are accepted. Quote paths
that contain spaces.
The MCP entry point is:
context mcp-stdioExample MCP client configuration:
{
"mcpServers": {
"code-context-engine": {
"command": "/absolute/path/to/context",
"args": ["mcp-stdio"]
}
}
}Use context.exe on Windows. If the executable is already on PATH, the
command may simply be context. See MCP setup for smoke
tests, path guidance, and the recommended AI workflow.
- Run
index_repofor the local repository and a file-backed SQLite path. - Run
pre_change_contextbefore a non-trivial edit. - Fetch selected source with
get_chunk. - Edit with normal development tools and run the project's tests.
- Run
post_change_impactwith the Git diff or explicit changed files.
Built-in graph evidence is heuristic. Treat it as investigation guidance, not as proof that every dependency has been found.
Run the public quality gates from the workspace root:
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspaceGitHub Actions runs these checks on pushes and pull requests. Tags matching
v* build downloadable Windows, Linux, and macOS release archives.