YD

yairwein/document-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

22 stars 6 forks 품질 58 트렌드 0MIT

MCP 서버는 로컬 문서에 액세스

개요

Python 기반 MCP (Model Context Protocol) 서버 로컬 문서 인덱스 및 LanceDB 벡터 데이터베이스 및 로컬 LLM을 사용하여 검색합니다. - : PDF, Word (docx/doc), text, Markdown 및 RTF 파일 - : 문서 요약 및 키워드 추출을위한 Ollama 사용. 컴퓨터를 결코 나지 않습니다 - : LanceDB 및 문장 변압기를 사용하여 Semantic 검색 - : Model Context Protocol을 통해 검색 및 카탈로그 도구 - : 리소스를 저장하는 유일한 프로세스 변경 파일 만 - : 표준 노트북 (예 : M1 / M2 MacBook)의 괜찮은 성능을 위해 설계되었습니다. 환경 변수 또는 .env 파일을 사용하여 인덱스를 구성: Claude Desktop 구성 추가 (~/Library/Application Support/Claude/claude desktop config.json): indexer는 MCP를 통해 다음과 같은 도구를 노출시킵니다. 자연적인 언어 쿼리를 사용하여 문서 검색.

개요(AI 번역)

Python 기반 MCP (Model Context Protocol) 서버 로컬 문서 인덱스 및 LanceDB 벡터 데이터베이스 및 로컬 LLM을 사용하여 검색합니다.

특징

-Real-time Document Monitoring: 설정된 폴더에 새 및 수정된 문서를 자동으로 색인 -Multi-format Support: PDF, Word(docx/doc), 텍스트, Markdown 및 RTF 파일 처리 -Local LLM Integration: 문서 요약 및 키워드 추출을 위한 Ollama를 사용합니다. 컴퓨터를 떠난다 -Vector Search: LanceDB 및 문장 변압기를 사용하여 Semantic 검색

  • MCP 통합: Model Context Protocol을 통해 검색 및 카탈로그 도구를 노출
  • Incremental Indexing: 리소스를 저장하기 위해서만 프로세스 변경된 파일
  • Performance Optimized: 표준 노트북(예: M1/M2 MacBook)의 탈중앙 성능 설계

설치

# 필수품

1.Python 3.9+ 설치 2. ** uv ** 포장 매니저:

  1. **올라마 ** (지역 LLM의 경우):

MCP 문서 인덱스 설치

구성

환경변수 또는 .env 파일을 사용하여 인덱스를 구성:

사용법

Standalone 서비스로 실행

Claude 데스크톱과 통합

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

MCP Document Indexer

A Python-based MCP (Model Context Protocol) server for local document indexing and search using LanceDB vector database and local LLMs.

Features

  • Real-time Document Monitoring: Automatically indexes new and modified documents in configured folders
  • Multi-format Support: Handles PDF, Word (docx/doc), text, Markdown, and RTF files
  • Local LLM Integration: Uses Ollama for document summarization and keyword extraction. Nothing ever leaves your computer
  • Vector Search: Semantic search using LanceDB and sentence transformers
  • MCP Integration: Exposes search and catalog tools via Model Context Protocol
  • Incremental Indexing: Only processes changed files to save resources
  • Performance Optimized: Designed for decent performance on standard laptops (e.g. M1/M2 MacBook)

Installation

Prerequisites

  1. Python 3.9+ installed
  2. uv package manager:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Ollama (for local LLM):
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

# Pull a model (e.g., llama3.2)
ollama pull llama3.2:3b

Install MCP Document Indexer

# Clone the repository
git clone https://github.com/yairwein/mcp-doc-indexer.git
cd mcp-doc-indexer

# Install with uv
uv sync

# Or install as a package
uv add mcp-doc-indexer

Configuration

Configure the indexer using environment variables or a .env file:

# Folders to monitor (comma-separated)
WATCH_FOLDERS="/Users/me/Documents,/Users/me/Research"

# LanceDB storage path
LANCEDB_PATH="./vector_index"

# Ollama model for summarization
LLM_MODEL="llama3.2:3b"

# Text chunking settings
CHUNK_SIZE=1000
CHUNK_OVERLAP=200

# Embedding model (sentence-transformers)
EMBEDDING_MODEL="all-MiniLM-L6-v2"

# File types to index
FILE_EXTENSIONS=".pdf,.docx,.doc,.txt,.md,.rtf"

# Maximum file size in MB
MAX_FILE_SIZE_MB=100

# Ollama API URL
OLLAMA_BASE_URL="http://localhost:11434"

Usage

Run as Standalone Service

# Set environment variables
export WATCH_FOLDERS="/path/to/documents"
export LANCEDB_PATH="./my_index"

# Run the indexer
uv run python -m src.main

Integrate with Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "doc-indexer": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/mcp-doc-indexer",
        "python",
        "-m",
        "src.main"
      ],
      "env": {
        "WATCH_FOLDERS": "/Users/me/Documents,/Users/me/Research",
        "LANCEDB_PATH": "/Users/me/.mcp-doc-index",
        "LLM_MODEL": "llama3.2:3b"
      }
    }
  }
}

MCP Tools

The indexer exposes the following tools via MCP:

search_documents

Search for documents using natural language queries.

  • Parameters:
    • query: Search query text
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "doc-indexer": { "command": "uv", "args": [ "run", "--directory", "/path/to/mcp-doc-indexer", "python", "-m", "src.main" ], "env": { "WATCH_FOLDERS": "/Users/me/Documents,/Users/me/Research", "LANCEDB_PATH": "/Users/me/.mcp-doc-index", "LLM_MODEL": "llama3.2:3b" } } } }