SM

shinpr/mcp-local-rag

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

426 stars 82 forks Качество 86 Тренд 41MIT

shinpr/mcp-local-rag — это кандидат на MCP-сервер, импортированный из https://github.com/shinpr/mcp-local-rag.

Обзор

shinpr/mcp-local-rag — это кандидат на MCP-сервер, импортированный из https://github.com/shinpr/mcp-local-rag.

Обзор (машинный перевод)

Английский | 简体中文 | Deutsch | Испанский | Português (Бразилия) | Франсе

Ищите частные документы из клиента 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 с помощью вашего

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

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"
      }
    }
  }
Открыть полный README на GitHub

Установка

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" } } } }