NestDaddy

Mcp Local Rag

io.github.shinpr/mcp-local-rag · v0.23.3

Easy-to-setup local RAG server with minimal configuration

Connect Runs on your machine

Terminal
claude mcp add mcp-local-rag -e BASE_DIR=<BASE_DIR> -e BASE_DIRS=<BASE_DIRS> -e IGNORE_PATHS=<IGNORE_PATHS> -e DB_PATH=<DB_PATH> -e CACHE_DIR=<CACHE_DIR> -e HF_ENDPOINT=<HF_ENDPOINT> -e MODEL_NAME=<MODEL_NAME> -e MAX_FILE_SIZE=<MAX_FILE_SIZE> -e RAG_MAX_DISTANCE=<RAG_MAX_DISTANCE> -e RAG_GROUPING=<RAG_GROUPING> -e RAG_MAX_FILES=<RAG_MAX_FILES> -e CHUNK_MIN_LENGTH=<CHUNK_MIN_LENGTH> -e STORE_IMAGES=<STORE_IMAGES> -e EMBED_TITLE_PREFIX=<EMBED_TITLE_PREFIX> -e EMBED_HEADING_PREFIX=<EMBED_HEADING_PREFIX> -e RAG_DEVICE=<RAG_DEVICE> -e RAG_DTYPE=<RAG_DTYPE> -e RAG_HYBRID_WEIGHT=<RAG_HYBRID_WEIGHT> -e RAG_RERANK_CMD=<RAG_RERANK_CMD> -e RAG_RERANK_TIMEOUT_MS=<RAG_RERANK_TIMEOUT_MS> -- npx -y [email protected]
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "BASE_DIR": "<BASE_DIR>",
        "BASE_DIRS": "<BASE_DIRS>",
        "IGNORE_PATHS": "<IGNORE_PATHS>",
        "DB_PATH": "<DB_PATH>",
        "CACHE_DIR": "<CACHE_DIR>",
        "HF_ENDPOINT": "<HF_ENDPOINT>",
        "MODEL_NAME": "<MODEL_NAME>",
        "MAX_FILE_SIZE": "<MAX_FILE_SIZE>",
        "RAG_MAX_DISTANCE": "<RAG_MAX_DISTANCE>",
        "RAG_GROUPING": "<RAG_GROUPING>",
        "RAG_MAX_FILES": "<RAG_MAX_FILES>",
        "CHUNK_MIN_LENGTH": "<CHUNK_MIN_LENGTH>",
        "STORE_IMAGES": "<STORE_IMAGES>",
        "EMBED_TITLE_PREFIX": "<EMBED_TITLE_PREFIX>",
        "EMBED_HEADING_PREFIX": "<EMBED_HEADING_PREFIX>",
        "RAG_DEVICE": "<RAG_DEVICE>",
        "RAG_DTYPE": "<RAG_DTYPE>",
        "RAG_HYBRID_WEIGHT": "<RAG_HYBRID_WEIGHT>",
        "RAG_RERANK_CMD": "<RAG_RERANK_CMD>",
        "RAG_RERANK_TIMEOUT_MS": "<RAG_RERANK_TIMEOUT_MS>"
      }
    }
  }
}
~/.cursor/mcp.json
{
  "mcpServers": {
    "mcp-local-rag": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "BASE_DIR": "<BASE_DIR>",
        "BASE_DIRS": "<BASE_DIRS>",
        "IGNORE_PATHS": "<IGNORE_PATHS>",
        "DB_PATH": "<DB_PATH>",
        "CACHE_DIR": "<CACHE_DIR>",
        "HF_ENDPOINT": "<HF_ENDPOINT>",
        "MODEL_NAME": "<MODEL_NAME>",
        "MAX_FILE_SIZE": "<MAX_FILE_SIZE>",
        "RAG_MAX_DISTANCE": "<RAG_MAX_DISTANCE>",
        "RAG_GROUPING": "<RAG_GROUPING>",
        "RAG_MAX_FILES": "<RAG_MAX_FILES>",
        "CHUNK_MIN_LENGTH": "<CHUNK_MIN_LENGTH>",
        "STORE_IMAGES": "<STORE_IMAGES>",
        "EMBED_TITLE_PREFIX": "<EMBED_TITLE_PREFIX>",
        "EMBED_HEADING_PREFIX": "<EMBED_HEADING_PREFIX>",
        "RAG_DEVICE": "<RAG_DEVICE>",
        "RAG_DTYPE": "<RAG_DTYPE>",
        "RAG_HYBRID_WEIGHT": "<RAG_HYBRID_WEIGHT>",
        "RAG_RERANK_CMD": "<RAG_RERANK_CMD>",
        "RAG_RERANK_TIMEOUT_MS": "<RAG_RERANK_TIMEOUT_MS>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "mcp-local-rag": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ],
      "env": {
        "BASE_DIR": "<BASE_DIR>",
        "BASE_DIRS": "<BASE_DIRS>",
        "IGNORE_PATHS": "<IGNORE_PATHS>",
        "DB_PATH": "<DB_PATH>",
        "CACHE_DIR": "<CACHE_DIR>",
        "HF_ENDPOINT": "<HF_ENDPOINT>",
        "MODEL_NAME": "<MODEL_NAME>",
        "MAX_FILE_SIZE": "<MAX_FILE_SIZE>",
        "RAG_MAX_DISTANCE": "<RAG_MAX_DISTANCE>",
        "RAG_GROUPING": "<RAG_GROUPING>",
        "RAG_MAX_FILES": "<RAG_MAX_FILES>",
        "CHUNK_MIN_LENGTH": "<CHUNK_MIN_LENGTH>",
        "STORE_IMAGES": "<STORE_IMAGES>",
        "EMBED_TITLE_PREFIX": "<EMBED_TITLE_PREFIX>",
        "EMBED_HEADING_PREFIX": "<EMBED_HEADING_PREFIX>",
        "RAG_DEVICE": "<RAG_DEVICE>",
        "RAG_DTYPE": "<RAG_DTYPE>",
        "RAG_HYBRID_WEIGHT": "<RAG_HYBRID_WEIGHT>",
        "RAG_RERANK_CMD": "<RAG_RERANK_CMD>",
        "RAG_RERANK_TIMEOUT_MS": "<RAG_RERANK_TIMEOUT_MS>"
      }
    }
  }
}

Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.

