rag_mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
RAG MCP サーバー
Docs フォルダに配置した文書をベクトル検索し、LLM が回答生成時に参照できるコンテキストを提供する MCP サーバーです。 ローカル LLM からの呼び出しを想定しています。
必要条件
Python 3.10 以上
uv (パッケージマネージャー)
Related MCP server: RAG MCP Tool
セットアップ
# 依存関係のインストール
uv sync初回起動時に sentence-transformers (all-MiniLM-L6-v2) のモデルが自動ダウンロードされます (~80MB)。
使い方
1. 文書を配置する
プロジェクトルートの Docs/ フォルダに文書を入れます。対応形式:
形式 | 拡張子 |
プレーンテキスト |
|
Markdown |
|
CSV |
|
JSON |
|
YAML |
|
|
2. サーバーを起動する
uv run python -m rag_mcp.server起動時に Docs/ 内の全ファイルが読み込まれ、ベクトルインデックスが作成されます。
インデックスは .chromadb/ に永続化されます。
3. MCP ツールを使う
MCP クライアント経由で以下のツールが利用できます。
search_docs
文書からクエリに関連する内容を検索します。
パラメータ:
query (string, 必須) — 検索クエリ
top_k (integer, 省略可) — 返却件数 (デフォルト: 5)reindex
Docs/ フォルダの全ファイルを再インデックスします。
パラメータ: なしlist_sources
インデックス済みのファイル一覧を表示します。
パラメータ: なしLLM クライアント設定
Claude Desktop
claude_desktop_config.json に追加:
{
"mcpServers": {
"rag-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\path\\to\\rag_mcp",
"python",
"-m",
"rag_mcp.server"
]
}
}
}Cursor
プロジェクトルートに .cursor/mcp.json を作成:
{
"mcpServers": {
"rag-mcp": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\path\\to\\rag_mcp",
"python",
"-m",
"rag_mcp.server"
]
}
}
}設定
src/rag_mcp/config.py で動作をカスタマイズできます。
項目 | デフォルト | 説明 |
| 1000 | チャンク分割サイズ (文字数) |
| 200 | チャンク間のオーバーラップ (文字数) |
|
| 埋め込みモデル |
| 5 | 検索のデフォルト取得件数 |
|
| ChromaDB コレクション名 |
アーキテクチャ
Docs/ の文書
↓ 読み込み (txt / md / csv / json / yaml / pdf)
↓ チャンク分割 (1000文字 / 200文字オーバーラップ)
↓ 埋め込み (sentence-transformers)
↓ 保存
ChromaDB (ベクトルストア)
↑ 類似検索
MCP サーバー (search_docs ツール)
↑ MCP プロトコル (stdio)
LLM クライアント (Claude Desktop, Cursor など)開発
# テスト実行
uv run python -m pytest tests/ # 全テスト
uv run python tests/test_rag.py # RAG エンジンの単体テスト
uv run python tests/test_mcp.py # MCP サーバーの結合テストTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Read and search folders on your own computer with explicit consent. Files are never uploaded.
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search and query PDF documents through a local RAG system with vector embeddings. Provides semantic document search capabilities while keeping all data stored locally without external dependencies.-
- FlicenseBqualityDmaintenanceProvides intelligent retrieval capabilities for local files by scanning directories, generating vector indexes, and enabling semantic search through RAG (Retrieval Augmented Generation) with incremental indexing support.2-
- AlicenseNot gradedqualityDmaintenanceProvides token-efficient semantic search and document retrieval by indexing PDFs, text, and markdown files into local notebooks using ChromaDB. It enables AI agents to query relevant passages from large documents through local embedding models like Hugging Face or Ollama.1MIT
- AlicenseAqualityDmaintenanceEnables searching and retrieving documents from a local folder to ground LLM answers in your files.2MIT