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

Настройка

Скопируйте пример файла окружения и заполните ключи провайдеров, которые у вас есть:

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 Actions workflow в .github/workflows/ci.yml запускает все четыре на каждый push.

Структура

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.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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

View all related MCP servers

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.

  • Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/AyushShanu/CodeBase-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server