Codebase Memory MCP
MCP server viết bằng C, index codebase thành knowledge graph qua tree-sitter AST, hỗ trợ 66 ngôn ngữ, truy vấn sub-ms, 14 MCP tools, zero dependencies.
Xem thêm từ README.mdThu gọn README.md
Đánh giá chi tiết
Tổng quan
codebase-memory-mcp là một code intelligence engine viết hoàn toàn bằng C, chạy dưới dạng MCP server. Nó index repo thành knowledge graph gồm functions, classes, call chains, HTTP routes và cross-service links bằng tree-sitter AST analysis. Index Linux kernel (28M LOC, 75K files) mất 3 phút.
Tính năng chính
- 14 MCP tools cho structural queries trên codebase
- 66 ngôn ngữ lập trình (tree-sitter grammars compiled vào binary)
- LSP-style hybrid type resolution cho Go, C, C++ (thêm ngôn ngữ dần)
- Infrastructure-as-code indexing: Dockerfiles, K8s manifests, Kustomize
- Built-in 3D graph visualization tại localhost:9749 (UI variant)
- Auto-detect và config cho 10 agents: Claude Code, Codex CLI, Gemini CLI, Zed, OpenCode, Antigravity, Aider, KiloCode, VS Code, OpenClaw
Stack kỹ thuật
Pure C, zero runtime dependencies. SQLite in-memory pipeline, LZ4 compression, fused Aho-Corasick pattern matching. Vendored tree-sitter grammars. Static binary cho macOS (arm64/amd64), Linux (arm64/amd64), Windows (amd64). Graph UI dùng React + Three.js.
Điểm mạnh
- Tốc độ index rất nhanh: repo trung bình xong trong milliseconds
- 120x ít token hơn: 5 structural queries dùng khoảng 3,400 tokens thay vì khoảng 412,000 qua file-by-file search
- Single static binary, không Docker, không runtime, không API key
- 2,586 tests passing, có CI (dry-run, CodeQL, nightly soak, scorecard)
- OpenSSF Scorecard badge, có SECURITY.md và CONTRIBUTING.md
Hạn chế
- Viết bằng C nên contribute code khó hơn Go/TS/Python projects
- LSP-style type resolution mới có cho Go, C, C++ (các ngôn ngữ khác chưa có)
- Graph UI là variant riêng, không đi kèm binary mặc định
Phù hợp khi nào
Khi bạn làm việc trên repo lớn và muốn coding agents truy vấn cấu trúc code thay vì đọc từng file. Đặc biệt hữu ích nếu repo có nhiều ngôn ngữ hoặc cross-service dependencies.