Code Context Engine — Claude Code MCP server: index your repo
A local index of your codebase so the agent searches it instead of re-reading files. Cuts input tokens on long sessions.
claude mcp add code-context-engine -- uvx code-context-engineWhat Code Context Engine 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.
What it helps with
- 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 for the agent
- 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
How to install Code Context Engine
Platform CLI
claude mcp add code-context-engine -- uvx code-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>
Platform CLI
codex mcp add code-context-engine -- uvx code-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
gemini mcp add code-context-engine uvx code-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from code-context-engine <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Code Context Engine
How do I install Code Context Engine in Claude Code?
Run claude mcp add code-context-engine -- uvx code-context-engine, then restart your editor. For indexing and config writing, cce init does both.
What does Code Context Engine do?
It builds a local index of your codebase so the agent searches it instead of re-reading files. The authors report 94% savings on input tokens.
What do I need before installing?
Python 3.11+ and a C compiler for the tree-sitter grammars. If Ollama is already running, you can skip the local extra — CCE finds it at localhost:11434.