← Back to directory
M

MCP Local RAG

Community
Search locally, retrieve below the surface.
Category
Dev Tools #108 of 438
Stars
★ 415 Very popular
Transport
stdio (local process)
Runtime
Node.js
Credentials
No credential needed
License
MIT
Last commit
Tools
9
61FMRS · C

An MIT-licensed, local-first RAG server for developers, exposing stdio MCP tools and a CLI. Its defining features are local embeddings, semantic chunking, keyword boosting, and relevance-gap filtering. It is best suited to privacy-conscious, single-user retrieval across code and technical documents.

Strongest · Documentation 16/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
14/20
Maintenance
10/20
Documentation
16/20
Setup experience
13/20
Why each score
Reliability 8/20
The manifest declares stdio transport and nine tools, and the README describes the same tools with substantial behavior, error, and concurrency details. Points are deducted because only the manifest and README are supplied: there is no source code, CI workflow, or committed test evidence verifying MCP initialization, the tool-list handshake, dependency installation, or key failure paths. The happy path is plausible, but runtime reliability is not demonstrated.
Security and permissions 14/20
The evidence describes local execution with no data leaving the machine after the initial model download; BASE_DIR/BASE_DIRS provide path boundaries, including realpath, symlink, and sibling-prefix checks; no credentials are declared, and visual content is explicitly treated as untrusted. Points are deducted because confirmation for the delete tool is not documented, single-user operation has no authentication or access control, and first-run model downloads plus configurable models introduce external dependencies. These properties are not verified by source code. No stated red-line risk is evident.
Maintenance 10/20
The project is not archived and provides an MIT license, GitHub repository, version 0.17.0, and a named vendor, establishing basic ownership and release identity. Points are deducted because the supplied material contains no commit history, release cadence, dependency-update policy, issue-response evidence, or security-response channel. The issue count is only a weak discovery signal and does not establish sustained maintenance.
Documentation 16/20
The README covers installation, several mainstream clients, tool purposes, file formats, configuration, limits, synchronization states, model downloads, performance, troubleshooting, security boundaries, and unsupported formats, with extensive examples. Points are deducted because the manifest lists tool names but provides no machine-reviewable parameter contracts; documented behavior, test coverage, and performance claims are not corroborated by source files or CI, and some runtime and platform differences remain for the user to determine.
Setup experience 13/20
The project offers an npx-based setup and clear examples for Cursor, Codex, Claude Code, and direct CLI use. Points are deducted because users still need Node/npm, valid local paths, and an initial model download, while client environment inheritance can cause configuration differences. No source, CI, or cross-platform execution evidence is supplied, so the maximum setup score is not justified.

Static review · not runListed 2026-07-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesConnects to a database

Best for

  • Developers who need local execution and privacy
  • Single-user environments searching code, technical specifications, and internal documents
  • Users who want a lightweight RAG workflow through MCP or the CLI

Not for

  • Deployments requiring multi-user access, authentication, or access control
  • Cloud-scale retrieval or scenarios prioritizing higher cloud-model accuracy
  • Workflows requiring Excel, PowerPoint, or standalone image search

Required permissions

  • Read supported files under configured document roots
  • Write the LanceDB database under DB_PATH
  • Write local Transformers.js model caches under CACHE_DIR
  • Access the network on first use to download models; cached models can then run offline

Risks and side effects

  • The server is designed for single-user local access and provides no multi-user authentication or access control
  • Captions generated in PDF visual mode may contain attacker-controlled text; downstream models should treat retrieved content as untrusted data
  • Changing the embedding model, device, or dtype requires deleting the database and re-ingesting to avoid degraded search quality
  • Ingestion, deletion, and synchronization against one DB_PATH should be limited to a single writer process

Setup

Before you start

Runtime:Node.js

