Zum Inhalt springen
Skillpedia
● Kostenlos und Open Source💻 Lokal🔓 Ohne API-SchlüsselDaten und Datenbanken

MCP Local RAG

Lässt deinen KI-Agenten deine eigenen PDF-, Word-, Markdown- und Textdateien lokal durchsuchen, ohne sie an eine Embedding-API zu schicken.

429 Sterne auf GitHubvon shinprLizenz MITAktualisiert vor 19 Tagen

So installierst du ihn

Dieser MCP ist lokal: Er läuft auf deinem Computer.

Er funktioniert in Apps auf deinem PC (Claude Desktop, Claude Code, Cursor, VS Code…). Wähle deine App:

Füge im Terminal ein:

claude mcp add local-rag -- npx -y mcp-local-rag

Was du ausfüllen musst

NameWofürPflicht
BASE_DIRBase directory for document storage (defaults to current working directory). Ignored when BASE_DIRS is set.Nein
BASE_DIRSJSON array of base directories (e.g. '["/a","/b"]'). Takes precedence over BASE_DIR.Nein
IGNORE_PATHSJSON 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"]').Nein
DB_PATHPath to LanceDB database directory (defaults to ./lancedb/)Nein
CACHE_DIRDirectory where Transformers.js models are cached (defaults to ./models/)Nein
HF_ENDPOINTHugging Face model download endpoint. Set this to a mirror URL when direct downloads are blocked (defaults to https://huggingface.co).Nein
MODEL_NAMEEmbedding model name (defaults to Xenova/all-MiniLM-L6-v2)Nein
MAX_FILE_SIZEMaximum file size in bytes (defaults to 104857600 / 100MB)Nein
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)Nein
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 filterNein
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.Nein
CHUNK_MIN_LENGTHMinimum chunk length in characters (1-10000, defaults to 50). Chunks shorter than this threshold are filtered out during ingestion.Nein
STORE_IMAGESStore supported PDF and DOCX images during ingestion and return them with matched chunks (defaults to false).Nein
EMBED_TITLE_PREFIXEmbed 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.Nein
EMBED_HEADING_PREFIXAdd section headings to chunk embeddings when they fit (defaults to false). Independent of EMBED_TITLE_PREFIX. Re-ingest documents after changing it.Nein
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.Nein
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.Nein
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.Nein
RAG_RERANK_CMDExternal reranker command template. Use {query} and {top} for query text and result count; unset disables reranking.Nein
RAG_RERANK_TIMEOUT_MSTime 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.Nein

Fertig! Jetzt testen

Starte die App neu und füge eine dieser Anfragen im Chat ein:

Ich möchte, dass du alle Dokumente im konfigurierten Ordner synchronisierst und mir Bescheid gibst, wenn es fertig ist.
Ich möchte wissen, was die API-Dokumentation zur Authentifizierung sagt.

Was es ist

Dieser Server indexiert Dokumente auf deinem Rechner und durchsucht sie nach Bedeutung und nach exakten Stichwörtern. Ergebnisse enthalten die Quellpassage und, wenn vorhanden, Überschriften, Zeilennummern oder Seitenzahlen. Nach dem ersten Modell-Download funktionieren Indexierung und Suche offline.

Was er kann

  • sync_start: bringt den Index mit deinem Ordner auf den neuesten Stand
  • sync_status: prüft einen laufenden Sync
  • ingest_file: fügt eine Datei hinzu oder ersetzt sie
  • ingest_data: fügt Text, Markdown oder HTML hinzu, die der Client bereithält
  • query_documents: sucht nach Bedeutung und Stichwort
  • read_chunk_neighbors: liest den Text um ein Ergebnis herum
  • list_files: zeigt Dateien und ihren Indexstatus
  • delete_file: entfernt eine indexierte Datei

Wann du ihn nutzt

  • ›Wenn du Fragen zu einem Ordner mit privaten Dokumenten stellen willst
  • ›Wenn du exakte Treffer wie Fehlercodes oder API-Namen brauchst, zusätzlich zur Suche nach Bedeutung
  • ›Wenn du Antworten mit Seiten- oder Zeilenangaben willst, damit du die Quelle prüfen kannst

Was du brauchst

Node.js 22.20 oder neuer und ein Ordner mit Dokumenten, der als BASE_DIR gesetzt ist. Beim ersten Mal ist Internet nötig, um das Paket und ein Embedding-Modell von etwa 90 MB herunterzuladen. Kein API Key, Docker oder Python.

Skills, die dazu passen

⭐ Skillpedia-MCP · gratisDein Agent findet den passenden Skill von selbstInstalliere unseren MCP, und dein Agent durchsucht 15.000+ Skills, sobald er einen braucht.Kostenlos installieren →

Häufige Fragen

Werden meine Daten in die Cloud gesendet?

Nein. Es nutzt keine Embedding-API, und nach dem Modell-Download funktioniert es offline.

Welche Dateien werden unterstützt?

PDF, DOCX, TXT und Markdown sowie HTML oder Text, den der Client übergibt. Excel, PowerPoint, Bilder und Quellcode-Dateien werden nicht unterstützt.

Brauche ich einen API Key?

Nein. Es braucht keinen API Key, kein Docker, kein Python und keine externe Datenbank.

Gibt es eine Kommandozeile?

Ja. Du kannst npx mcp-local-rag ingest, query, sync, list, status und delete verwenden.

Wie begrenzt es den Dateizugriff?

BASE_DIR ist die Sicherheitsgrenze für Dateioperationen. MCP-Dateipfade müssen absolut sein und innerhalb eines konfigurierten Stammordners liegen.

Kann ich das Modell ändern?

Ja, mit MODEL_NAME. Wenn du das Modell wechselst, baue einen neuen Index unter einem neuen DB_PATH.

Wenn es nicht funktioniert

  • ›Setze BASE_DIR, DB_PATH und CACHE_DIR auf absolute Pfade, damit nicht jedes Projekt einen eigenen Index anlegt.
  • ›Die erste Synchronisierung kann 1 bis 2 Minuten dauern, während das Modell heruntergeladen wird.
  • ›Wenn Hugging-Face-Downloads blockiert sind, setze HF_ENDPOINT auf eine Spiegel-URL.

5 neue Skills pro Woche. 1 Minute Lesezeit.