
yairwein/document-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
ローカル文書にアクセスするためのMCPサーバー
概要
ローカル文書のインデックス作成と検索のための Python ベースの MCP (Model Context Protocol) サーバー LanceDB ベクトルデータベースとローカル LLM を使用して。 - : 設定されたフォルダに新しく変更された文書を自動的にインデックス化 - : PDF、Word(docx/doc)、テキスト、Markdown、RTFファイルを扱う - : ドキュメントの要約とキーワード抽出のためにOllamaを使用します。 コンピューターを離れることはありません - : LanceDB と文変換器を用いたセマンティック検索 - : モデルコンテキストプロトコルによる検索とカタログツールの露出 - : リソースを節約するために変更されたファイルのみを処理する - : 標準のノートパソコン(例: M1/M2 MacBook)のまともなパフォーマンスのために設計 環境変数または .env ファイルを使用して、indexer を構成する: Claudeデスクトップ設定(~/Library/Application Support/Claude/claude desktop config.json)に追加します。 インデックスは、MCP 経由で次のツールを公開します。 自然言語の質問を使用して文書を検索します.
概要(AI 翻訳)
ローカル文書のインデックス作成と検索のための Python ベースの MCP (Model Context Protocol) サーバー LanceDB ベクトルデータベースとローカル LLM を使用して。
##特徴
- リアルタイムドキュメント監視: 設定されたフォルダに新しく変更された文書を自動的にインデックス化 -マルチフォーマットサポート:PDF、Word(docx/doc)、テキスト、Markdown、RTFファイルを扱う
- ローカルLLMインテグレーション:文書の要約とキーワード抽出のためにOllamaを使用します。 コンピュータを離れることはありません -Vector Search: LanceDBと文変換器を用いたセマンティック検索 -MCPインテグレーション:モデルコンテキストプロトコルによる検索およびカタログツールの露出 -Incremental Indexing:リソースを保存するための変更されたファイルのみ
- 性能は最大限に活用:標準のラップトップ(例えばM1/M2 MacBook)のまともな性能のために設計しました
インストール
前提条件
1。 Python 3.9+ インストール 2.uvパッケージマネージャ:
3.オラマ(ローカルLMの場合):
インストールMCPドキュメントインデックス
設定
環境変数または.envファイルを使用して、indexerを構成します。
使用法
##スタンドアローンサービスとして実行
##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
- Python 3.9+ installed
- uv package manager:
curl -LsSf https://astral.sh/uv/install.sh | sh
- 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
インストール
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"
}
}
}
}