DeusData/codebase-memory-mcp
High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.
這是什麼
codebase-memory-mcp 是給 AI coding agent 使用的 MCP 程式碼智慧伺服器。它不內建 LLM,而是把 repo 索引成持久化知識圖譜,讓 Claude Code、Codex CLI、Gemini CLI、Aider 等工具透過 MCP 查詢函式、類別、呼叫鏈、HTTP route、跨服務連結與基礎設施檔案。README 強調它以 tree-sitter AST 支援 158 種語言,並對 Python、TypeScript/JavaScript、PHP、C#、Go、C/C++、Java、Kotlin、Rust 加入 Hybrid LSP 式語意解析。換句話說,它想把 agent 原本反覆 grep、read file 的探索流程,變成可重用、可追溯,也比較省上下文的 結構化程式庫記憶。
為什麼上榜
這個專案今日新增 371 stars、總星數約 5,215。爆紅原因很直觀:AI coding 進入大型專案後,最貴的往往是理解上下文,而不是寫幾行程式。README 主打單一靜態 binary、零依賴、跨 macOS/Linux/Windows,並宣稱一般 repo 可毫秒級索引、Linux kernel 2,800 萬行規模可在 3 分鐘完整索引,結構查詢低於 1ms。它也強調 token 效率:5 個結構查詢約 3,400 tokens,對照逐檔探索約 412,000 tokens。這些賣點剛好切中 MCP 與 coding agent 使用者的痛點,也讓它和單純全文搜尋、或只把整個檔案塞進上下文的做法形成明顯差異:它主張先建立圖譜,再讓 agent 用小查詢取得精準結構資訊。
適合誰,可以拿來做什麼
它適合已經在用 MCP-compatible coding agent 的開發者或團隊,特別是大型 monorepo、微服務、跨語言專案。README 提到的能力包括 architecture overview、impact analysis、call graph、dead code detection、Cypher-like query、ADR 管理與跨服務 HTTP linking,因此用途不只是搜尋程式碼,更像替 agent 補上一層可查詢的架構地圖;在接手陌生專案、評估改動風險、追蹤跨檔呼叫或整理系統邊界時特別有價值。它也支援團隊共享 .codebase-memory/graph.db.zst 圖譜 artifact,讓同事可先匯入既有索引再增量更新。需要注意的是,它會讀取程式庫並寫入 agent 設定檔;README 也建議重視安全者先審視腳本與原始碼。
上手
README 提供明確 quick start。macOS / Linux 可一行安裝;若需要內建 3D graph visualization,可加上 --ui,之後在 localhost:9749 開啟 UI。
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash
curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui
安裝後重啟 coding agent,對 agent 說 「Index this project」。若要啟用自動索引:
codebase-memory-mcp config set auto_index true
README 重點摘要
- 158 種語言 透過 vendored tree-sitter grammars 編進 binary,主要語言再加 Hybrid LSP 式語意解析。
- 14 個 MCP tools 涵蓋搜尋、追蹤、架構總覽、impact mapping、死碼偵測、Cypher-like 查詢與 ADR。
- 單一靜態 binary、零依賴,可自動偵測並配置多個 coding agents。
- README 強調處理 100% local,release binary 有簽章、checksum 與 antivirus 掃描。
- 可選 3D graph visualization UI,也可用共享圖譜 artifact 減少團隊重複索引成本。