Semantic code & doc search with keyword boost. AST parsing, local embeddings, privacy-first.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
π΄ Forked from shinpr/mcp-local-rag β original work by Shinsuke Kagawa
Local code intelligence engine for AI coding assistants. AST-level semantic chunking + keyword boost for pinpointing functions, classes, and APIs β fully private, zero setup.
π δΈζζζ‘£
useEffect, error codes, class names rank higher β not just semantically guessed.find_definition and find_references for IDE-level code navigation, powered by tree-sitter metadata captured at ingest time.huggingface.co β hf-mirror.com β modelscope.cn, zero config for users in mainland China.npx command. No Docker, Python, or servers to manage.Set BASE_DIR to the folder you want to search (BASE_DIRS for multiple roots β see Configuration).
Cursor β ~/.cursor/mcp.json:
Claude Code:
Codex β ~/.codex/config.toml:
WorkBuddy β Settings β Custom Connectors β Add:
β οΈ WorkBuddy: you MUST click "Trust" in the Custom Connectors list after adding, otherwise the server is silently blocked.
No MCP needed β run directly from the terminal:
That's it. No Docker, Python, or server setup.
Chunking strategy is chosen per file type:
CodeChunker parses source via tree-sitter AST, splits at structural boundaries (functions, classes, methods). Each chunk's contextualizedText includes its scope chain and import context for precise semantic search.SemanticChunker splits into sentences, groups by embedding similarity to find natural topic boundaries. Markdown code blocks remain intact β never split mid-block.Search = semantic similarity + keyword boost (RAG_HYBRID_WEIGHT, default 0.6):
Exact identifiers like useEffect are never buried by semantic approximations.
Only files under BASE_DIR / BASE_DIRS are accessible for ingest, list, delete, or read-neighbor operations. Symlinks resolved outside roots are rejected. Sibling-prefix paths (e.g., /foo/barista when root is /foo/bar) are also blocked β prevents path traversal attacks.
15 tools organized into 5 categories.
| # | Tool | Purpose | Example |
|---|---|---|---|
| 1 | ingest_file | Single file (PDF/DOCX/TXT/MD/code) | "Ingest ./docs/api-spec.pdf" |
| 2 | ingest_data | In-memory text/HTML | "Fetch this page and ingest the HTML" |
| 3 | ingest_directory | Bulk directory ingest | "Ingest everything under ./src" |
ingest_file supports 50+ code languages. PDFs support an optional visual mode β a local VLM generates captions for figure pages, making visual content searchable. Two profiles available:
| Profile | Model | Cache | Suited for |
|---|---|---|---|
fast (default) | SmolVLM-256M | ~250 MB | Light visual indexing |
quality | Qwen2.5-VL-3B-ONNX | ~2.9 GB | Figures with in-image text |
ingest_data runs Readability β Markdown β index. Perfect for web content fetched by your AI assistant. Re-ingesting replaces old versions automatically.
ingest_directory scans recursively, respects .gitignore, shows real-time progress via MCP notifications.
| # | Tool | Purpose | Key Parameters |
|---|---|---|---|
| 4 | query_documents | Hybrid search (semantic + keyword) | query, limit, scope, highlightContext, fromTimestamp |
| 5 | read_chunk_neighbors | Expand context around results | filePath, chunkIndex, before, after |
query_documents β scope accepts a single path prefix or list, restricting results to that subtree. highlightContext returns snippets around matched terms. fromTimestamp / untilTimestamp enable time-range filtering.
read_chunk_neighbors β defaults to 2 chunks before and after (like grep -C 2), max 50 each. Response includes the target chunk marked isTarget: true.
| # | Tool | Purpose |
|---|---|---|
| 6 | list_files | List files with ingestion status (ingested: true/false) |
| 7 | delete_file | Delete by file path or source URL |
| 8 | status | Index stats: docs, chunks, memory, search mode |
list_files supports scope filtering with the same prefix-match semantics as search. In large directories, scope accelerates the scan by skipping out-of-scope subtrees.
| # | Tool | Purpose | Input |
|---|---|---|---|
| 9 | find_definition | Locate symbol definition (file, line range, scope) | Exact symbol name |
| 10 | find_references | Find all references (import + text mention) | Symbol name |
Both tools depend on AST metadata (imports, entities, scope chains) extracted by tree-sitter at ingest time. Only works for code files ingested with CodeChunker β files ingested before v0.18.7 lack this metadata and require reindex_all to rebuild.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-local-rag)<a href="https://allmcps.com/mcp/mcp-local-rag"><img src="https://allmcps.com/api/badge/mcp-local-rag?style=directory" alt="MCP Local Rag on AllMCPs" /></a>