Code Context Engine

v0.4.13Coding Agentsstable

Save 94% on AI coding tokens. Index your codebase, agents search instead of reading files. Works with Claude Code, Codex, Copilot, Cursor, Gemini CLI. Local MCP server, free, open source.

ai-codingclaudeclaude-codecode-indexingcodex
Share:
133
Stars
0
Downloads
0
Weekly
0/5

What is Code Context Engine?

Code Context Engine is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to save 94% on ai coding tokens. index your codebase, agents search instead of reading files. works with claude code, codex, copilot, cursor, gemini cli. local mcp server, free, open source.

Save 94% on AI coding tokens. Index your codebase, agents search instead of reading files. Works with Claude Code, Codex, Copilot, Cursor, Gemini CLI. Local MCP server, free, open source.

This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Save 94% on AI coding tokens. Index your codebase, agents se

Use Cases

Index codebases to reduce AI coding tokens by 94%.
Enable semantic code search instead of file reading for faster context retrieval.
elara-labs

Maintainer

LicenseMIT
Languagepython
Versionv0.4.13
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

PIP

pip install code-context-engine

Manual Installation

pip install code-context-engine

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Code Context Engine

Code Context Engine (CCE) is a local MCP server written in Python that indexes your codebase into a hybrid vector + BM25 search index with call graph expansion, enabling AI coding agents to retrieve precise code context through semantic search instead of reading files one by one. It exposes nine MCP tools including context_search, expand_chunk, related_context, session_recall, and reindex, and integrates with Claude Code, Cursor, Gemini CLI, GitHub Copilot, OpenAI Codex, and more. By replacing broad file scanning with targeted index queries, it claims to reduce AI coding token consumption by up to 94% while keeping all data entirely local — no external API calls required.

Prerequisites

  • Python 3.10+ installed
  • uv or pipx package manager (uv recommended)
  • An AI coding agent: Claude Code, Cursor, Gemini CLI, GitHub Copilot (VS Code), or OpenAI Codex CLI
  • Optional: Ollama for the non-local embedding variant (default local install includes a bundled embedding model)
1

Install Code Context Engine

Install with uv tool install using the [local] extra to include the bundled local embedding model. This avoids needing a separate Ollama instance. You can also use pipx as an alternative.

# Recommended: includes local embedding model
uv tool install "code-context-engine[local]"

# Alternative: requires Ollama for embeddings
uv tool install code-context-engine

# Or with pipx
pipx install "code-context-engine[local]"
2

Initialize the index for your project

Navigate to your project root and run cce init. This builds the hybrid search index from your source files. The index is stored locally in a project-level directory.

cd /path/to/your/project
cce init

# Initialize and register with a specific agent
cce init --agent claude
3

Register CCE with your AI coding agent

Run cce init --agent <name> to automatically write the MCP configuration to your agent's config path and create any required instruction files (e.g., CLAUDE.md for Claude Code).

cce init --agent claude     # Claude Code → .mcp.json + CLAUDE.md
cce init --agent cursor     # Cursor → .cursor/mcp.json + .cursorrules
cce init --agent gemini     # Gemini CLI → .gemini/settings.json + GEMINI.md
cce init --agent codex      # Codex CLI → ~/.codex/config.toml + AGENTS.md
4

Check index status and verify token savings

Confirm the index is fresh and view the savings dashboard to see token and tool call reductions compared to baseline file-scanning behavior.

cce dashboard
cce savings --all
cce search "authentication flow"
5

Configure optional settings

Adjust compression level, retrieval parameters, and Ollama URL via the global config file at ~/.cce/config.yaml or project-level .context-engine.yaml.

# ~/.cce/config.yaml
compression:
  level: standard      # minimal | standard | full
  output: standard     # off | lite | standard | max

retrieval:
  top_k: 20
  confidence_threshold: 0.5

# For remote Ollama (optional):
# CCE_OLLAMA_URL=http://remote-host:11434

Code Context Engine Examples

Client configuration

After running cce init --agent claude, the .mcp.json is written automatically. The equivalent manual config for Claude Code looks like this:

{
  "mcpServers": {
    "code-context-engine": {
      "command": "cce",
      "args": ["serve"]
    }
  }
}

Prompts to try

Once CCE is indexed and registered, the AI agent uses context_search and related_context automatically. You can also ask explicitly.

- "Search the codebase for how user authentication is implemented"
- "Find all code related to the payment processing flow and show me the relevant functions"
- "What files would I need to change to add a new API endpoint?"
- "Show me the context around the database connection pooling logic"
- "What decisions were recorded in previous sessions about the auth module?"

Troubleshooting Code Context Engine

cce command not found after installation

Ensure uv's tool bin directory is in your PATH. Run uv tool dir to find the bin path, then add it to your shell profile: export PATH="$HOME/.local/bin:$PATH". Reload your shell with source ~/.zshrc or source ~/.bashrc.

Index initialization fails with embedding model errors

If you installed without the [local] extra, you need Ollama running locally. Install Ollama from ollama.ai and start it with ollama serve. Alternatively, reinstall with uv tool install "code-context-engine[local]" to use the bundled model and avoid this dependency.

AI agent still reads files with Read/grep instead of using CCE tools

Run cce init --agent <name> from your project root to ensure the agent-specific instruction file (e.g., CLAUDE.md, .cursorrules) is present. These instruction files tell the agent to prefer CCE tools over direct file access. Also verify the MCP server is listed as connected in your agent's interface.

Frequently Asked Questions about Code Context Engine

What is Code Context Engine?

Code Context Engine is a Model Context Protocol (MCP) server that save 94% on ai coding tokens. index your codebase, agents search instead of reading files. works with claude code, codex, copilot, cursor, gemini cli. local mcp server, free, open source. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Code Context Engine?

Install via pip with: pip install code-context-engine. Then configure your AI client to connect to this MCP server.

Which AI clients work with Code Context Engine?

Code Context Engine works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Code Context Engine free to use?

Yes, Code Context Engine is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Coding Agents MCP Servers

Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "code-context-engine": { "command": "pip", "args": ["install", "code-context-engine"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Code Context Engine?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides