オフラインのTF-IDF埋め込みを使用して、AIクライアントによるローカルドキュメントフォルダの検索と、インデックス化されたコンテンツに基づいた回答の検証を可能にします。
別名 DevilsDev/rag-pipeline-utils, rag-mcp-server, @devilsdev/rag-mcp-server
- スター
- 1
- ツール
- 4
- ダウンロード数(30日間)
- 2,585
- 最新バージョン
- 3.9.1
- 最終コミット
- 2026年11月11日
- ライセンス
- MIT
RAG for your documents MCPとは
RAG for your documentsはMCPサーバーです。 オフラインのTF-IDF埋め込みを使用して、AIクライアントによるローカルドキュメントフォルダの検索と、インデックス化されたコンテンツに基づいた回答の検証を可能にします。. 4個のツールを提供しており、query, answer, questionなどがあります。
プロジェクトのREADMEから生成された概要
RAG for your documents MCP server について
このMCP serverは、Claude DesktopやCursorなどのMCPクライアントを使用する開発者向けに、ローカルのドキュメントフォルダの検索と、インデックス化されたコンテンツに対するAIの回答検証を実現します。サーバーを特定のディレクトリに指定することで、アシスタントがMarkdown、HTML、CSV、またはテキストファイルから関連する箇所を抽出できるようになります。このシステムはオフラインのTF-IDFエンベッダーとインメモリのリトリーバーを使用しているため、動作にAPIキー、外部データベース、ネットワーク接続は一切必要ありません。
ユーザーは、search_documentsとcheck_answerという2つの主要なツールを通じてサーバーを操作します。searchツールは自然言語のクエリに基づいて関連するテキスト箇所を見つけ、checkツールは提供された回答が特定のソースによって裏付けられているかどうかを評価します。インデックス作成はメモリ内で行われ、起動時に再構築されるため、このサーバーはローカルでプライバシーを重視したワークフロー向けに設計されています。stdio経由で実行され、動作にはNode.js 22以降が必要です。
できること
- 1ローカルファイルからの情報取得ドキュメントフォルダ内の特定の詳細をAIアシスタントに探させることができます。
プロジェクトの README から作成されています。すべてのユースケースは、その引用と照らし合わせて確認されています。
RAG for your documents MCPのインストール方法
フォーマット検証日 2026年11月10日Cursor に追加Gooseに追加Claude CodeにRAG for your documents MCPをインストール
$ claude mcp add rag-mcp-server -- npx -y @devilsdev/rag-mcp-serverCursorにRAG for your documents MCPをインストール
~/.cursor/mcp.json
{
"mcpServers": {
"rag-mcp-server": {
"command": "npx",
"args": [
"-y",
"@devilsdev/rag-mcp-server"
]
}
}
}VS CodeにRAG for your documents MCPをインストール
.vscode/mcp.json
{
"servers": {
"rag-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@devilsdev/rag-mcp-server"
]
}
}
}VS Code CLIにRAG for your documents MCPをインストール
$ code --add-mcp '{"name":"rag-mcp-server","type":"stdio","command":"npx","args":["-y","@devilsdev/rag-mcp-server"]}'Claude DesktopにRAG for your documents MCPをインストール
claude_desktop_config.json
{
"mcpServers": {
"rag-mcp-server": {
"command": "npx",
"args": [
"-y",
"@devilsdev/rag-mcp-server"
]
}
}
}CodexにRAG for your documents MCPをインストール
$ codex mcp add rag-mcp-server -- npx -y @devilsdev/rag-mcp-serverCodex config.tomlにRAG for your documents MCPをインストール
~/.codex/config.toml
[mcp_servers.rag-mcp-server] command = "npx" args = ["-y", "@devilsdev/rag-mcp-server"]
Gemini CLIにRAG for your documents MCPをインストール
$ gemini mcp add -s user rag-mcp-server npx -- -y @devilsdev/rag-mcp-serverGemini settings.jsonにRAG for your documents MCPをインストール
~/.gemini/settings.json
{
"mcpServers": {
"rag-mcp-server": {
"command": "npx",
"args": [
"-y",
"@devilsdev/rag-mcp-server"
]
}
}
}RAG for your documents MCPツール 4
READMEから検出queryanswerquestionsources
| query | — | |
| answer | — | |
| question | — | |
| sources | — |
自動チェック
実行日 2026年11月13日完全なレポート →自動チェックに合格しました。これはセキュリティ監査ではありません。コードを読み、サーバーに必要最小限のアクセス権を与えてください。 チェックの仕組み
- ソースリポジトリがリンクされており、アクセス可能devilsdev/rag-pipeline-utils is public and reachablegithub.com/devilsdev/rag-pipeline-utils ↗合格
- パッケージがこのリポジトリをソースとして指定@devilsdev/rag-mcp-server names devilsdev/rag-pipeline-utils as sourcenpmjs.com/package/@devilsdev/rag-mcp-server ↗合格
- ビルドの来歴 (Sigstore 証明)Sigstore attestation for @devilsdev/rag-mcp-servernpmjs.com/package/@devilsdev/rag-mcp-server/v/3.9.1#provenan ↗合格
- オープンソースライセンス (OSI)MITspdx.org/licenses/MIT.html ↗合格
- 過去1年以内にコミットまたはリリースありLast commit or release 2026-11-11github.com/devilsdev/rag-pipeline-utils ↗合格
- OpenSSF Scorecard未チェック
- パッケージ名が有名なパッケージに酷似していないNo popular package one edit away from @devilsdev/rag-mcp-server合格
- パッケージおよびその依存関係に重大な勧告なし136 resolved dependencies checked; no critical advisoryosv.dev ↗合格
- モデルへの隠れた指示がない4 tool descriptions and the README read; no override phrases, credential paths or hidden characters合格
- 破壊的なツールがラベル付けされているNo tool named like delete, drop or exec合格
- リモートエンドポイントが MCP ハンドシェイクに応答未チェック
README
GitHubで見る@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:
npx @devilsdev/rag-mcp-server ./docs
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 mcp add docs -- npx -y @devilsdev/rag-mcp-server /absolute/path/to/docs
Claude Desktop, Cursor and other clients that use an mcpServers config (for Claude Desktop: Settings → Developer → Edit Config, then restart):
{
"mcpServers": {
"docs": {
"command": "npx",
"args": ["-y", "@devilsdev/rag-mcp-server", "/absolute/path/to/docs"]
}
}
}
Then ask something your documents answer, such as "How many vacation days do employees get?".
Tools
search_documents
| Input | Type | Description |
|---|---|---|
query |
string, required | What to look for, in natural language (at most 10,000 characters, or --max-question-chars) |
topK |
integer, 1–20 | Passages to return (default 4, or --top-k) |
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
| Input | Type | Description |
|---|---|---|
answer |
string, required | The answer to check (at most 50,000 characters) |
question |
string | The question it answers; improves retrieval when sources is omitted (at most 10,000 characters) |
sources |
array of strings or { id, text } |
Passages to check against, at most 100, each at most 200,000 characters; omit to search the indexed documents |
topK |
integer, 1–20 | Passages to retrieve when sources is omitted |
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
rag-mcp-server <folder> [--top-k <n>] [--embedder local] [--max-answer-chars <n>]
[--max-source-chars <n>] [--max-question-chars <n>] [--max-sources <n>]
[--max-clause-pairs <n>] [--max-sentence-source-chars <n>] [--check-timeout-ms <n>]
[--max-concurrent-checks <n>]
| Option | Default | Meaning |
|---|---|---|
--top-k <n> |
4 |
Passages per call when the client doesn't pass topK |
--embedder <name> |
local |
The embedder; local (TF-IDF, offline) is the only one |
--max-answer-chars <n> |
50000 |
Longest answer check_answer accepts (env RAG_MCP_MAX_ANSWER_CHARS) |
--max-source-chars <n> |
200000 |
Longest source passage check_answer accepts (env RAG_MCP_MAX_SOURCE_CHARS) |
--max-question-chars <n> |
10000 |
Longest question or query (env RAG_MCP_MAX_QUESTION_CHARS) |
--max-sources <n> |
100 |
Most sources per check_answer call (env RAG_MCP_MAX_SOURCES) |
--max-clause-pairs <n> |
2000000 |
Most answer words × source clauses check_answer compares (env RAG_MCP_MAX_CLAUSE_PAIRS) |
--max-sentence-source-chars <n> |
3000000 |
Most answer sentences × source characters check_answer compares (env RAG_MCP_MAX_SENTENCE_SOURCE_CHARS) |
--check-timeout-ms <n> |
10000 |
Longest a check_answer check may run before it is stopped (env RAG_MCP_CHECK_TIMEOUT_MS) |
--max-concurrent-checks <n> |
2 |
Most check_answer checks run at once; up to 8 more wait (env RAG_MCP_MAX_CONCURRENT_CHECKS) |
A tool call over a limit is rejected with an error that names the flag to raise it. A flag wins over its environment variable; each must be a whole number of at least 1. When you build the server in code, createServer(index, { maxAnswerChars, maxSourceChars, maxQuestionChars, maxSources, maxClausePairs, maxSentenceSourceChars, checkTimeoutMs, maxConcurrentChecks }) takes the same limits. maxClausePairs and maxSentenceSourceChars refuse input that would take long to check before checking it. Every check also runs in a worker thread, with at most 512 MB of heap, and is stopped when it runs past checkTimeoutMs; the server keeps answering other calls meanwhile. At most maxConcurrentChecks checks run at once; up to 8 more wait, and time spent waiting doesn't count toward checkTimeoutMs. A call beyond that is refused with "Too many check_answer calls waiting; try again shortly."
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/
RAG for your documents MCPのよくある質問
RAG for your documents MCPをClaude Codeに追加するには
ターミナルでclaude mcp add rag-mcp-server -- npx -y @devilsdev/rag-mcp-serverを実行します。すべてのプロジェクトで利用するには--scope userを追加します。
RAG for your documents MCPをCursorに追加するには
~/.cursor/mcp.jsonを開き、上記のインストールセクションに示すCursor設定を使ってmcpServersの下にサーバーを追加します。
RAG for your documents MCPが提供するツールは
4個のツールを提供しており、query, answer, question, sourcesなどがあります。
このMCP serverはインターネット接続やAPIキーを必要としますか?
いいえ、APIキーやデータベースを必要とせず、完全にオフラインで動作します。
回答の検証はどのように行われますか?
検証は語彙ベースで行われ、モデルの呼び出しは行いません。つまり、LLMを使用して判断するのではなく、テキストを直接比較します。
システム要件は何ですか?
Node.js version 22以降がインストールされている必要があります。