Skip to main content
Glama
saewookkangboy

file-analyzer-mcp

file-analyzer-mcp

Python Protocol Scope Tests

ローカルフォルダ内の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)

ツール

説明

list_directory(subpath=".", recursive=True)

フォルダツリー、拡張子別ファイル数/容量

read_document(relative_path)

テキスト/構造抽出 — .pdf .docx .pptx .svg .png

get_file_metadata(relative_path)

サイズ、更新日時、ページ/スライド数、画像解像度など

プロジェクト構成

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)를 위한 운영 지침

セキュリティ & 制約

項目

ポリシー

パス隔離

FILE_ANALYZER_ROOT 配下のみアクセス可能 — ../、絶対パス注入、シンボリックリンク逸脱をすべてブロック

ファイルサイズ

50MB超過時は読み込まずエラーを返す

タイムアウト

抽出/メタデータ解析が30秒を超えるとエラーで中断して返す

対応拡張子

.pdf .docx .pptx .svg .png.ppt(旧形式)、.jpg などは非対応

画像解釈

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 -q

tests/ はパス逸脱・絶対パス注入のブロック、5種類の抽出器、タイムアウト、監査ログ、サーバー統合を 扱います。このプロジェクト規模では、CIパイプラインなしでローカルの pytest 実行のみで回帰検証が 十分であると判断し、その方針を維持しています。

なぜこの設計にしたか

  • 要約機能なし — 別途LLM APIキーなしで動作するよう、抽出はサーバーが/要約はホストが 分担する最小構成を選びました。

  • PNGはOCR、vision渡しではない — ホストに画像をbase64で渡す代わりにテキストのみを抽出して 返却量と実装の複雑さを抑えました(図の視覚的な意味は見られません)。

  • git/CIなしでローカルpytestのみ — 個人用ローカルツールの規模ではCIインフラは過剰と判断しました。

既知の制限

  • タイムアウトはスレッドベースのため、超過した呼び出し自体のバックグラウンドスレッドは返却後も最後まで 実行され続ける可能性があります。

  • .ppt は非対応です — .pptx に変換してから使用してください。

ライセンス

別途ライセンスファイルのない個人プロジェクトです。

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    10
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables 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
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    11
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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