知识检索工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
📚 深度解析
知识检索工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。
通过安装 知识检索工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。
在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。知识检索工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。
与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 知识检索工具 评为 AI 评分 8.0 分,属于同类工具中的优质选择。
📋 工具概览
知识检索工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
GitHub Stars
⭐ 84
开发语言
Python
支持平台
Windows / macOS / Linux
维护状态
轻量级项目,按需更新
开源协议
MIT
AI 综合评分
8.0 分
工具类型
MCP工具
Forks
14
📖 中文文档
以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。
知识检索工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
<p align="center"> <img src="./assets/knowledge-rag-banner.png" alt="knowledge-rag — Local Hybrid RAG for MCP" width="100%" /> </p>
🚀 Zero-friction setup
pip install knowledge-rag → restart your MCP client → done. No Docker mandatory. No Ollama required. No separate embedding server. Everything runs in-process via FastEmbed ONNX. Works offline after the first model download.
</td> </tr> <tr> <td width="50%" valign="top">
Multi-client setup (Shared Server via Streamable HTTP)
stdio is ideal when one MCP client owns one knowledge-rag process. If several clients (e.g. Claude, Cursor, LM Studio, or multiple terminal windows) should share one index and one running process, run knowledge-rag once with Streamable HTTP and point each HTTP-capable client at the same endpoint (prompted by #217 and issue #223):
Health probe: curl http://your-host:8179/health → 200 + JSON payload
Prometheus scrape: http://your-host:9179/metrics
MCP dispatcher: authenticated via Authorization: Bearer your-secret-token
Option 1 — Via skills.sh (needs Node — one command, zero clone)
npx skills add lyonzin/knowledge-rag
🏢 Enterprise Features (built-in, zero configuration)
Every RAG framework claims "production-ready." Here is what knowledge-rag ships in the OSS core, verified by regression tests, that competitors either paywall, plugin-ify, or simply don't have.
⚙️ Configuration in 30 seconds
```yaml
config.yaml — everything is optional; defaults just work
Complete configuration reference — every field, every default, tuning guide:docs/CONFIGURATION.md →
---
MCP endpoint: http://127.0.0.1:8179/mcp
```
Local MCP clients (Cursor, LM Studio, etc.): Point their remote-server URL directly at http://127.0.0.1:8179/mcp.
Claude Custom Connectors (Remote MCP):
Network requirement: Custom connector requests originate from Anthropic's cloud infrastructure across web, desktop, and mobile, so they cannot reach local 127.0.0.1. You must expose your server via a secure, publicly accessible HTTPS endpoint (e.g. Cloudflare Tunnel, ngrok, or reverse proxy) at https://your-public-domain/mcp. Configure the proxy to send an upstream Host accepted by the HTTP app for server.host (for the default loopback configuration, use 127.0.0.1:8179); forwarding the public hostname unchanged can produce 421 Invalid Host header. Keep bearer authentication and HTTPS enabled. Local claude_desktop_config.json uses command/args for local stdio processes and does not support remote HTTP endpoints.
Setup & Auth: In Claude (Pro/Max plans: Customize > Connectors > + Add > Add custom connector; Team/Enterprise owners: Organization settings > Connectors), enter your public endpoint. In Request headers, set header name Authorization with value Bearer <your-token> matching server.auth.bearer_token in config.yaml (see Anthropic Custom Connectors documentation).
Transport
Clients
Shared index / process
RAM overhead
Process management
Startup & query latency
Best fit
stdio
1
No
1 runtime per client; models load lazily in each process when queried
Client manages its own process; no separate server
Spawns per client; pays preflight and first-query model load
Simplest local setup (single client)
sse
Many
Yes
Shared server process; single shared model load across clients
Operator manages one background server
Reuses warm server; first-query model load still applies
Legacy HTTP clients
streamable-http
Many
Yes
Shared server process; single shared model load across clients
Operator manages one background server
Reuses warm server; first-query model load still applies
**Preferred** shared-server setup
When an HTTP transport is selected, knowledge-rag automatically enables its single-instance lock (KNOWLEDGE_RAG_SINGLE_INSTANCE=1) to prevent multiple servers from binding the same data directory or port.
Security note: The default host is 127.0.0.1. If you bind to 0.0.0.0 or deploy across a network, configure server.auth.bearer_token in config.yaml and terminate TLS (HTTPS) via a reverse proxy (e.g. Caddy, Nginx) to protect bearer tokens in transit; otherwise the server warns that the HTTP endpoint is unauthenticated.
📄 35 File Formats — parsed natively, no plugins needed
Parsers use format-specific extraction: Markdown sections, code boundaries, notebook cells without base64 outputs, PDF text and spreadsheet rows. Several extensions share one parser. The runtime fallback list contains 33 formats; the documented template and presets can select a smaller list. Inspect your effective documents.supported_formats. The two MetaTrader extensions are opt-in.
#
Format
Extension
Parser
Default
Notes
1
Markdown
.md
Section-aware (splits at ##)
Yes
Headers preserved as chunk boundaries
2
Plain Text
.txt
Fixed-size chunking
Yes
1000 chars + 200 overlap
3
PDF
.pdf
PyMuPDF extraction or explicit page-marked UTF-8 text
Yes
No OCR; extracted-text recognition is limited to 4 MiB
Functions / structs / enums / traits / use imports
21
Kotlin
.kt
Code-aware parser
Yes
Functions (incl. class members) / classes extracted
22
YAML
.yaml
YAML parser
Yes
Kubernetes kind / apiVersion / name extracted
23
YAML
.yml
YAML parser
Yes
Same as YAML parser
24
HuJSON
.hujson
HuJSON parser
Yes
JSON with comments + trailing commas (e.g. Tailscale ACLs)
25
CUE
.cue
Code-aware parser
Yes
Imports / package extracted
26
Protocol Buffers
.proto
Proto parser
Yes
Services / messages / RPCs extracted
27
Rego
.rego
Code-aware parser
Yes
OPA policies — imports / package extracted
28
SQL
.sql
SQL parser
Yes
Table names + statement types extracted
29
Shell
.sh
Shell parser
Yes
Function names extracted
30
jq
.jq
Shell parser
Yes
Indexed as shell-style script
31
Dockerfile
Dockerfile
Text parser
Yes
Matched by exact filename (no extension)
32
Makefile
Makefile
Text parser
Yes
Matched by exact filename (no extension)
33
Tiltfile
Tiltfile
Code-aware parser
Yes
Starlark — def functions / load() extracted
34
MQL4 Source
.mq4
Code parser
**No**
MetaTrader — opt-in via documents.supported_formats
35
MQL4 Header
.mqh
Code parser
**No**
MetaTrader — opt-in via documents.supported_formats
Files with a .pdf extension can also contain an explicit text extraction: the first line must be [Page N] with a positive page number, followed by nonempty UTF-8 text. An optional UTF-8 BOM and tab/CR/LF whitespace are accepted. This recognition is limited to 4 MiB, rejects other C0/C1 controls and DEL, and never reinterprets a file containing PDF magic in the first 1 KiB as text. Accepted extractions retain their source path and are marked content_format=extracted_text and page_count_source=markers; the marker count is not proof of the original PDF's total page count. Binary PDFs keep the native parser and its error diagnostics. Invalid or oversized textual lookalikes remain errors.
Enable an opt-in format — add the extension to documents.supported_formats in your config.yaml:
⚠️ Operating model — read once. In stdio mode, your MCP client (Claude Desktop, Code, Cursor, etc.) spawns and owns the knowledge-rag server process. Do NOT also run a second knowledge-rag writer in a terminal while that stdio client is open — two writer processes against the same data_dir corrupt the ChromaDB HNSW segment on Windows (see issue #216). For HTTP transports, manually running one server and connecting HTTP clients to it is the supported shared-server workflow; do not mix it with another writer using the same data_dir. Recommended baseline for stdio clients: add "KNOWLEDGE_RAG_SINGLE_INSTANCE": "1" to the env block of your MCP config as a safety net. Full explanation + how to run CLI commands safely: docs/single-instance.md.
⚠️ Do not install under cloud-sync folders. Keep paths.data_dir on a local path. OneDrive (incl. OneDrive - <tenant>), iCloud Drive, Dropbox, Google Drive, Box, pCloud, MEGAsync, Nextcloud/ownCloud and Sync all open file handles on the live index to upload it, racing with ChromaDB's HNSW mmap and SQLite WAL writes and triggering native access violations (0xC0000005 on Windows, SIGBUS on *nix). Preflight auto-repair then moves the active index to data/backups/auto-repair-* and you lose the corpus. Since v4.11.0, preflight aborts with EX_CONFIG (78) when data_dir resolves under one of these providers. Point data_dir at a local path (e.g. %LOCALAPPDATA%\knowledge-rag\data on Windows, ~/.local/share/knowledge-rag/data on Linux/macOS). If you really need to run under cloud sync, set paths.allow_cloud_sync: true to acknowledge the risk and continue.
---
📊 How knowledge-rag compares to other RAG frameworks
Compare the features needed for your deployment rather than treating framework checklists as a benchmark. Knowledge-rag combines MCP tools, local embeddings, ChromaDB persistence, BM25, optional FTS5 and optional reranking in one process.
Decision
What to verify
Local or remote processing
Where models run, which client receives content, and which features need network access
Retrieval quality
Expected-source queries on your corpus, including its languages and identifiers
Performance
Cold initialization, indexing, uncached queries, memory peaks and concurrent use on comparable hardware
Operations
Authentication, metrics exposure, backups, recovery and one-writer ownership
Extensibility
Supported parsers, model profiles and the public MCP contract
The audit report records a reproducible local workload and its limitations. Results against an older implementation of this project are
not speed comparisons against other RAG frameworks.
Path 1 — Claude Code, Cursor, Windsurf, Cline, VS Code, Gemini CLI, Zed (MCP)