codebase-mcp
Allows indexing and retrieving a GitHub repository's docs, closed issues, and source code through hybrid and reranked search.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
codebase-mcp
MCP server that indexes one repo's docs, closed issues, and source code across three differential chunking strategies, and exposes hybrid + reranked retrieval as MCP tools.
The chunking comparison is the point of this project — never cut it, even under time pressure. Everything else has a defined fallback below.
Build order
Scaffold: project layout, Docker Compose (Qdrant + Ollama), CI skeleton
Ingestion: pull docs / closed issues / source for the target repo →
data/raw/Chunking (the core contribution) →
data/chunks/docs: heading-boundary splitting
issues: thread-level (not comment-level)
code: AST boundaries via tree-sitter — fallback if short on time: file-level chunks
baseline: naive fixed-size, for the comparison
Indexing: BGE-small embeddings → Qdrant; BM25 index in parallel
Eval ground truth: mine closed issues with maintainer answers → labelled pairs (do this before tuning retrieval, not after)
Retrieval: hybrid BM25 + dense, RRF fusion, BGE-reranker-base cross-encoder rerank
Query router: LLM classifier (docs / issues / code / mixed) → per-source weights - [ ] stretch: distill into a small trained model for millisecond routing — fallback if short on time: keep the LLM classifier
MCP server (MCP Python SDK) + FastAPI/Swagger front door
CI/CD: GitHub Actions → GHCR image
Related MCP server: github-rag-mcp
Evaluation
Recall@k and MRR, reported per source (docs / issues / code)
All three chunking strategies vs. the naive fixed-size baseline, head to head
Routing accuracy, reported separately from end-to-end answer quality
Ablation table:
baseline → +hybrid → +rerank → +routing
Stack
Python 3.11 · LangChain/LangGraph · tree-sitter · Qdrant · sentence-transformers (BGE-small-en-v1.5) · rank_bm25 · BGE-reranker-base · Ollama (dev) / Groq (hosted demo) · MCP Python SDK · FastAPI + Swagger · Docker Compose · GitHub Actions → GHCR
Getting started
cp .env.example .env # fill in TARGET_REPO, GITHUB_TOKEN, GROQ_API_KEY
docker compose --profile dev up -d qdrant ollama
pip install -e ".[dev]"
codebase-mcp ingest --repo owner/name
codebase-mcp chunk --strategy all
codebase-mcp index
codebase-mcp eval-mine
codebase-mcp eval-run --ablation
codebase-mcp serveTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Ask any GitHub repository a question. Get source-backed answers.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Search your knowledge bases from any AI assistant using hybrid RAG.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables semantic search across indexed documents using vector embeddings. Index GitHub repositories and URLs to perform natural language queries with AI-enhanced contextual results.21 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search and retrieve context from GitHub issues, pull requests, releases, and documentation using hybrid semantic search and time-ordered activity scans.365 npmApache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to search and retrieve information from a locally ingested knowledge base using hybrid search, grounded in user-curated documentation.17MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to search and query documentation from git repositories using hybrid search and structured metadata queries.1-