Other optional settings (13)
BASE_DIR optional Single document root directory (security boundary); defaults to the current working directory if unset.
BASE_DIRS optional JSON array of document roots, e.g. '["/a","/b"]'; takes precedence over BASE_DIR.
DB_PATH optional Path to the LanceDB vector database directory; defaults to ./lancedb/.
CACHE_DIR optional Directory where Transformers.js models are cached; defaults to ./models/.
MODEL_NAME optional HuggingFace embedding model ID, default Xenova/all-MiniLM-L6-v2; switching models requires deleting the database and re-ingesting.
MAX_FILE_SIZE optional Maximum file size in bytes; defaults to 104857600 (100MB).
RAG_MAX_DISTANCE optional Maximum distance threshold for search results; results above it are excluded, lower values are stricter.
RAG_GROUPING optional Result grouping filter mode: 'similar' for the top group only, 'related' includes adjacent groups; unset means no filter.
RAG_MAX_FILES optional Limit search results to chunks from the top N best-scoring files; unset means no filtering.
CHUNK_MIN_LENGTH optional Minimum chunk length in characters during ingestion (1-10000); defaults to 50.
RAG_DEVICE optional Execution device for the embedder (passed to ONNX Runtime); defaults to cpu; errors if initialization fails.
RAG_DTYPE optional Embedding quantization dtype (fp32, fp16, q8, ...); defaults to fp32; changing it requires re-ingesting data.
RAG_HYBRID_WEIGHT optional Keyword boost factor for hybrid search (0.0-1.0); defaults to 0.6, higher values favor exact matches.

Add the stdio server to an MCP client configuration with npx -y mcp-local-rag, and set BASE_DIR to the document root; restart the client to use it. The embedding model downloads on first use, after which text ingestion and search can run offline. The CLI can also be used directly.

.cursor/mcp.json
{"mcpServers":{"local-rag":{"command":"npx","args":["-y","mcp-local-rag"],"env":{"BASE_DIR":"/path/to/your/documents"}}}}

Shown for Cursor. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-local-rag"
      ],
      "env": {
        "BASE_DIR": "/path/to/your/documents"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add local-rag -e BASE_DIR=/path/to/your/documents -- npx -y mcp-local-rag

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After restarting your MCP client, the 9 tools (query_documents, ingest_file, etc.) should appear in the tool list; then ask a question about an ingested document to confirm search returns results.

Troubleshooting

  1. Verify that documents were ingested first, then use list_files or status to inspect indexing state
  2. If the first model download fails, check the network connection or proxy configuration
  3. For file-size errors, inspect or adjust MAX_FILE_SIZE
  4. For path-restriction errors, confirm the path is inside BASE_DIR, BASE_DIRS, or a CLI-configured root
  5. Check MCP configuration syntax and fully restart the client; run npx mcp-local-rag directly to verify startup

Things to try

Once connected, you can ask your AI assistant things like:

  • Ingest the document at /Users/me/docs/api-spec.pdf
  • What does the API documentation say about authentication?
  • List all files in the configured base directories and their ingested status
  • Sync the index with /Users/me/docs and tell me when it's finished

Tools 9

query_documents read-only
Search indexed documents using semantic similarity with keyword boosting.
ingest_file writes
Extract, chunk, embed, and index a supported local file.
ingest_data writes
Clean and index supplied HTML or other data content locally.
read_chunk_neighbors read-only
Read chunks before and after a specified result to expand context.
list_files read-only
List files under configured directories and show their ingestion status.
delete_file destructive
Remove a file or data source from the RAG index.
status read-only
Show RAG database and system status.
sync_start writes
Asynchronously scan configured directories, re-ingest new or changed files, and prune removed files.
Show 1 more tools
sync_status read-only
Report a synchronization job's state, progress, summary, warnings, or error.

Use cases

Search local codebases, API specifications, and technical documentation
Build a private retrieval index for PDF, DOCX, TXT, and Markdown files
Combine semantic search and keyword boosting for exact identifiers, class names, and error codes
Keep a local document index current with synchronization jobs

Supported clients

Cursor
Codex
Claude Code

Listed from the project's documentation, not tested by this site.

Overview

MCP Local RAG is a local-first RAG server for developers that can also be used as a CLI. It combines local embeddings, semantic search, and keyword boosting for code and technical documentation while keeping indexed data on the machine by default. It supports PDF, DOCX, TXT, Markdown, and HTML supplied through ingest_data.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision 99aad46a1641 Data synced 2026-10-19 Read the FMRS scoring method