LocalCodeRAG-MCP
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.
LocalCodeRAG-MCP
100% Offline, Zero-Network Hybrid AST Code Retrieval Engine for AI Coding Assistants (Claude Code, Cursor, Windsurf).
Why LocalCodeRAG-MCP?
Traditional retrieval solutions for code either leak intellectual property to cloud embedding APIs (OpenAI, Voyage, Cohere) or rely on brittle regex search that lacks semantic relevance.
LocalCodeRAG-MCP solves both problems:
Zero Cloud Egress: 100% air-gapped; runs entirely in local Python and embedded SQLite. Zero API keys, zero network connections.
AST-Boundary Chunking: Chunks source files along syntactic boundaries (classes, functions, async methods, module docstrings) rather than arbitrary line counts.
Reciprocal Rank Fusion (RRF): Fuses SQLite FTS5 BM25 full-text keyword ranking with local sub-word feature-hashed dense vector embeddings ($k=60$).
Sub-10ms Latency: Delivers instantaneous semantic code lookups in 2ms to 8ms.
Related MCP server: anyindex-mcp
Architecture
+---------------------------------------+
| AI Coding Assistant (Claude, Cursor) |
+---------------------------------------+
|
JSON-RPC 2.0 (stdio)
v
+---------------------------------------+
| LocalCodeRAG-MCP |
+---------------------------------------+
/ | \
v v v
+-----------------+ +---------------+ +---------------+
| AST Code Chunker| | Local Embedder| | RRF Ranker |
| (Classes/Funcs) | | (128-dim L2) | | 1/(60+r) |
+-----------------+ +---------------+ +---------------+
\ | /
+---------------+---------------+
|
v
+---------------------------------------+
| SQLite FTS5 Embedded Store |
| (.coderag.db) |
+---------------------------------------+Flagship MCP Tools
Tool | Purpose | Latency |
| Recursively chunks and indexes repositories into SQLite FTS5 + vector tables | ~10-20 ms/file |
| Reciprocal Rank Fusion of BM25 lexical search and dense cosine similarity | < 8 ms |
| Exact & prefix AST symbol lookup with line ranges and parameters | < 2 ms |
| Cross-repository caller and reference discovery | < 5 ms |
| Database health metrics (total chunks, functions, classes, file size) | < 1 ms |
Installation & Setup
1. Install via pip
pip install -e .2. Standalone CLI Usage
# Index current repository
coderag index .
# Execute hybrid search
coderag search "AST chunker for functions and classes"
# Locate a symbol definition
coderag def LocalHybridSearchEngine
# View index metrics
coderag stats3. Connect to Claude Code
Add to your ~/.claude.json:
{
"mcpServers": {
"localcoderag": {
"command": "python",
"args": ["-m", "localcoderag.cli", "serve", "--db", ".coderag.db"]
}
}
}4. Connect to Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"localcoderag": {
"command": "python",
"args": ["-m", "localcoderag.cli", "serve"]
}
}
}Verification & Benchmarks
Run the built-in test suite:
pytest tests/ -vRun the live interactive demonstration:
python examples/run_coderag_demo.pyBenchmark Results
Codebase Indexing: 17 files (70 AST chunks, 44 functions, 9 classes) indexed in 129.6 ms.
Search Latency: Hybrid RRF search executed in 5.23 ms.
Database Footprint: 4.0 KB SQLite file.
Author & Engineering Leadership
Chethan Raj D S
Technical Lead / Hands-on Engineering Leader / Principal Solutions Architect
IIT Delhi Executive CTO Alumnus
B.E. in Electrical & Electronics Engineering (85.60%)
GitHub: @Chethan-Raj-D-S
LinkedIn: chethan-raj-b511ba1b
License
This project is licensed under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Token-efficient search for coding agents over public and private documentation.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Search your knowledge bases from any AI assistant using hybrid RAG.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables local semantic code search across repositories using natural language, with AST-aware chunking and hybrid vector/FTS5 retrieval.-
- AlicenseAqualityBmaintenanceEnables semantic and keyword search over a local codebase by chunking source files along function and class boundaries, embedding them offline, and fusing vector and BM25 results. Runs entirely on your machine in a single SQLite file, so AI coding agents can find relevant code with no API keys, telemetry, or cloud calls.717 npmMIT
- AlicenseAqualityBmaintenanceLocal long-term memory shared by every AI coding assistant on one machine: a single SQLite file with FTS5 search and optional multilingual semantic search, no daemon and no cloud.132MIT
- AlicenseAqualityBmaintenanceEnables AI agents to index local codebases into isolated SQLite FTS5 databases and search them for ranked file paths, line ranges, and highlighted snippets, reducing context spent opening whole files.31MIT