Local MCP RAG server with hybrid search, reranking, document management, and offline indexing for agent knowledge bases.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
This server is confirmed live โ we successfully called its tools/list endpoint directly (see the verified badge above). We haven't yet sandbox-tested the stdio install command below specifically, which is a separate, ongoing check.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Knowledge Rag.
search_knowledgeHybrid search combining semantic search + BM25 keyword search with cross-encoder reranking. Read-only. No side effects. Args: query: Search query text (1โ3 keywords recommended; phrase queries also work) max_results: Maximum number of results (default: 5, max: 20) category: Optional category filter โ one of: security, ctf, logscale, development, general, redteam, blueteam. Call list_categories() first to see available categories and counts. hybrid_alpha: Balance between semantic and keyword search. 0.0 = keyword-only (best for exact technical terms like CVE IDs or tool names), 0.3 = balanced default, 1.0 = semantic-only (best for conceptual or natural-language queries). min_score: Minimum normalized relevance score (0.0โ1.0) to include a result. Results scoring below this threshold are discarded. Default 0.0 returns all results. Use 0.2โ0.4 to cut low-relevance noise. snippet_mode: When true (default), truncates content to ~500 characters at a natural break point and adds a content_length field with the original size. Use get_document() to fetch full content when needed. Set to false to return full chunk content. search_method: Dispatch selector (v4.8.2+). One of ``"auto"`` (router picks FTS5 fast-path for lexical queries when enabled, hybrid otherwise), ``"hybrid"`` (force hybrid path โ kill switch for suspected router misclassification), or ``"fts5"`` (force FTS5 fast-path โ debug/testing; errors out when the feature is disabled or the index is not ready). Default ``"auto"`` preserves pre-v4.8.2 behavior byte-for-byte when the fast-path is disabled in config. Returns: JSON string with results including content chunks, source filepath, relevance score, and search method used. Returns chunks, not full document content. Usage: Primary search tool โ use for any topic or keyword lookup. Prefer search_similar() when you already have a reference document and want more like it. Prefer get_document() when you already know the exact filepath and need the full content.
get_documentGet the full content of a specific document by filepath. Read-only. No side effects. Args: filepath: Relative path to the document within the documents directory (e.g., "security/technique.md"). Must be an indexed file โ use list_documents() to browse available paths, or search_knowledge() to find the filepath by topic first. Returns: JSON string with full document content and metadata (filepath, category, size). Usage: Use when you need the complete text of a known file โ search_knowledge() returns chunks, not full docs. Use search_knowledge() first to find the filepath if unknown. Use list_documents() to browse all available files by category.
reindex_documentsIndex or reindex all documents in the knowledge base (runs in background). ``force`` โ smart reindex (detect changed files + rebuild BM25). Use after filesystem edits outside add_document/update_document. ``full_rebuild`` โ nuclear rebuild (delete + re-embed). Use only after embedding-model change or index corruption. Mutually exclusive with resume. ``resume`` โ pick up an interrupted smart reindex from ``data/reindex_checkpoint.json``. Falls back to a fresh smart run silently if the checkpoint is missing/corrupt/drifted (v4.8.0 Fase 4). Returns a JSON envelope. Poll ``get_reindex_status()`` until ``reindex.active`` becomes false. Add/update/URL tools already auto-index โ use these flags only for the recovery/rebuild scenarios above.
get_reindex_statusGet the current status of a background reindex operation. Lightweight โ does not compute full index statistics. Use this to poll progress after calling reindex_documents(). Returns: JSON string with reindex status. When active: operation name, progress (processed/total), percent complete, indexed/skipped/errors counts, and start time. When inactive: active=false, plus last_result or last_error from the most recent completed reindex. Usage: Call repeatedly after reindex_documents() to monitor progress. When reindex.active becomes false, the operation is complete. Use get_index_stats() for full index health metrics.
list_categoriesList all document categories with their document counts. Read-only. No side effects. Reflects the live index state. Returns: JSON string with category names, document counts per category, and total document count. Usage: Use before filtering search_knowledge() or list_documents() by category to see which categories exist and how many documents each contains. Use get_index_stats() instead for broader system health metrics (model name, cache hit rate, BM25 status).
list_documentsList all indexed documents, optionally filtered by category. Read-only. No side effects. Args: category: Optional category filter. Must be a valid category name โ call list_categories() to see available options (e.g., security, ctf, logscale, development, general, redteam, blueteam). Returns: JSON string with list of document filepaths, categories, and metadata for each indexed file. Usage: Use to browse what's in the index or verify a specific file is indexed. Use list_categories() first to see valid category names. Use search_knowledge() when you want to find documents by topic rather than browsing the full list. Use get_document() to read a specific file once you have its filepath.
The lyonzin/knowledge-rag MCP server provides a local retrieval-augmented generation backend for MCP clients. It indexes documents stored in a configured knowledge-base directory and makes their contents available through search, browsing, retrieval, and maintenance tools. The repository describes support for Claude Code, Cursor, Windsurf, Cline, VS Code, Gemini CLI, and Zed, with Python 3.11+ and Windows, Linux, and macOS listed as supported environments.
The primary retrieval path searches text using both semantic embeddings and BM25 keyword matching, then applies cross-encoder reranking. Search results contain chunks, source paths, relevance scores, and the selected search method rather than complete documents. A separate tool retrieves the full text when the path is known.
Documents are split into chunks and indexed locally. Semantic indexing uses an in-process FastEmbed ONNX model; the first query may download the model, after which the system can operate offline. Search can favor exact lexical matches, balance lexical and semantic signals, or use semantic similarity alone. The search tool also supports result limits, category filtering, minimum relevance scores, and abbreviated snippets.
The lyonzin/knowledge-rag MCP server supports seven document categories: security, ctf, logscale, development, general, redteam, and blueteam. Agents can inspect available categories and indexed file paths before issuing filtered searches or requesting a full file. For a known document, similarity search finds related indexed documents using its embedding.
Index maintenance is asynchronous. A smart reindex detects filesystem changes, while a full rebuild is intended for embedding-model changes or index corruption. A resume mode can continue an interrupted operation when a valid checkpoint exists. After starting a reindex, clients should poll the status tool until the operation is inactive.
Install the Python package with pip install knowledge-rag, then run knowledge-rag init to create a configuration file and documents/ directory. Add Markdown, PDFs, code, or other supported files to that directory and restart the MCP client. The first embedding-model download is approximately 200 MB according to the project documentation; later use can be offline.
The project also documents SSE and streamable HTTP transports for shared deployments. HTTP configuration can specify a host and port, bearer authentication, request limits, metrics, and JSON logging. These settings are configuration options rather than requirements for the local MCP workflow.
The MCP tool set includes capabilities for:
Document mutations write to disk and index immediately. Removing an item normally unindexes it while preserving the file; passing the deletion option permanently removes the file. URL ingestion requires internet access and only supports publicly accessible HTTPS pages.
Search returns chunks by default, so agents needing complete context must call the document retrieval tool. Filepath-based operations require the document to be indexed, and category filters must use valid live categories. A full rebuild is more disruptive than a smart reindex and should be reserved for model changes or index problems.
Although the lyonzin/knowledge-rag MCP server is designed for local and offline use, URL import makes outbound HTTP requests. No external service or paid API key is identified as required by the provided material. GPU support is optional; the documentation states that CPU execution is available through FastEmbed ONNX.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/lyonzin-knowledge-rag)<a href="https://allmcps.com/mcp/lyonzin-knowledge-rag"><img src="https://allmcps.com/api/badge/lyonzin-knowledge-rag?style=directory" alt="Knowledge Rag on AllMCPs" /></a>