# Code Context Engine

> Index your codebase so AI can search relevant code.

- **URL**: https://followmcp.com/en/servers/code-context-engine
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 472
- **FMRS Score**: 52/100 (Grade D)
- **Source**: https://github.com/elara-labs/code-context-engine
- **Transports**: stdio (local process)
- **Runtimes**: Python 3.11+
- **Auth**: No credential needed

## Overview
Code Context Engine (CCE) is a local MCP server that indexes a codebase so AI agents can search relevant code chunks instead of repeatedly reading whole files. It provides hybrid vector and BM25 search, code relationship expansion, cross-session memory, and index management, and tracks token savings. The project reports 94% fewer retrieval tokens than reading relevant full files in its FastAPI benchmark; actual savings depend on usage.

## Best for
- AI coding users who want a local code index searchable through MCP.
- Teams using a README-listed editor or agent and able to install Python 3.11+ and the required build tools.
- Projects that benefit from cross-session decision records and index freshness checks.

## Not for
- Users who need a hosted cloud index or a remotely shared team index; the material describes local indexing.
- Users who do not want to install a local runtime, build tools, or an embedding model.
- Users who require a guarantee of exactly 94% token savings in their workflow; that figure uses full-file reads as its baseline, and the README says savings against normal Claude Code exploration will be lower.

## Required permissions
- Needs access to read project files selected for indexing. The README says files such as .env, *.pem, and credentials.json are not indexed and describes credential scanning.
- Initialization writes MCP configuration and instruction files for the selected client or project; Codex configuration is written to the user-level ~/.codex/config.toml.
- Stores the index, session memory, and token-savings records locally; the material describes SQLite storage.
- The local embedding option downloads a model and runs it on CPU; the material also describes using local Ollama.

## Risks
- The local index and memory contain project context. The material describes filtering selected secrets and scrubbing personal information from memory, but does not establish that every sensitive value will be detected.
- The 94% retrieval-savings figure is measured against reading all relevant full files, not ordinary agent exploration.
- Recall@10 varies by benchmark project; README examples range from 0.07 to 1.00.
- Installing the local extra uses disk space; the README estimates about 189 MB for that install plus an approximately 60 MB embedding-model download.

## Client config (JSON)
```json
{"mcpServers":{"code-context-engine":{"command":"uvx","args":["--from","code-context-engine[local]","cce","serve"]}}}
```

## Tools (11)
- `context_search`: Searches relevant code with hybrid vector and BM25 retrieval, with optional graph expansion.
- `expand_chunk`: Returns the full source for a compressed search result.
- `related_context`: Finds related code through relationships such as calls and imports.
- `session_recall`: Recalls decisions and context recorded in previous sessions.
- `session_timeline`: Walks session turn summaries to investigate recall results.
- `session_event`: Inspects raw tool input and output for a specific event.
- `record_decision`: Saves a decision for use in future sessions.
- `record_code_area`: Records the code areas worked on in a session.
- `index_status`: Checks whether the index is up to date.
- `reindex`: Re-indexes a file or the full project.
- `set_output_compression`: Adjusts response verbosity: off, lite, standard, or max.
