shinpr/mcp-local-rag

Local-first RAG server for developers. Semantic + keyword search for code and technical docs. Works with MCP or CLI. Fully private, zero setup.

What it solves

It provides a fully private, local Retrieval-Augmented Generation (RAG) system for developers. It eliminates the need to send sensitive technical documents, research papers, or internal specs to external cloud APIs, removing costs and privacy concerns while ensuring the system works offline.

How it works

  • Indexing: The system extracts text from PDFs, DOCX, TXT, and Markdown files. It uses a semantic chunker that splits text based on meaning and topic boundaries rather than fixed character counts, ensuring code blocks remain intact.
  • Embedding: Text chunks are converted into vectors using Transformers.js and stored in a local LanceDB database.
  • Search: It employs a hybrid search approach combining semantic (vector) similarity with a keyword boost to ensure exact technical terms (like specific function names or error codes) are ranked higher.
  • Visual Indexing: An optional visual mode uses local Vision Language Models (VLMs) to generate captions for figures and tables in PDFs, which are then indexed as searchable text chunks.
  • Interfaces: It can be run as an MCP (Model Context Protocol) server for integration with AI coding tools (like Cursor or Claude Code) or as a standalone CLI.

Who it’s for

Developers and researchers who need to search through local technical documentation and sensitive files using AI without compromising data privacy or relying on internet connectivity.

Highlights

  • Zero-friction setup: Deployable via a single npx command with no Docker or Python requirement.
  • Hybrid Search: Combines semantic search with keyword boosting for high precision on technical terms.
  • Privacy-first: Runs entirely locally with no API keys or cloud dependencies.
  • Semantic Chunking: Groups content by meaning to maintain context.
  • Visual Support: Opt-in VLM-powered captioning for PDF diagrams and charts.