file-analyzer-mcp
file-analyzer-mcp
ローカルフォルダ内のPDF・DOCX・PPTX・SVG・PNGからテキスト/構造のみを抽出する個人用 stdio MCP サーバーです。要約・解釈は行いません — 抽出された結果を読んで要約するのは、このツールを呼び出す ホストLLM(Claude Code など)の役割です。
行うこと / 行わないこと
行うこと | 行わないこと |
指定ルートフォルダ配下のドキュメントのテキスト/構造抽出 | 要約・解釈(ホストLLMが担当) |
フォルダツリー・拡張子別ファイル数/容量の集計 | ファイルの書き込み・削除・移動(読み取り専用) |
PNGのOCRテキスト抽出 | 画像の視覚的な意味(図・チャート)の把握 |
大容量/破損ファイルに対するタイムアウト処理 | サーバー実行中の分析対象フォルダの変更 |
Related MCP server: Visual Document Forensics MCP Server
実行例
> read_document("quarterly-report.pdf")
{
"type": "pdf",
"num_pages": 12,
"text": "Q3 Revenue Summary\n..."
}
> read_document("../../etc/passwd")
{ "error": "'../../etc/passwd' resolves outside the allowed root folder" }クイックスタート
git clone https://github.com/saewookkangboy/fileanalyzer_mcp_testmonial.git
cd fileanalyzer_mcp_testmonial
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
brew install tesseract # PNG OCR용 (한국어는 brew install tesseract-lang 추가)Claude Code に登録:
claude mcp add file-analyzer --env FILE_ANALYZER_ROOT=/분석할/폴더 -- \
"$(pwd)/.venv/bin/python" "$(pwd)/server.py"
claude mcp list # ✔ Connected 확인登録後、新しいセッションで「このフォルダのドキュメントを要約して」と依頼すると、以下の3つのツールをClaudeが 直接呼び出します。
ツール (Tools)
ツール | 説明 |
| フォルダツリー、拡張子別ファイル数/容量 |
| テキスト/構造抽出 — |
| サイズ、更新日時、ページ/スライド数、画像解像度など |
プロジェクト構成
server.py # FastMCP 앱 진입점, 툴 등록, 루트 폴더 검증
file_analyzer/
security.py # 경로 격리(resolve_safe_path), 크기 제한
timeout.py # 추출 작업 하드 타임아웃
audit.py # 로컬 감사 로그(logs/audit.jsonl)
tree.py, metadata.py # list_directory / get_file_metadata 로직
extractors/ # pdf · docx · pptx · svg · image(OCR) 추출기
tests/ # pytest 회귀 스위트
AGENTS.md # 호출 에이전트(Claude Code)를 위한 운영 지침セキュリティ & 制約
項目 | ポリシー |
パス隔離 |
|
ファイルサイズ | 50MB超過時は読み込まずエラーを返す |
タイムアウト | 抽出/メタデータ解析が30秒を超えるとエラーで中断して返す |
対応拡張子 |
|
画像解釈 | OCRテキストのみ抽出、図/チャートの視覚的な意味は把握できない |
分析対象フォルダ | サーバー起動時に1回固定、実行中は変更不可 |
可観測性 — 監査ログ
すべてのツール呼び出しは logs/audit.jsonl にローカルのみ1行ずつ記録されます(外部送信なし)。
{"timestamp": "2026-08-26T06:03:35Z", "tool": "read_document", "params": {"relative_path": "report.pdf"}, "status": "ok", "duration_ms": 251.3}ログを消去するには logs/audit.jsonl を削除してください。
開発
pip install -e ".[dev]"
pytest -qtests/ はパス逸脱・絶対パス注入のブロック、5種類の抽出器、タイムアウト、監査ログ、サーバー統合を
扱います。このプロジェクト規模では、CIパイプラインなしでローカルの pytest 実行のみで回帰検証が
十分であると判断し、その方針を維持しています。
なぜこの設計にしたか
要約機能なし — 別途LLM APIキーなしで動作するよう、抽出はサーバーが/要約はホストが 分担する最小構成を選びました。
PNGはOCR、vision渡しではない — ホストに画像をbase64で渡す代わりにテキストのみを抽出して 返却量と実装の複雑さを抑えました(図の視覚的な意味は見られません)。
git/CIなしでローカルpytestのみ — 個人用ローカルツールの規模ではCIインフラは過剰と判断しました。
既知の制限
タイムアウトはスレッドベースのため、超過した呼び出し自体のバックグラウンドスレッドは返却後も最後まで 実行され続ける可能性があります。
.pptは非対応です —.pptxに変換してから使用してください。
ライセンス
別途ライセンスファイルのない個人プロジェクトです。
This server cannot be installed
Maintenance
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
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered extraction and analysis of PDF documents with 40+ specialized tools for text, tables, images, layout analysis, security assessment, and document intelligence. Supports both text-based and scanned PDFs with OCR capabilities.10MIT
- FlicenseNot gradedqualityBmaintenanceEnables deterministic visual and structural analysis of PDF and DOCX documents, extracting measurable evidence such as blur, OCR confidence, and image anomalies for auditable forensic workflows.1
- AlicenseAqualityCmaintenanceEnables reading and extracting text from local documents (PDF, Word, Excel, PowerPoint, HWP, Markdown, CSV, etc.) without network access, and provides approval-gated summary saving and file organization.11MIT
- FlicenseAqualityCmaintenanceEnables local analysis of unstructured documents (PDF, DOCX, PPTX, SVG, PNG) by extracting text and structure with citation anchors, and verifies summaries against source material before a human approves saving a report.9
Related MCP Connectors
Read PDFs and images as markdown or text, with exact costs and hard spend caps. $0.75/1k pages.
PDF accessibility checks (veraPDF PDF/UA-1), auto-fix and Markdown conversion. EU-hosted.
Turn any PDF into structured JSON via AI + OCR: invoices, bank statements, contracts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/saewookkangboy/fileanalyzer_mcp_testmonial'
If you have feedback or need assistance with the MCP directory API, please join our Discord server