codebase-rag-mcp
codebase-rag-mcp
あらゆるローカルコードベースを、クエリ可能で引用に基づくナレッジベースに変えるModel Context Protocol (MCP)サーバーです。ハイブリッド検索(dense FAISS + sparse BM25)、オプションのリランカー、そして交換可能なLLMプロバイダー(NVIDIA、Groq、OpenRouter、Gemini、または任意のローカルOpenAI互換エンドポイント)を基盤としています。
ステータス: スキャフォールドのみです。パッケージはインストールでき、CLIは実行され、 MCPサーバーは起動してプレースホルダーの
pingツールを公開します。RAG パイプライン(取り込み → 解析 → チャンク分割 → インデックス作成 → 検索 → リランキング → 生成)は、このスケルトンの上に段階的に構築されています。DECISIONS.mdとFLOW.mdを参照してください。
インストール
Python 3.11+ が必要です。
# Editable install with dev tooling (pytest, ruff, mypy)
pip install -e ".[dev]"これにより、tree-sitter、FAISS (CPU)、rank-bm25、sentence-transformers、langchain-huggingface / langchain-community、公式MCP Python SDK、および外部プロバイダー呼び出し用のhttpxが導入されます。
Related MCP server: Grounded Code MCP
設定
サンプルのenvファイルをコピーし、お持ちのプロバイダーキーを入力してください:
cp .env.example .env
# then edit .env認識される変数(完全なリストは.env.exampleを参照):
Variable | Purpose |
| NVIDIA NIM / build API |
| Groq Cloud |
| OpenRouter(マルチプロバイダープロキシ) |
| Google Gemini(オプション) |
| OpenAI互換のローカルサーバー(Ollama、vLLM、LM Studioなど) |
| ローカルサーバーで使用するモデル名 |
| ローカルサーバー用のオプションのベアラートークン |
|
|
| 取り込んだコーパスの保存先(デフォルトは |
| FAISS / BM25アーティファクトの永続化先(デフォルトは |
実行
# Print the version
codebase-rag --version
# Boot the MCP server over stdio (advertises a 'ping' tool today)
codebase-rag serve開発
ruff check . # lint
ruff format --check . # format check
mypy # type-check
pytest # tests.github/workflows/ci.ymlにある事前設定済みのGitHub Actionsワークフローが、プッシュのたびに4つすべてを実行します。
構成
src/codebase_rag_mcp/
config.py # python-dotenv loader
cli/main.py # `codebase-rag` entrypoint
mcp/server.py # stdio MCP server (stub)
ingestion/ # file discovery (TBD)
parser/ # tree-sitter AST extraction (TBD)
chunker/ # AST-aware chunking (TBD)
indexing/
vector.py # FAISS dense index (TBD)
bm25.py # rank-bm25 sparse index (TBD)
retrieval/ # hybrid query routing (TBD)
reranker/ # cross-encoder / LLM reranker (TBD)
generation/
providers/ # NVIDIA / Groq / OpenRouter / Gemini / local (TBD)
citations/ # chunk → source citations (TBD)
impact/ # symbol-graph impact analysis (TBD)ライセンス
MIT。 LICENSE を参照してください。
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
Repository knowledge graph MCP server for codebase understanding and debugging.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA local MCP server that provides AI coding assistants with semantic search capabilities over codebases. It indexes code using local embeddings and exposes tools for efficient code retrieval, saving tokens and improving response quality.31 npm4MIT
- AlicenseNot gradedqualityDmaintenanceA local MCP server that gives AI coding assistants retrieval access to your personal knowledge base of books, standards, and docs, grounding their answers in sources you trust.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for team documentation and knowledge bases, enabling semantic search over documentation files using local embeddings.MIT
- AlicenseNot gradedqualityDmaintenanceA knowledge base MCP server backed by Qdrant vector database with local embeddings for semantic search and document management.4 npm1ISC