Code Context Engine MCP
A local MCP server that indexes your code so the agent pulls the functions it needs instead of rereading whole files
- 436 ★ on the repository
- Last commit
Extended access
Why this level
- The cce init command writes configuration into the project and editors, edits instruction files such as CLAUDE.md and AGENTS.md, and installs git hooks and Claude Code lifecycle hooks
- A background process reads the whole project code and keeps embeddings and saved decisions in SQLite on disk
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/code-context-engineDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The cce init command writes configuration into the project and editors, edits instruction files such as CLAUDE.md and AGENTS.md, and installs git hooks and Claude Code lifecycle hooks
- A background process reads the whole project code and keeps embeddings and saved decisions in SQLite on disk
This is third-party code. Review the repository files before installing.
What it does
Code Context Engine, or CCE, builds a local index of the project and hands the agent 11 MCP tools. Tree-sitter splits the code into meaningful chunks: functions, classes, modules. The chunks are stored as vector embeddings together with a graph of calls and imports, and the search is hybrid, vectors plus BM25. In the example from the description, the query "payment flow" through context_search returns about 800 tokens, while reading two files whole takes about 45,000. The tools fall into three groups. Code search: context_search, related_context and expand_chunk, which expands a compressed chunk to the full source. Memory between sessions: session_recall, session_timeline, session_event, record_decision and record_code_area. A decision saved through record_decision sits in SQLite and surfaces in the next session, so you need not explain the architecture again. The rest is housekeeping: index_status, reindex and set_output_compression, which changes answer brevity from off to max. One cce init run installs the package, indexes the project, sets up git hooks and registers the MCP in the editors it finds: Claude Code, VS Code with Copilot, Cursor, Gemini CLI, Codex, OpenCode, Tabnine and Pi. cce savings shows the savings with a dollar estimate, and cce dashboard opens a web panel with charts.
Who it is for. For developers who work with Claude Code, Cursor, Codex and other agents on large repositories, want to pay less for tokens spent reading code and keep the code on their own machine.
Good fit when
- The agent rereads the same files of a large project in every session
- Several editors with agents work in one repository and need a shared index: cce init configures them all in one run
- You need memory between sessions: decisions and code areas saved through record_decision and record_code_area
- The code must not go to the cloud: the index and embeddings are built on your machine
- You want to see savings in dollars per project: cce savings --all
Not a fit when
- The repository is small and the agent reads it whole at no noticeable cost
- The machine has no Python 3.11 or C compiler: the package needs both for the tree-sitter grammars
- You work in Pi without an MCP adapter: Pi does not support MCP itself and needs the pi-mcp-adapter extension
- You want savings specifically on output tokens: CCE has response compression, but the author estimates it roughly and leaves it out of the headline number
Example request
Use context_search to find where delivery cost is calculated in this project and show the whole function without opening the entire fileMCP
- Transport
- stdio
- Authentication
- not required
Environment variables
CCE_OLLAMA_URL- Address of a remote Ollama; it overrides compression.ollama_url from the configuration.
Limitations
Python 3.11 or newer and a C compiler for the tree-sitter grammars are required: xcode-select --install on macOS, build-essential and cmake on Ubuntu. The [local] extra adds about 189 MB plus an embedding model of roughly 60 MB, and the core with Ollama takes about 17 MB. One project index weighs 5 to 60 MB. Syntax-tree parsing exists for Python, JavaScript, TypeScript, PHP, Go, Rust, Java and C#; other languages are chunked by lines and binary files are skipped. For the dollar estimate the program downloads Anthropic prices from the pricing page and caches them for seven days. Secret files such as .env and *.pem are not indexed.
How to disable. The cce uninstall command removes CCE artifacts from the project. For Codex it removes only the current project section in ~/.codex/config.toml. If the server was connected by hand, remove it from .mcp.json or your editor configuration.
FAQ
How do I connect Code Context Engine to Claude Code?
Run cce init in the project root (a one-off uvx run pulls the package itself) and restart the editor. The command detects Claude Code, writes .mcp.json and instructions into CLAUDE.md, indexes the project and installs hooks. To choose the agent by hand, use the --agent flag with claude, codex, copilot, pi or all.
What does CCE send to the cloud?
Embeddings are built locally: the [local] extra runs a fastembed model on ONNX Runtime, and without it CCE finds Ollama at localhost:11434. The only network requests fetch Anthropic prices for the dollar estimate. Secrets stay out of the index, and personal data is scrubbed from memory records.
Where does the 94% figure come from and does it hold for my project?
It was measured on FastAPI: 53 files and 20 real questions. The baseline is reading whole files, while Claude Code in practice uses grep and partial reads, so your savings will be lower. For Django, Express, chi and fiber the table shows values from 76 to 94%.
How does CCE work with Codex, which has no per-project settings?
Codex reads MCP servers only from ~/.codex/config.toml. The cce init command adds a separate [mcp_servers.cce-<project>-<hash>] section there for each project, so projects coexist. The cce uninstall command removes only the current project section.
How do I check how many tokens CCE saved?
The cce savings command shows saved tokens and dollars for the project, and with --all for every project, while cce dashboard opens a web panel. The model for price calculation is set by pricing.model in ~/.cce/config.yaml.
Discussion
No questions or reviews yet.
Related
MCP serversA skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
Karpathy-inspired Claude Code guidelines
Karpathy-Inspired Claude Code Guidelines
Four principles in one CLAUDE.md against common LLM coding mistakes: silent assumptions, overengineering, drive-by edits
A plugin and skill that makes the agent write minimal code: reuse, stdlib and native platform features come first
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Garry Tan's skill suite that turns Claude Code into a virtual team: product, architecture, design, review, QA and shipping
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Code Context Engine (this entry) | no | not required | 436 | |
| code-index-mcp | no | not required | 154 | indexes a repository with tree-sitter and offers code search and a file summary, with no session memory or savings estimate |
| Token Savior | no | not required | 1,187 | indexes code by symbol, keeps session memory and rewrites noisy Bash commands |
| Context Mode | no | not required | 31,987 | keeps large tool output out of the context window and stores session memory in SQLite |
README in short
The description opens with a slogan about 94% token savings and a reproducible benchmark on FastAPI, Django, Express, chi and fiber, where the author states what the figure is compared against. A table of editors and written configs, the list of tools, a section on how the index works, Agent Plugin generation, a command reference and the list of languages follow.