Tools

This server runs locally, so its tools are listed by your MCP client once it starts.

Environment variables

NameDescription
BASE_DIR
Optional
Base directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set.
BASE_DIRS
Optional
JSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR.
IGNORE_PATHS
Optional
JSON array of glob patterns for files to keep out of the index, each matched against the file's path relative to its root (e.g. '["plugs/**","**/*.draft.md"]').
DB_PATH
Optional
Path to LanceDB database directory (defaults to ./lancedb/)
CACHE_DIR
Optional
Directory where Transformers.js models are cached (defaults to ./models/)
HF_ENDPOINT
Optional
Hugging Face model download endpoint. Set this to a mirror URL when direct downloads are blocked (defaults to https://huggingface.co).
MODEL_NAME
Optional
Embedding model name (defaults to Xenova/all-MiniLM-L6-v2)
MAX_FILE_SIZE
Optional
Maximum file size in bytes (defaults to 104857600 / 100MB)
RAG_MAX_DISTANCE
Optional
Maximum distance threshold for filtering search results. Results with distance greater than this value will be excluded. Lower values mean stricter filtering (e.g., 0.5 for high relevance only)
RAG_GROUPING
Optional
Grouping mode for quality filtering. 'similar' returns only the most similar group (stops at first distance jump). 'related' includes related groups (stops at second distance jump). Unset means no grouping filter
RAG_MAX_FILES
Optional
Maximum number of files to keep in search results. Results are filtered to include only chunks from the top N best-scoring files. For example, 1 returns only the single best-matching file's chunks. Unset means no file filtering.
CHUNK_MIN_LENGTH
Optional
Minimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion.
STORE_IMAGES
Optional
Store supported PDF and DOCX images during ingestion and return them with matched chunks (defaults to false).
EMBED_TITLE_PREFIX
Optional
Embed each chunk together with its document title, which can help when passages don't restate the topic the title names (defaults to false). After changing it, use a new DB_PATH or delete the index and re-ingest.
EMBED_HEADING_PREFIX
Optional
Add section headings to chunk embeddings when they fit (defaults to false). Independent of EMBED_TITLE_PREFIX. Re-ingest documents after changing it.
RAG_DEVICE
Optional
Execution device for the embedder (defaults to cpu). Passed straight to ONNX Runtime; see the Transformers.js device source for the supported backend names. If the requested device fails to initialize, the server throws an error.
RAG_DTYPE
Optional
Embedding quantization dtype for the embedder (defaults to fp32). Opt-in and pass-through; accepts any dtype the chosen model provides (fp32, fp16, q8, int8, ...). If the model has no variant for the requested dtype, the server throws an error. Changing this changes the embedding space — re-ingest…
RAG_HYBRID_WEIGHT
Optional
Keyword boost factor for hybrid search (0.0-1.0, defaults to 0.6). 0 means semantic similarity only; higher values increase the keyword-match contribution to the final score.
RAG_RERANK_CMD
Optional
External reranker command template. Use {query} and {top} for query text and result count; unset disables reranking.
RAG_RERANK_TIMEOUT_MS
Optional
Time budget per rerank call in milliseconds (100-600000, defaults to 10000). On timeout the spawned command is killed and the pre-rerank ordering is returned.

Details

Package[email protected] (NPM, stdio)
First published11 Nov 2026
Last updated11 Nov 2026
Registry nameio.github.shinpr/mcp-local-rag

More ai and media servers See all

Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.