Skip to main content
Glama

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/ フォルダに文書を入れます。対応形式:

形式

拡張子

プレーンテキスト

.txt

Markdown

.md

CSV

.csv

JSON

.json

YAML

.yaml / .yml

PDF

.pdf

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 で動作をカスタマイズできます。

項目

デフォルト

説明

CHUNK_SIZE

1000

チャンク分割サイズ (文字数)

CHUNK_OVERLAP

200

チャンク間のオーバーラップ (文字数)

EMBEDDING_MODEL

all-MiniLM-L6-v2

埋め込みモデル

TOP_K

5

検索のデフォルト取得件数

COLLECTION_NAME

rag_docs

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 サーバーの結合テスト
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    Enables 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.
    Last updated
  • F
    license
    B
    quality
    D
    maintenance
    Provides 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.
    Last updated
    2
  • A
    license
    -
    quality
    D
    maintenance
    Provides 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.
    Last updated
    1
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Enables searching and retrieving documents from a local folder to ground LLM answers in your files.
    Last updated
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.

  • Securely search and manage workspace context files for AI agents and teams.

  • Local-first RAG engine with MCP server for AI agent integration.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mmer547/rag_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server