MCP Catalogs
首页code-context-engine screenshot

code-context-engine

by elara-labs·120·综合分 47

本地 MCP 服务器,通过语义搜索和压缩将代码库索引,减少 94% 的 AI 消耗。

developer-toolsai-llmproductivity
16
Forks
21
活跃 Issue
本月
最近提交
2 天前
收录于

概述

Code Context Engine 是一个基于 Python 的 MCP 服务器,它会创建代码库的可搜索索引,使 AI 编码助手能够检索相关代码片段,而不是读取整个文件。它在保持所有数据本地化的同时提供显著的代币节省(根据他们的基准为 94%)。该服务器提供 9 个 MCP 工具,用于上下文搜索、会话回溯和索引管理,可与多个 AI 编码环境一起使用,如 Claude Code、VS Code、Cursor 和 Gemini CLI。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:将 Claude Code 和其他 AI 编码助手的成本降低高达 94%
:为 AI 编码代理维护跨会话记忆和上下文
:通过本地索引而非云解决方案保持代码私密性
:CCE 支持哪些嵌入后端?
:CCE 是否能同时与多个 AI 编码助手一起工作?

什么时候选它

如果您使用 Claude Code 或其他 AI 编码工具,并且希望在保持所有代码索引私密和本地的同时显著减少令牌使用,请选择此方案。

什么时候不要选它

如果您需要写入代码库权限(此为只读)或更喜欢提供令牌减少之外协作功能的云解决方案,请避免使用。

此 server 暴露的工具

从 README 抽取出 9 个工具
  • context_search

    Hybrid vector + BM25 search with graph expansion to find relevant code chunks

  • expand_chunk

    Retrieve full source code for a compressed result

  • related_context

    Find code related via graph edges (calls, imports)

  • session_recall

    Recall decisions and context from past sessions

  • record_decision

    Save a decision for future reference

  • record_code_area

    Record which files were worked on for future reference

  • index_status

    Check the freshness and status of the code index

  • reindex

    Re-index a specific file or the entire project

  • set_output_compression

    Adjust response verbosity level

可对比工具

continue-devcursor-indexlocal-mcp-servergreptile

安装

# 使用 uv 安装
uv tool install code-context-engine

# 或使用 pipx
pipx install code-context-engine

# 初始化你的项目
cd /path/to/your/project
cce init                              # 或者:cce init --agent all

对于 Claude Desktop 集成,添加到 Claude Desktop 配置:

{
  "mcpServers": {
    "code-context-engine": {
      "command": "uv",
      "args": ["run", "code-context-engine", "mcp"]
    }
  }
}

FAQ

CCE 支持哪些嵌入后端?
CCE 会自动检测最佳可用后端。当 Ollama 运行时,它使用 nomic-embed-text;或者当您安装 [local] 额外包时,包含 fastembed + ONNX Runtime 用于本地离线嵌入。
CCE 是否能同时与多个 AI 编码助手一起工作?
是的。CCE 可以对您的代码库进行一次索引,然后同时与 Claude Code、VS Code、Cursor、Gemini CLI、Codex CLI、OpenCode 和 Tabnine 一起工作,只需单个索引。

code-context-engine 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。