MCP Local RAG
आपके AI एजेंट को आपकी PDF, Word, Markdown और text फ़ाइलों में लोकली खोजने दें, बिना उन्हें किसी embedding API को भेजे।
429 GitHub स्टारद्वारा shinprलाइसेंस MITअपडेट 19 दिन पहले
कैसे इंस्टॉल करें
यह MCP लोकल है: आपके कंप्यूटर पर चलता है।
यह PC पर लगे ऐप्स में काम करता है (Claude Desktop, Claude Code, Cursor, VS Code…)। अपना ऐप चुनें:
टर्मिनल में पेस्ट करें:
claude mcp add local-rag -- npx -y mcp-local-rag
क्या भरना है
| नाम | यह क्या है | ज़रूरी |
|---|---|---|
BASE_DIR | Base directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set. | नहीं |
BASE_DIRS | JSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR. | नहीं |
IGNORE_PATHS | 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 | Path to LanceDB database directory (defaults to ./lancedb/) | नहीं |
CACHE_DIR | Directory where Transformers.js models are cached (defaults to ./models/) | नहीं |
HF_ENDPOINT | Hugging Face model download endpoint. Set this to a mirror URL when direct downloads are blocked (defaults to https://huggingface.co). | नहीं |
MODEL_NAME | Embedding model name (defaults to Xenova/all-MiniLM-L6-v2) | नहीं |
MAX_FILE_SIZE | Maximum file size in bytes (defaults to 104857600 / 100MB) | नहीं |
RAG_MAX_DISTANCE | 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 | 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 | 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 | Minimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion. | नहीं |
STORE_IMAGES | Store supported PDF and DOCX images during ingestion and return them with matched chunks (defaults to false). | नहीं |
EMBED_TITLE_PREFIX | 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 | 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 | 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 | 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. | नहीं |
RAG_HYBRID_WEIGHT | 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 | External reranker command template. Use {query} and {top} for query text and result count; unset disables reranking. | नहीं |
RAG_RERANK_TIMEOUT_MS | 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. | नहीं |
तैयार! अब टेस्ट करें
ऐप दोबारा खोलें और इनमें से कोई एक अनुरोध चैट में पेस्ट करें:
कॉन्फ़िगर किए गए folder के सभी दस्तावेज़ sync करो और बताओ कब पूरा हुआ
API documentation में authentication के बारे में क्या लिखा है?
यह क्या है
यह server आपकी मशीन पर दस्तावेज़ इंडेक्स करता है और उन्हें अर्थ और सटीक keywords दोनों से खोजता है। नतीजों में स्रोत अंश होता है, और जहाँ उपलब्ध हो, headings, line numbers या page numbers भी। पहली model download के बाद इंडेक्सिंग और खोज offline चलती है।
यह क्या कर सकता है
sync_start: इंडेक्स को आपके folder के साथ अद्यतन करेंsync_status: चल रहे sync की स्थिति देखेंingest_file: एक फ़ाइल जोड़ें या बदलेंingest_data: client के पास मौजूद text, Markdown या HTML जोड़ेंquery_documents: अर्थ और keyword मिलान से खोजेंread_chunk_neighbors: किसी नतीजे के आसपास का टेक्स्ट पढ़ेंlist_files: फ़ाइलें और उनकी index स्थिति दिखाएँdelete_file: इंडेक्स की गई फ़ाइल हटाएँ
कब इस्तेमाल करें
- ›जब आप निजी दस्तावेज़ों के folder से सवाल पूछना चाहें
- ›जब आपको error codes या API names जैसे सटीक मिलान और अर्थ-आधारित खोज दोनों चाहिए
- ›जब आप चाहते हैं कि जवाबों में page या line का हवाला हो, ताकि आप स्रोत जाँच सकें
आपको क्या चाहिए
साथ में जमने वाली skills
MCP या skill?
MCP एजेंट को हाथ देता है। Skill सिखाती है कि उन्हें सही तरह कैसे इस्तेमाल करें। साथ में नतीजा बेहतर आता है और टोकन कम लगते हैं।
google-cloud-solution-rag-enterprise-search-gke-sqldbAlloyDB vectors, एक ओपन मॉडल और GKE का इस्तेमाल करके एक निजी एंटरप्राइज़ सर्च सिस्टम डिज़ाइन करती है, जो आपके दस्तावेज़ों से सवालों के जवाब दे।xerj-knowledgeआपके एजेंट को आपके अपने स्थानीय दस्तावेज़, नोट्स, PDF, स्प्रेडशीट और मेल में खोजने देती है, और हर जवाब किस फ़ाइल और पेज से आया, यह बताती है।doc-readerयह आपके एजेंट को एक ही टूल से PDF, Word और Excel फ़ाइलों, PowerPoint स्लाइड, इमेज और कई अन्य दस्तावेज़ों से पढ़ने योग्य टेक्स्ट निकालने देती है।अक्सर पूछे जाने वाले सवाल
क्या मेरा डेटा cloud पर जाता है?
नहीं। यह embedding API इस्तेमाल नहीं करता, और model डाउनलोड होने के बाद offline काम करता है।
कौन सी फ़ाइलें समर्थित हैं?
PDF, DOCX, TXT और Markdown, साथ ही client द्वारा दिए गए HTML या text। Excel, PowerPoint, images और source code फ़ाइलें समर्थित नहीं हैं।
क्या मुझे API key चाहिए?
नहीं। न API key, न Docker, न Python, न कोई बाहरी database।
क्या कोई command line है?
हाँ। npx mcp-local-rag ingest, query, sync, list, status और delete इस्तेमाल कर सकते हैं।
यह फ़ाइल पहुँच को कैसे सीमित करता है?
BASE_DIR फ़ाइल कार्यों की सुरक्षा सीमा है, और MCP की फ़ाइल paths पूरी और configured root के अंदर होने चाहिए।
क्या मैं model बदल सकता हूँ?
हाँ, MODEL_NAME से। model बदलने पर नया DB_PATH रखकर नया index बनाएँ।
अगर काम न करे
- ›BASE_DIR, DB_PATH और CACHE_DIR को पूरे paths पर सेट करें, ताकि हर प्रोजेक्ट अलग index न बनाए
- ›पहली sync में model डाउनलोड होने के कारण 1 से 2 मिनट लग सकते हैं
- ›अगर Hugging Face downloads ब्लॉक हों, तो HF_ENDPOINT को mirror URL पर सेट करें
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।