What is the io.github.shinpr/mcp-local-rag MCP server?
Easy-to-setup local RAG server with minimal configuration
How to install io.github.shinpr/mcp-local-rag
Copy-paste configuration for popular MCP clients.
BASE_DIRBase directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set.
BASE_DIRSJSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR.
DB_PATHPath to LanceDB database directory (defaults to ./lancedb/)
CACHE_DIRDirectory where Transformers.js models are cached (defaults to ./models/)
MODEL_NAMEEmbedding model name (defaults to Xenova/all-MiniLM-L6-v2)
MAX_FILE_SIZEMaximum file size in bytes (defaults to 104857600 / 100MB)
RAG_MAX_DISTANCEMaximum 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_GROUPINGGrouping 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_FILESMaximum 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_LENGTHMinimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion.
RAG_DEVICEExecution 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_DTYPEEmbedding 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 existing data.
RAG_HYBRID_WEIGHTKeyword 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.
{
"mcpServers": {
"mcp-local-rag": {
"command": "npx",
"args": [
"-y",
"mcp-local-rag"
],
"env": {
"BASE_DIR": "<YOUR_BASE_DIR>",
"BASE_DIRS": "<YOUR_BASE_DIRS>",
"DB_PATH": "<YOUR_DB_PATH>",
"CACHE_DIR": "<YOUR_CACHE_DIR>",
"MODEL_NAME": "<YOUR_MODEL_NAME>",
"MAX_FILE_SIZE": "<YOUR_MAX_FILE_SIZE>",
"RAG_MAX_DISTANCE": "<YOUR_RAG_MAX_DISTANCE>",
"RAG_GROUPING": "<YOUR_RAG_GROUPING>",
"RAG_MAX_FILES": "<YOUR_RAG_MAX_FILES>",
"CHUNK_MIN_LENGTH": "<YOUR_CHUNK_MIN_LENGTH>",
"RAG_DEVICE": "<YOUR_RAG_DEVICE>",
"RAG_DTYPE": "<YOUR_RAG_DTYPE>",
"RAG_HYBRID_WEIGHT": "<YOUR_RAG_HYBRID_WEIGHT>"
}
}
}
}{
"mcpServers": {
"mcp-local-rag": {
"command": "npx",
"args": [
"-y",
"mcp-local-rag"
],
"env": {
"BASE_DIR": "<YOUR_BASE_DIR>",
"BASE_DIRS": "<YOUR_BASE_DIRS>",
"DB_PATH": "<YOUR_DB_PATH>",
"CACHE_DIR": "<YOUR_CACHE_DIR>",
"MODEL_NAME": "<YOUR_MODEL_NAME>",
"MAX_FILE_SIZE": "<YOUR_MAX_FILE_SIZE>",
"RAG_MAX_DISTANCE": "<YOUR_RAG_MAX_DISTANCE>",
"RAG_GROUPING": "<YOUR_RAG_GROUPING>",
"RAG_MAX_FILES": "<YOUR_RAG_MAX_FILES>",
"CHUNK_MIN_LENGTH": "<YOUR_CHUNK_MIN_LENGTH>",
"RAG_DEVICE": "<YOUR_RAG_DEVICE>",
"RAG_DTYPE": "<YOUR_RAG_DTYPE>",
"RAG_HYBRID_WEIGHT": "<YOUR_RAG_HYBRID_WEIGHT>"
}
}
}
}{
"mcpServers": {
"mcp-local-rag": {
"command": "npx",
"args": [
"-y",
"mcp-local-rag"
],
"env": {
"BASE_DIR": "<YOUR_BASE_DIR>",
"BASE_DIRS": "<YOUR_BASE_DIRS>",
"DB_PATH": "<YOUR_DB_PATH>",
"CACHE_DIR": "<YOUR_CACHE_DIR>",
"MODEL_NAME": "<YOUR_MODEL_NAME>",
"MAX_FILE_SIZE": "<YOUR_MAX_FILE_SIZE>",
"RAG_MAX_DISTANCE": "<YOUR_RAG_MAX_DISTANCE>",
"RAG_GROUPING": "<YOUR_RAG_GROUPING>",
"RAG_MAX_FILES": "<YOUR_RAG_MAX_FILES>",
"CHUNK_MIN_LENGTH": "<YOUR_CHUNK_MIN_LENGTH>",
"RAG_DEVICE": "<YOUR_RAG_DEVICE>",
"RAG_DTYPE": "<YOUR_RAG_DTYPE>",
"RAG_HYBRID_WEIGHT": "<YOUR_RAG_HYBRID_WEIGHT>"
}
}
}
}{
"servers": {
"mcp-local-rag": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-local-rag"
],
"env": {
"BASE_DIR": "<YOUR_BASE_DIR>",
"BASE_DIRS": "<YOUR_BASE_DIRS>",
"DB_PATH": "<YOUR_DB_PATH>",
"CACHE_DIR": "<YOUR_CACHE_DIR>",
"MODEL_NAME": "<YOUR_MODEL_NAME>",
"MAX_FILE_SIZE": "<YOUR_MAX_FILE_SIZE>",
"RAG_MAX_DISTANCE": "<YOUR_RAG_MAX_DISTANCE>",
"RAG_GROUPING": "<YOUR_RAG_GROUPING>",
"RAG_MAX_FILES": "<YOUR_RAG_MAX_FILES>",
"CHUNK_MIN_LENGTH": "<YOUR_CHUNK_MIN_LENGTH>",
"RAG_DEVICE": "<YOUR_RAG_DEVICE>",
"RAG_DTYPE": "<YOUR_RAG_DTYPE>",
"RAG_HYBRID_WEIGHT": "<YOUR_RAG_HYBRID_WEIGHT>"
}
}
}
}claude mcp add mcp-local-rag --env BASE_DIR=<YOUR_BASE_DIR> --env BASE_DIRS=<YOUR_BASE_DIRS> --env DB_PATH=<YOUR_DB_PATH> --env CACHE_DIR=<YOUR_CACHE_DIR> --env MODEL_NAME=<YOUR_MODEL_NAME> --env MAX_FILE_SIZE=<YOUR_MAX_FILE_SIZE> --env RAG_MAX_DISTANCE=<YOUR_RAG_MAX_DISTANCE> --env RAG_GROUPING=<YOUR_RAG_GROUPING> --env RAG_MAX_FILES=<YOUR_RAG_MAX_FILES> --env CHUNK_MIN_LENGTH=<YOUR_CHUNK_MIN_LENGTH> --env RAG_DEVICE=<YOUR_RAG_DEVICE> --env RAG_DTYPE=<YOUR_RAG_DTYPE> --env RAG_HYBRID_WEIGHT=<YOUR_RAG_HYBRID_WEIGHT> -- npx -y mcp-local-ragRelated MCP servers
AI image generation and editing with prompt optimization and quality presets
View repository →MCP server for delegating tasks to specialized AI assistants in Cursor, Claude, and Gemini
View repository →