TL;DR — What is graph-indexer?
graph-indexer is an open-source (MIT) Model Context Protocol (MCP) server that indexes a codebase into AST-precise chunks using Tree-sitter, so AI coding agents can search code by concept instead of reading entire files. It combines BM25 lexical search with optional vector embeddings (hybrid search) and stores the index as local files — no database, no cloud services, no telemetry. Across 5 production codebases it reduces context usage by 65–88% per query (mean 77.9% token savings), with Recall@5 of 100%, MRR of 0.95, and 0.5 ms mean query latency.
- Requirements
- Node.js v18 or later. Ollama is optional (only needed for semantic/vector search; lexical-only mode works without it).
- Primary use case
- Giving AI coding agents (Claude Code, Cursor, Claude Desktop) token-efficient, precise code retrieval over large repositories via MCP tools such as
search_code,resolve_symbol, andget_call_graph. - Installation
npm install graph-indexer --save-dev, thennpx graph-indexer init.- Supported languages
- TypeScript/TSX, JavaScript, Python, Go, Rust, PHP, Java, Kotlin, C#, Ruby, and CSS/SCSS.