← 所有精選

GitHub Trending 精選

每日一個爆紅開源專案

週榜 #12026-06-22

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.

★ 10.2k stars · ▲ +6,372 本週 · 🔶 C · 📜 MIT · 官網在 GitHub 開啟 ↗
aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocode

這是什麼

codebase-memory-mcp 是一個面向 AI coding agents 的 code intelligence MCP server。它會把程式碼庫索引成持久化的知識圖譜,讓 Claude Code、Codex CLI、Gemini CLI、Cursor/VS Code 生態中的工具、OpenCode、Aider 等代理不必每次都用 grep 與逐檔讀取重新理解專案。README 的核心主張很清楚:它以 單一靜態 binary、零外部依賴 的方式,內建 158 種 tree-sitter grammar,把函式、類別、模組、呼叫關係、HTTP route、基礎設施檔案等結構轉成可查詢的圖。底層使用 SQLite 持久化,也支援可選的 3D graph visualization UI。

為什麼上榜

這個專案本週拿到 6,372 顆週星數、累積 10,228 stars,很容易理解為何會衝上榜:AI coding agent 的最大瓶頸之一,就是上下文昂貴且容易失焦。README 直接用效能與 token 效率打中痛點,宣稱平均 repo 可在毫秒級完整索引,Linux kernel(28M LOC、75K files)約 3 分鐘;結構查詢低於 1ms;五個 structural queries 約 3,400 tokens,相較逐檔搜尋約 412,000 tokens,減少 99.2% token。它與一般「把程式碼丟進 embedding」工具不同之處,在於同時強調 AST、call graph、package resolution、cross-service linking、IaC indexing 與 MCP 工具化,讓既有 agent 自己擔任自然語言到查詢的翻譯層。

適合誰,可以拿來做什麼

它最適合正在大量使用 AI 寫碼代理的團隊,尤其是中大型 repo、多語言 monorepo、微服務或含 Docker/Kubernetes/Kustomize 的專案。你可以用它做架構總覽、影響分析、dead code detection、call graph 追蹤、Cypher-like 查詢、跨服務 HTTP/gRPC/GraphQL/tRPC 關聯、ADR 管理,以及把多個 repo 放在同一個 store 裡建立 cross-repo intelligence。對個人開發者來說,最大價值是少花 token 讓 agent 反覆掃檔;對團隊來說,README 提到可輸出 team-shared graph artifact,以壓縮後的 SQLite 圖譜協助新環境快速 bootstrap。專案語言是 C,授權為 MIT,發行上支援 macOS、Linux、Windows。

上手

README 提供 macOS/Linux 的一行安裝方式:

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash

若要包含 graph visualization UI:

curl -fsSL https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash -s -- --ui

Windows 則使用 PowerShell 下載並執行 install.ps1。安裝後重啟 coding agent,對 agent 說 「Index this project」 即可開始。安裝選項包含 --ui--skip-config--dir=<path>;README 也提到 install 會自動偵測已安裝的 coding agents,設定 MCP server entries、instruction files、skills 與 pre-tool hooks。若要讓 MCP session 啟動時自動索引,可執行:

codebase-memory-mcp config set auto_index true

README 重點摘要