Code Context Engine logo

Code Context Engine

Indexes local codebases so AI coding agents can retrieve relevant context without rereading entire files.

Install Code Context Engine

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "code-context-engine": {
      "command": "uvx",
      "args": [
        "code-context-engine"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio code-context-engine -- uvx code-context-engine

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

uvx code-context-engine

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

Code Context Engine MCP server indexes a local codebase and lets supported AI coding clients retrieve relevant context through MCP. The `cce init` command installs the package, builds an index, and writes client-specific configuration and instruction files. It runs locally without cloud indexing, supports optional local embeddings or detected Ollama, and records token and cost savings. Reach for it when repeated codebase reading is increasing latency, context usage, or session costs.

Use cases

  • Search a local codebase through an AI coding agent
  • Reduce repeated file rereading and input-token usage
  • Preserve coding decisions across sessions
  • Compare estimated token and model-cost savings
  • Configure one project for multiple coding clients

Key features

  • Local codebase indexing
  • Context search through MCP
  • Cross-session context retention
  • Token and cost savings reporting
  • Ollama and local embedding support
  • Automatic client configuration

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

34/35 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · code-context-engine (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars472Stargazers on the source repository.
Last commit3mo agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Code Context Engine works

What Code Context Engine MCP server does

Code Context Engine MCP server creates a searchable index of a project so an AI coding agent can request focused code context rather than repeatedly loading complete files. The project describes a 94% reduction in input tokens in its FastAPI benchmark, but actual savings depend on the repository and query pattern.

The index is intended for local development. It can help agents find functions, trace areas of a codebase, and retain decisions or context between sessions. A local savings display reports query counts, token reductions, and estimated dollar savings. Pricing estimates can account for Anthropic, OpenAI, and Google models.

How it works

The cce init command combines installation, indexing, and client configuration. It detects supported editors or can target a specific agent with an --agent option. Configuration is written for the selected project or, for Codex, to the user-level configuration with a project-specific section.

Code Context Engine MCP server uses a local index and does not send the indexed code to a cloud indexing service. Installing the [local] extra provides the local embedding setup. If Ollama is already running on its default local address, the package can detect it and use the nomic-embed-text model instead.

After setup, an MCP-capable client can use the indexed project through context_search. The client then receives narrower results for questions about the codebase instead of needing to reread broad file ranges. Cross-session context and decisions are stored locally for later use.

Setup and configuration

Python 3.11 or newer is required, along with a C compiler for the tree-sitter grammars.

A quick installation uses:

bash
uvx --from "code-context-engine[local]" cce init

For a persistent installation, use uv tool install or pipx install, change to the project directory, and run cce init. Restart the editor after configuration. The command can write settings for Claude Code, VS Code or Copilot, Cursor, Gemini CLI, Codex, OpenCode, Tabnine, and Pi. Pi requires a separate MCP adapter because it does not support MCP natively.

Pricing settings are stored in ~/.cce/config.yaml, including the model used for savings estimates. cce init --plugin can also generate a portable Agent Plugin directory that launches the package with uvx.

Tools and capabilities

  • Indexes a local project for code retrieval.
  • Provides the context_search capability to query indexed code context.
  • Preserves decisions and context across agent sessions.
  • Reports retrieval, compression, token, and estimated cost savings.
  • Supports local embedding setup and Ollama detection.
  • Generates configuration for several supported coding clients.

Limitations and notes

The tool requires local build dependencies in addition to Python. Its reported savings are estimates based on configured model pricing, while the published 94% figure comes from a specific FastAPI benchmark. Pi needs an adapter extension before it can consume the generated MCP configuration. Codex reads MCP settings from ~/.codex/config.toml, so its project entries are managed there rather than in a project-local file.

The repository is licensed under MIT.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Code Context Engine

Code Context Engine is an MCP server that connects an AI coding client to a locally indexed codebase. Its main tool is context_search, which retrieves relevant code context instead of requiring full files to be reread. It also preserves decisions and context across sessions and reports token and cost savings.

Run `uvx --from "code-context-engine[local]" cce init` from the project workflow. The command installs the package, indexes the project, and writes client configuration. Persistent alternatives are `uv tool install` or `pipx install`, followed by `cce init` in the project directory.

Yes, Code Context Engine supports Cursor. Running `cce init` can write `.cursor/mcp.json` and a `.cursorrules` file for the project. Use `--agent` to target a specific client, then restart Cursor after setup.

Install the `[local]` extra for local embeddings, or use an Ollama instance detected at `localhost:11434`; the documented fallback uses the `nomic-embed-text` model.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCode Context Engine AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/code-context-engine?style=directory)](https://allmcps.com/mcp/code-context-engine)
HTML Embed
<a href="https://allmcps.com/mcp/code-context-engine"><img src="https://allmcps.com/api/badge/code-context-engine?style=directory" alt="Code Context Engine on AllMCPs" /></a>