Code Context Engine exposes a JSON-RPC MCP server over standard input and output.
context mcp-stdio
Example MCP client configuration:
{
"mcpServers": {
"code-context-engine": {
"command": "/absolute/path/to/context",
"args": ["mcp-stdio"]
}
}
}Use /absolute/path/to/context.exe on Windows. If the executable is on PATH,
use context as the command. MCP clients use different outer configuration
formats, but the command and arguments remain the same.
For development directly from the source workspace:
{
"mcpServers": {
"code-context-engine": {
"command": "cargo",
"args": [
"run",
"--manifest-path",
"/absolute/path/to/code-context-engine/Cargo.toml",
"-p",
"context-cli",
"--",
"mcp-stdio"
]
}
}
}A release binary is preferable for normal use because unrelated source changes cannot prevent the MCP server from starting.
PowerShell:
@(
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}',
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
) | & "C:\absolute\path\to\context.exe" mcp-stdioLinux or macOS:
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' |
/absolute/path/to/context mcp-stdioThe initialize response should identify code-context-engine. The tool list
should include index_repo, search_code, get_chunk,
pre_change_context, and post_change_impact.
- Call
index_repowith an existing local directory and a writable SQLite file path. - Call
pre_change_contextbefore a non-trivial edit. - Inspect metadata and fetch selected exact source with
get_chunk. - Make the edit with normal file and development tools.
- Run project tests and static checks.
- Call
post_change_impactwith unified Git diff text when available.
Use memory_add for durable project decisions and invariants, not transient
task notes. Run memory_reconcile after major moves or refactors.
repois a local directory. It does not need to be a Git repository.- Absolute paths avoid ambiguity about the MCP client's working directory.
dbmust be a file-backed SQLite path.- A single database may contain multiple repositories.
- Pass
repoto repository-scoped context and memory calls when sharing a database.
Basic indexing and heuristic graph analysis work without external providers. Optional compiler or type-checker providers can add higher-confidence reference edges when their underlying tools are installed:
- Rust: rust-analyzer SCIP
- Java: scip-java
- TypeScript/TSX: TypeScript compiler and language-service API
- Python: Pyright and pyright-langserver
Inspect provider_diagnostics after indexing. Do not silently ignore a failed
strict provider.
The built-in graph provider is heuristic. Its reference and impact results are investigation guidance and do not prove that every dependency or affected test has been found.