Skip to main content
Glama

codebase-rag-mcp

로컬 코드베이스를 쿼리 가능하고 인용 기반의 지식 베이스로 바꿔주는 Model Context Protocol(MCP) 서버입니다. 하이브리드 검색기(밀집 FAISS + 희소 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 참조):

변수

용도

NVIDIA_API_KEY

NVIDIA NIM / build API

GROQ_API_KEY

Groq Cloud

OPENROUTER_API_KEY

OpenRouter(다중 공급자 프록시)

GEMINI_API_KEY

Google Gemini(선택 사항)

LOCAL_MODEL_BASE_URL

OpenAI 호환 로컬 서버(Ollama, vLLM, LM Studio, ...)

LOCAL_MODEL_NAME

로컬 서버에 사용할 모델 이름

LOCAL_MODEL_API_KEY

로컬 서버용 선택적 bearer 토큰

LOG_LEVEL

DEBUG / INFO / WARNING / ERROR(기본값 INFO)

DATA_DIR

수집된 코퍼스가 저장되는 위치(기본값 ./data)

INDEX_DIR

FAISS / BM25 아티팩트가 유지되는 위치(기본값 ./data/index)

실행

# 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 워크플로가 모든 푸시마다 네 가지를 모두 실행합니다.

구조

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 참조.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    A 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 npm
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A 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