Example integrations and usage patterns for the Context Engine.
# Build a cache from markdown documentation
context build --sources ./docs --cache ./my-cache
# Query for relevant context within a 4000-token budget
context resolve --cache ./my-cache --query "how to deploy" --budget 4000
# Inspect cache metadata
context inspect --cache ./my-cacheAdd to your Claude Desktop MCP configuration:
{
"mcpServers": {
"context": {
"command": "/path/to/mcp-context-server",
"args": ["--cache-root", "/path/to/caches"]
}
}
}The server exposes three tools:
context.resolve— Query for relevant documents within a token budgetcontext.list_caches— List available context cachescontext.inspect_cache— Inspect cache metadata and validity
use context_core::{CacheReader, Scorer, Selector};
// Read a pre-built cache
let cache = CacheReader::open("./my-cache")?;
// Score documents against a query
let scored = Scorer::score(&cache, "deployment");
// Select documents within budget
let selection = Selector::select(scored, 4000);
for doc in &selection.documents {
println!("{}: {} tokens (score: {})", doc.id, doc.tokens, doc.score);
}- CI/CD integration patterns
- Multi-cache workflows
- Custom scoring pipelines
- SDK usage (JavaScript, Python)
Apache-2.0
"Context Engine" is a trademark of Context Engine Contributors. The software is open source under the MIT License. The trademark is not licensed for use by third parties to market competing products or services without prior written permission.