codebase-mcp
Allows indexing and retrieving a GitHub repository's docs, closed issues, and source code through hybrid and reranked search.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codebase-mcpfind relevant issues and docs about database connection pooling"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 serveThis server cannot be deployed
Maintenance
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 your knowledge bases from any AI assistant using hybrid RAG.
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables semantic search across indexed documents using vector embeddings. Index GitHub repositories and URLs to perform natural language queries with AI-enhanced contextual results.9 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to search and retrieve context from GitHub issues, pull requests, releases, and documentation using hybrid semantic search and time-ordered activity scans.108 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-