codebase-memory-mcp
DeusData · DeusData/codebase-memory-mcp
MCP server này cung cấp thông minh code hiệu suất cao cho AI agent bằng cách lập chỉ mục codebase thành biểu đồ tri thức để truy vấn nhanh hơn và tiết kiệm token.
MCP server thông minh mã code hiệu suất cao. Lập chỉ mục các codebase thành biểu đồ tri thức bền vững — repo trung bình trong mili giây. 158 ngôn ngữ, truy vấn dưới mili giây, ít token hơn 99%. Một tệp nhị phân tĩnh duy nhất, không phụ thuộc.
Xem kết quả thực tế
Ảnh từ README của tác giả DeusData ·Nguồn
Bạn có thể làm gì với nó
- Giúp agent của bạn hiểu các codebase lớn một cách nhanh chóng và sâu sắc.
- Giảm việc sử dụng token cho các truy vấn liên quan đến code bằng cách tận dụng biểu đồ tri thức.
- Cho phép agent trả lời các truy vấn cấu trúc code ngay lập tức trên nhiều ngôn ngữ.
Thử hỏi agent của bạn
- “Phân tích lớp `User` trong `models.py`. Các phương thức chính của nó là gì và nó được sử dụng ở đâu?”
- “Tìm tất cả các HTTP route được định nghĩa trong thư mục `api` và liệt kê các hàm liên quan của chúng.”
- “Mô tả kiến trúc tổng thể của dự án này, tập trung vào cách các module khác nhau tương tác.”
Kiểm tra an toàn
Dùng được, nhưng nên đọc ghi chú trước.
- ●Trình cài đặt tải script từ xa và chạy thẳng bằng shell.
install.sh
Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.
Trích từ README
codebase-memory-mcp: local MCP server for code search, lower token usage and visualization
Search your code, follow call graphs, and explore software architecture in your browser. codebase-memory-mcp is a local Model Context Protocol (MCP) server that gives Claude Code, Codex, and other coding agents a persistent code knowledge graph. It indexes functions, classes, imports, HTTP routes, and their relationships across 162 languages. Hybrid LSP adds semantic type resolution for Python, TypeScript, JavaScript, JSX/TSX, PHP, C#, Go, C, C++, Java, Kotlin, Rust, and Perl.
About 120× fewer tokens in the project's reported five-query comparison: ~3,400 vs ~412,000 with file-by-file exploration. Published backend benchmarks also report Linux kernel indexing in ~3 minutes (28M lines of code) and Cypher relationship queries under 1 ms on an Apple M3 Pro. Benchmark details.
CBM Lens Beta helps you understand unfamiliar code and stay in control as it grows. Use it to get up to speed in a new codebase, tackle rescue engineering on an inherited project, or make sense of 50,000 lines of AI-generated code from a single day. Its IDE-style source reader, local code chat, 3D architecture map, and Galaxy graph let you see how the code fits together and follow dependencies and call paths back to the source. Use that context to review changes, investigate fragile areas, and keep code quality high. Architecture decisions stay alongside the project's index.
The native C backend exposes 17 MCP tools and supports 45 automatic or conditional client integrations. Indexing and graph queries need no hosted service or API key.
CBM Lens Beta is new on
main: it arrived with PR #2068 and is not part of the current v0.11.0 release, whose installer still ships the previous graph UI. To run the interface shown below now, build from source.
Quick start · Explore CBM Lens · Chat with your codebase locally · MCP tools · Build from source
Research: The preprint compares agents across 31 repositories, reporting 10× lower token use and 2.1× fewer tool calls, with answer-quality scores of 83% for CBM versus 92% for file-by-file exploration. These backend results are separate from the five-query comparison above and from CBM Lens.
Local processing: Source analysis and graph storage run on your machine. CBM Lens can optionally download a model for browser AI after you enable it; inference stays on the device. The installer writes agent configuration for the clients you select. See Security for release verification and SECURITY.md for reporting issues.
Architecture overview. Folders become nested platforms, files and symbols become selectable blocks, and arrows show indexed relationships. The recording zooms into the map of this repository, selects src/pipeline, opens the area, selects artifact.c and opens its source. Height can show source size; hotspot gravity reflects static fan-in. Still image.
Galaxy. Explore the code knowledge graph in 3D. The recording searches cbm_pipeline_run, follows its outgoing calls one layer further, switches to the hierarchy and shows the path to cbm_store_check_integrity. Edge pulses show relationship direction; they do not represent live execution. Current still: two dependency layers around cbm_max_file_bytes.
Explore. Browse files in an IDE-style workspace, read syntax-highlighted source in Monaco, and keep the code graph alongside it. File impact shows what depends on the open file, and Code details shows the callers and calls of the symbol under the caret. Select code to ask the local chat about it.
More views: system structure and behavior
System structure groups symbols into components and lets you inspect their dependencies.
Behavior shows possible calls from a selected operation and the source evidence behind them.
These captures show CBM Lens Beta on 12–13 October 2026, using public source from this repository. See capture details for each capture's build, indexed scope and recording setup.
Why codebase-memory-mcp
- Indexing performance: Linux kernel (28M LOC, 75K files) in 3 minutes. RAM-first pipeline: LZ4 compression, in-memory SQLite, fused Aho-Corasick pattern matching. Memory released after indexing.
- Plug and play: native executable plus authenticated release-owned assets for macOS (arm64/amd64), Linux (arm64/amd64), and Windows (amd64). The native install needs no Docker, language runtime, or API keys. Download →
install→ restart agent → done. - 162 languages: vendored tree-sitter grammars compiled into the binary. No separate parser installation.
- About 120× fewer tokens in the reported five-query comparison: ~3,400 tokens vs ~412,000 via file-by-file search. See Performance for the scope and sources.
- 45 supported automatic/conditional client surfaces:
installconfigures detected clients and safely activates conditional clients only when their documented platform, marker, or explicit existing config path is present. See Multi-Agent Support for the complete matrix and manual/UI-only boundaries. - CBM Lens Beta: read source, chat about selected code with a local model, explore architecture and call graphs, inspect coverage gaps, and edit architecture decision records in your browser.
- Infrastructure-as-code indexing: Dockerfiles, container images, docker compose, Kubernetes manifests, and Kustomize overlay
