Skip to main content
Glama
HEMAHARENI

codebase-mcp

by HEMAHARENI

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: PAMPA

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 serve

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides semantic code search and retrieval capabilities for AI agents, enabling them to query codebases using natural language with automatic learning, hybrid search, and intelligent chunking of functions and classes.
    16
    29
    ISC
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI agents to search and retrieve context from GitHub issues, pull requests, releases, and documentation using hybrid semantic search and time-ordered activity scans.
    103
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI coding assistants to search and retrieve information from a locally ingested knowledge base using hybrid search, grounded in user-curated documentation.
    17
    MIT

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/HEMAHARENI/codebase-mcp'

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