
RAG for your documents
io.github.DevilsDev由 GitHub 帳號 DevilsDev 發布v3.8.1更新於 Nov 7, 2026
Search a folder of documents and check answers against them. Offline: no API key or database.
概覽
本機 MCP 伺服器,為指定資料夾中的文件建立索引,讓助理離線檢索文件並核對答案是否有依據。
- 可以做什麼
- 以自然語言查詢檢索已索引的文件,回傳依相關度排序的段落及其來源檔案與分段編號。
- 用檢索到的或指定的段落核對候選答案,回傳有依據比例、無依據句子和引用來源。
- 索引資料夾及子資料夾中的 Markdown、HTML、CSV 和文字檔,略過 node_modules 與 .git。
- 透過 topK 參數或啟動選項調整每次回傳的段落數量。
- 適用情境
- 適合讓助理根據本機或私有文件回答問題,而不把內容傳送給嵌入 API 或資料庫;也適合快速以字面方式檢查某個答案是否受到這些文件支持。
- 執行需求
- 需要 Node.js 22 或更新版本,透過 npx 執行並傳入文件資料夾的絕對路徑。不需要 API 金鑰、資料庫或網路。索引保存在記憶體中並在啟動時重建,修改文件後需重新啟動伺服器。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 RAG for your documents,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
@devilsdev/rag-mcp-server
An MCP server for your documents. Point it at a folder and Claude, or any other MCP client, can search the documents and check answers against them:
It indexes the folder when it starts, with the offline TF-IDF embedder and an in-memory retriever from @devilsdev/rag-pipeline-utils. It needs no API key, no database and no network. The assistant is the language model, so the server never calls one.
Requires Node.js 22 or later.
Connect a client
The server speaks MCP over stdio, so the client starts it. Use an absolute path to your folder.
Claude Code:
Claude Desktop, Cursor and other clients that use an mcpServers config (for Claude Desktop: Settings → Developer → Edit Config, then restart):
Then ask something your documents answer, such as "How many vacation days do employees get?".
Tools
search_documents
Returns { passages: [{ id, source, score, text }] }, best first, as structured content and as JSON text. source is the file relative to the folder and id is <source>#<chunk number>. Passages that share no terms with the query are left out.
check_answer
Runs the library's checkAnswer and returns { grounded, groundedness, unsupported, citations, sources }: whether every sentence is supported, the share of supported sentences (0 to 1), the unsupported sentences, the ids of the sources supporting each sentence, and the sources that were checked. The check is lexical and makes no model calls, so a correct paraphrase can come back unsupported; treat it as a flag to look again, not a verdict.
Both tools are read-only. Passage text is content from your files, and the tool descriptions tell the client to treat it as data, not instructions. A file can still contain text written to manipulate an assistant, so index folders you trust.
Files
Markdown (.md, .markdown), HTML (.html, .htm, visible text only), CSV (.csv, one passage per row) and text (.txt) files, in the folder and its subfolders, handled the way the library's loaders handle them; prose is split into sentence chunks of up to 500 characters. Other files, node_modules and .git are skipped. The index lives in memory and is rebuilt each time the server starts, so restart the client's server after changing the documents.
Options
Everything the server logs goes to stderr; stdout carries the protocol.
Build your own
For other embedders (OpenAI, Ollama), a persistent index or a vector database, start from the MCP server example, which builds the same kind of server from the library in about 100 lines.
Documentation: https://devilsdev.github.io/rag-pipeline-utils/
來源:packages/rag-mcp-server/README.md,提交 5cdc1eb
工具
0版本歷史
3- v3.8.1最新Nov 7, 2026
- v3.7.1Nov 6, 2026
- v3.6.0Nov 5, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分