BP

brainwires/project-rag

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

33 stars 8 forks Качество 71 Тренд 12MIT

A Rust-based Model Context Protocol (MCP) server that provides AI assistants with powerful RAG (Retrieval-Augmented Generation) capabilities for understanding massive codebases.

Обзор

A Rust-based Model Context Protocol (MCP) server that provides AI assistants with powerful RAG (Retrieval-Augmented Generation) capabilities for understanding massive codebases. This MCP server enables AI assistants to efficiently search and understand large projects by: - Creating semantic embeddings of code files - Storing them in a local vector database - Providing fast semantic search capabilities - Supporting incremental updates for efficiency - : All processing happens locally using fastembed-rs (no API keys required) - : Combines vector similarity with BM25 keyword matching using Reciprocal Rank Fusion (RRF) for optimal results - : Uses Tree-sitter to extract semantic units (functions, classes, methods) for 12 languages - : Indexes 40+ file types including code, documentation (with PDF→Markdown conversion), and configuration files - : Search commit history with smart on-demand indexing (default: 10 commits, only indexes deeper as needed) - : Index and query multiple codebases...

README

Показан фрагмент оригинального README. Открыть оригинал.

Project RAG - MCP Server for Code Understanding

A Rust-based Model Context Protocol (MCP) server that provides AI assistants with powerful RAG (Retrieval-Augmented Generation) capabilities for understanding massive codebases.

Overview

This MCP server enables AI assistants to efficiently search and understand large projects by:

  • Creating semantic embeddings of code files
  • Storing them in a local vector database
  • Providing fast semantic search capabilities
  • Supporting incremental updates for efficiency

Features

  • Local-First: All processing happens locally using fastembed-rs (no API keys required)
  • Hybrid Search: Combines vector similarity with BM25 keyword matching using Reciprocal Rank Fusion (RRF) for optimal results
  • AST-Based Chunking: Uses Tree-sitter to extract semantic units (functions, classes, methods) for 12 languages
  • Comprehensive File Support: Indexes 40+ file types including code, documentation (with PDF→Markdown conversion), and configuration files
  • Git History Search: Search commit history with smart on-demand indexing (default: 10 commits, only indexes deeper as needed)
  • Multi-Project Support: Index and query multiple codebases simultaneously with project filtering
  • Smart Indexing: Automatically performs full indexing for new codebases or incremental updates for previously indexed ones
  • Cross-Process Locking: Filesystem-based locks prevent multiple processes (e.g., multiple Claude Code sessions) from indexing the same codebase simultaneously
  • Concurrent Access Protection: Safe lock management prevents index corruption when multiple agents try to index simultaneously
  • Stable Embedded Database: LanceDB vector database (default, no external dependencies) with optional Qdrant support
  • Language Detection: Automatic detection of 40+ file types (programming languages, documentation formats, and config files)
  • Advanced Filtering: Search by file type, language, or path patterns
  • Respects .gitignore: Automatically excludes ignored files during indexing
  • Code Navigation: Find definitions, references, and call graphs (lightweight LSP-like features)
  • Adaptive Search Thresholds: Automatically lowers similarity threshold when no results found (0.7 → 0.6 → 0.5 → 0.4 → 0.3)
  • Slash Commands: 9 convenient slash commands via MCP Prompts

MCP Slash Commands

The server provides 9 slash commands for quick access in Claude Code:

Открыть полный README на GitHub

Установка

docker run -p 6333:6333 -p 6334:6334 \
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "project-rag": { "command": "/absolute/path/to/project-rag/target/release/project-rag", "env": { "RUST_LOG": "info" } } } }