# Code Context Engine

A local index of your codebase so the agent searches it instead of re-reading files. Cuts input tokens on long sessions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 437
- Author: elara-labs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/elara-labs/code-context-engine
- Updated: 2026-08-23
- HTML: https://affpapa.org/en/nevibecode/mcp/code-context-engine

## What it does

Code Context Engine indexes your project and lets the agent query that index rather than pulling whole files into context. Everything runs locally — no cloud indexing. The claimed saving is 94% of input tokens, and it comes from a benchmark rather than a guess.

Setup is one command: `uvx --from "code-context-engine[local]" cce init` installs, indexes and configures in one shot. `cce init` detects your editor and writes the right config — `.mcp.json` plus `CLAUDE.md` for Claude, `.cursor/mcp.json` plus `.cursorrules` for Cursor. Several editors in one project all get configured in a single run. You need Python 3.11+ and a C compiler for the tree-sitter grammars: `xcode-select --install` on macOS, `build-essential` and `cmake` on Ubuntu. Without the compiler the install fails.

Already running Ollama? Skip the `[local]` extra and use `uv tool install code-context-engine`; the server finds Ollama at `localhost:11434` and uses `nomic-embed-text`. There is also `cce init --plugin`, which generates a portable Agent Plugin directory for VS Code, Cursor, Copilot, Codex, ChatGPT and Claude, launching CCE through `uvx` on demand.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add code-context-engine -- uvx code-context-engine
```
uvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>

### Codex

**Platform CLI**
```bash
codex mcp add code-context-engine -- uvx code-context-engine
```
uvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "code-context-engine": {
            "command": "uvx",
            "args": [
                "code-context-engine"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "code-context-engine": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "code-context-engine"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add code-context-engine uvx code-context-engine
```
uvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>

## When to use it
- stop paying to re-read the same files every session
- keep a project index on your machine instead of a cloud service
- configure one index for Claude, Cursor and VS Code at once
- carry decisions and context across agent restarts
- measure token spend in dollars instead of estimating it

## Example prompts
- Search the index for where auth is handled and show me those files
- What did we decide about the cache schema last session?
- Index this project and set up the MCP server for Claude

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
