Back to Browse

Local Rag MCP Server

by Shinpr
AI & MLLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Easy-to-setup local RAG server with minimal configuration

About

Easy-to-setup local RAG server with minimal configuration

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 1 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: trusted author (4/4 approved); 3 highly-trusted packages.

3 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

Base directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set.Optional

Environment variable: BASE_DIR

JSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR.Optional

Environment variable: BASE_DIRS

Path to LanceDB database directory (defaults to ./lancedb/)Optional

Environment variable: DB_PATH

Directory where Transformers.js models are cached (defaults to ./models/)Optional

Environment variable: CACHE_DIR

Hugging Face model download endpoint. Set this to a mirror URL when direct downloads are blocked (defaults to https://huggingface.co).Optional

Environment variable: HF_ENDPOINT

Embedding model name (defaults to Xenova/all-MiniLM-L6-v2)Optional

Environment variable: MODEL_NAME

Maximum file size in bytes (defaults to 104857600 / 100MB)Optional

Environment variable: MAX_FILE_SIZE

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)Optional

Environment variable: RAG_MAX_DISTANCE

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 filterOptional

Environment variable: RAG_GROUPING

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.Optional

Environment variable: RAG_MAX_FILES

Minimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion.Optional

Environment variable: CHUNK_MIN_LENGTH

Store supported PDF and DOCX images during ingestion and return them with matched chunks (defaults to false).Optional

Environment variable: STORE_IMAGES

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.Optional

Environment variable: EMBED_TITLE_PREFIX

Add section headings to chunk embeddings when they fit (defaults to false). Independent of EMBED_TITLE_PREFIX. Re-ingest documents after changing it.Optional

Environment variable: EMBED_HEADING_PREFIX

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.Optional

Environment variable: RAG_DEVICE

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 existing data.Optional

Environment variable: RAG_DTYPE

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.Optional

Environment variable: RAG_HYBRID_WEIGHT

External reranker command template. Use {query} and {top} for query text and result count; unset disables reranking.Optional

Environment variable: RAG_RERANK_CMD

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.Optional

Environment variable: RAG_RERANK_TIMEOUT_MS

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-shinpr-mcp-local-rag": {
      "env": {
        "DB_PATH": "your-db-path-here",
        "BASE_DIR": "your-base-dir-here",
        "BASE_DIRS": "your-base-dirs-here",
        "CACHE_DIR": "your-cache-dir-here",
        "RAG_DTYPE": "your-rag-dtype-here",
        "MODEL_NAME": "your-model-name-here",
        "RAG_DEVICE": "your-rag-device-here",
        "HF_ENDPOINT": "your-hf-endpoint-here",
        "RAG_GROUPING": "your-rag-grouping-here",
        "STORE_IMAGES": "your-store-images-here",
        "MAX_FILE_SIZE": "your-max-file-size-here",
        "RAG_MAX_FILES": "your-rag-max-files-here",
        "RAG_RERANK_CMD": "your-rag-rerank-cmd-here",
        "CHUNK_MIN_LENGTH": "your-chunk-min-length-here",
        "RAG_MAX_DISTANCE": "your-rag-max-distance-here",
        "RAG_HYBRID_WEIGHT": "your-rag-hybrid-weight-here",
        "EMBED_TITLE_PREFIX": "your-embed-title-prefix-here",
        "EMBED_HEADING_PREFIX": "your-embed-heading-prefix-here",
        "RAG_RERANK_TIMEOUT_MS": "your-rag-rerank-timeout-ms-here"
      },
      "args": [
        "-y",
        "mcp-local-rag"
      ],
      "command": "npx"
    }
  }
}

Reviews

No reviews yet

Be the first to review this server!