Saltar al contenido
Skillpedia
● Gratis y de código abierto💻 Local🔓 Sin clave de APIDatos y bases de datos

MCP Local RAG

Permite que tu agente de IA busque en tus archivos PDF, Word, Markdown y de texto de forma local, sin enviarlos a una API de embeddings.

429 estrellas en GitHubpor shinprLicencia MITActualizado hace 19 días

Cómo instalar

Este MCP es local: se ejecuta en tu computadora.

Funciona en las apps instaladas en tu PC (Claude Desktop, Claude Code, Cursor, VS Code…). Elige tu app:

Pega en la terminal:

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

Qué completar

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

¡Listo! Ahora pruébalo

Reinicia la app y pega uno de estos pedidos en el chat:

Sincroniza todos los documentos de la carpeta configurada y avísame cuando termine.
¿Qué dice la documentación de la API sobre la autenticación?

Qué es

Este servidor indexa documentos en tu computadora y los busca por significado y por palabras clave exactas. Los resultados incluyen el fragmento de origen y, cuando está disponible, los encabezados, números de línea o números de página. Después de la primera descarga del modelo, la indexación y la búsqueda funcionan sin conexión.

Qué puede hacer

  • sync_start: actualiza el índice según tu carpeta
  • sync_status: revisa una sincronización en curso
  • ingest_file: agrega o reemplaza un archivo
  • ingest_data: agrega texto, Markdown o HTML que tiene el cliente
  • query_documents: busca por significado y por coincidencia de palabras clave
  • read_chunk_neighbors: lee el texto alrededor de un resultado
  • list_files: muestra los archivos y su estado en el índice
  • delete_file: quita un archivo indexado

Cuándo usarlo

  • ›Cuando quieres hacer preguntas sobre una carpeta de documentos privados
  • ›Cuando necesitas coincidencias exactas, como códigos de error o nombres de API, además de búsqueda por significado
  • ›Cuando quieres respuestas con referencias de página o línea para poder revisar la fuente

Qué necesitas

Node.js 22.20 o más reciente y una carpeta de documentos configurada como BASE_DIR. Necesitas internet la primera vez para descargar el paquete y un modelo de embeddings de unos 90 MB. No necesita API key, Docker ni Python.

Skills que combinan

⭐ MCP de Skillpedia · gratisTu agente encuentra la skill correcta soloInstala nuestro MCP y tu agente buscará entre 15.000+ skills cuando la necesite.Instalar gratis →

Preguntas frecuentes

¿Mis datos se envían a la nube?

No. No usa una API de embeddings, y después de descargar el modelo funciona sin conexión.

¿Qué archivos son compatibles?

PDF, DOCX, TXT y Markdown, además de HTML o texto que pase el cliente. No se admiten Excel, PowerPoint, imágenes ni archivos de código fuente.

¿Necesito una API key?

No. No se necesita API key, Docker, Python ni una base de datos externa.

¿Hay línea de comandos?

Sí. Puedes usar npx mcp-local-rag ingest, query, sync, list, status y delete.

¿Cómo limita el acceso a archivos?

BASE_DIR es el límite de seguridad para las operaciones con archivos, y las rutas de archivo MCP deben ser absolutas y estar dentro de una raíz configurada.

¿Puedo cambiar el modelo?

Sí, con MODEL_NAME. Al cambiar de modelo, crea un índice nuevo en un DB_PATH nuevo.

Si no funciona

  • ›Configura BASE_DIR, DB_PATH y CACHE_DIR como rutas absolutas para que cada proyecto no cree su propio índice.
  • ›La primera sincronización puede tardar de 1 a 2 minutos mientras se descarga el modelo.
  • ›Si las descargas de Hugging Face están bloqueadas, configura HF_ENDPOINT con la URL de un espejo.

5 skills nuevas por semana. 1 minuto de lectura.