contextplus
contextplus
GitHub: https://github.com/forloopcodes/contextplus
⭐ 星星數: 1985
摘要: Context+ 是一個以「大型工程語意智慧」為定位的 MCP server,訴求是給要求 99% 準確率的開發者使用。它融合 RAG、Tree-sitter AST、光譜聚類(spectral clustering)與 Obsidian 風格的連結機制,將龐大程式碼庫轉換成可搜尋、有階層的功能圖。
技術堆疊: TypeScript, MCP, RAG, Tree-sitter, Embeddings, Spectral Clustering, Linters
架構: 工具組分為三層:Discovery 層提供 get_context_tree(帶行號範圍的 AST 樹、動態修剪輸出)、get_file_skeleton(只看 API 表面的函式簽名與型別)、semantic_code_search 與 semantic_identifier_search(以 embedding 做語意層級的符號檢索並附呼叫點排名),以及用光譜聚類把語意相關檔案分羣的 semantic_navigate。Analysis 層的 get_blast_radius 追蹤某符號被哪些檔案行引用以防止孤兒參考,run_static_analysis 則叫用原生 linter 與編譯器抓死碼與型別錯誤(支援 TypeScript、Python、Rust、Go)。Code Ops 層負責實際的程式修改操作,整體作為 MCP server 供 AI coding agent 接入。