SM

shinpr/mcp-local-rag

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

428 stars 84 forks 品質 86 トレンド 40MIT

shinpr/mcp-local-ragは、https://github.com/shinpr/mcp-local-rag.からインポートされたMCPサーバー候補です。

概要

shinpr/mcp-local-ragは、https://github.com/shinpr/mcp-local-rag.からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

英語 | 简体中文 | ドイツ語| スペイン語 | ポルトゲス(ブラジル) | フランス

MCPクライアントや端末からプライベートドキュメントを検索できる場合、 埋め込みAPIです。

mcp-local-ragは、あなたのマシン上でPDF、DOCX、Markdown、テキストファイルをインデックス化します。検索結合 意味的類似性とキーワードマッチングの両方を追求できるため、クエリは意図と正確な技術的要素の両方にマッチできます API名、クラス名、エラーコードなどの用語が含まれます。結果にはソースパッセージが含まれます。 可能な場合は見出し、行番号、ページ番号を記載して、元の内容を確認し引用できるようにしてください 記録を残す。

APIキー、Docker、Python、外部データベースは必要ありません。初期モデルのダウンロード後は、 テキストの取り込みや検索はオフラインで行われます。

クイックスタート

要件

  • Node.js 22.20以降
  • NPMパッケージおよび埋め込みモデルの初次ダウンロード時のインターネットアクセス
  • 検索したい文書を含むディレクトリ

BASE_DIRをそのディレクトリに設定します。また、ファイル操作のセキュリティ境界でもあります。置き換え /absolute/path/to/your/documentsの下にディレクトリの絶対パスを記載します。

以下の例のいずれかを使うか、npx -y mcp-local-ragを登録し、BASE_DIR]をあなたの設定で設定してください

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

MCP Local RAG

English | 简体中文 | Deutsch | Español | Português (Brasil) | Français

Search private documents from an MCP client or the terminal without sending them to an embedding API.

mcp-local-rag indexes PDF, DOCX, Markdown, and text files on your machine. Search combines semantic similarity with keyword matching, so queries can match both intent and exact technical terms such as API names, class names, and error codes. Results include source passages and, where available, headings, line numbers, or page numbers so you can check and cite the original document.

No API key, Docker, Python, or external database is required. After the initial model download, text ingestion and search work offline.

Quick Start

Requirements

  • Node.js 22.20 or later
  • Internet access on first use to download the npm package and embedding model
  • A directory containing the documents you want to search

Set BASE_DIR to that directory. It is also the security boundary for file operations. Replace /absolute/path/to/your/documents below with the directory’s absolute path.

Use one of the examples below, or register npx -y mcp-local-rag and set BASE_DIR using your client’s MCP configuration format.

Set DB_PATH and CACHE_DIR to absolute paths as well. Relative paths resolve from the server’s working directory, so starting the server from different projects creates a separate index and model cache in each.

Add to ~/.config/opencode/opencode.json (or opencode.jsonc):

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "local-rag": {
      "type": "local",
      "command": ["npx", "-y", "mcp-local-rag"],
      "environment": {
        "BASE_DIR": "/absolute/path/to/your/documents"
      }
    }
  }
GitHub で README 全文を見る

インストール

npx -y mcp-local-rag
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "local-rag": { "command": "npx", "args": ["-y", "mcp-local-rag"], "env": { "BASE_DIR": "/absolute/path/to/your/documents" } } } }