file-analyzer-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@file-analyzer-mcpWhat files are in the current folder?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
file-analyzer-mcp
A personal stdio MCP server that extracts only text/structure from PDF, DOCX, PPTX, SVG, and PNG files in a local folder. It does not summarize or interpret — reading the extracted results and summarizing them is the job of the host LLM (such as Claude Code) that calls this tool.
What it does / What it doesn't do
Does | Doesn't |
Extracts text/structure from documents under the specified root folder | Summarize or interpret (handled by the host LLM) |
Aggregates folder tree and file count/size by extension | Write, delete, or move files (read-only) |
Extracts OCR text from PNGs | Understand the visual meaning of images (figures, charts) |
Handles timeouts for large/corrupted files | Change the analysis target folder while the server is running |
Related MCP server: Docalyze
Example run
> 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" }Quick start
git clone https://github.com/asuramama-hue/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 추가)Register with Claude Code:
claude mcp add file-analyzer --env FILE_ANALYZER_ROOT=/분석할/폴더 -- \
"$(pwd)/.venv/bin/python" "$(pwd)/server.py"
claude mcp list # ✔ Connected 확인After registration, in a new session, ask "summarize the documents in this folder" and Claude will call the 3 tools below directly.
Tools
Tool | Description |
| Folder tree, file count/size by extension |
| Text/structure extraction — |
| Size, modification time, page/slide count, image resolution, etc. |
Project structure
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)를 위한 운영 지침Security & constraints
Item | Policy |
Path isolation | Only accessible under |
File size | Returns an error without reading if larger than 50MB |
Timeout | Aborts with an error if extraction/metadata parsing exceeds 30 seconds |
Supported extensions |
|
Image interpretation | Only OCR text is extracted; the visual meaning of figures/charts cannot be understood |
Analysis target folder | Fixed once at server startup; cannot be changed while running |
Observability — audit log
Every tool call is recorded locally, one line at a time, in logs/audit.jsonl (no external transmission).
{"timestamp": "2026-08-26T06:03:35Z", "tool": "read_document", "params": {"relative_path": "report.pdf"}, "status": "ok", "duration_ms": 251.3}To clear the log, delete logs/audit.jsonl.
Development
pip install -e ".[dev]"
pytest -qtests/ covers path escape and absolute path injection blocking, the 5 extractors, timeouts, audit logging, and server integration. At this project's scale, I judged that local pytest runs alone are sufficient for regression validation without a CI pipeline, and have kept it that way.
Why I designed it this way
No summarization feature — To work without a separate LLM API key, I chose a minimal structure where the server handles extraction and the host handles summarization.
PNG uses OCR, not vision passthrough — Instead of passing the image to the host as base64, I extract only text to reduce response size and implementation complexity (the visual meaning of figures is not visible).
Local pytest only, no git/CI — For a single-person local tool of this scale, CI infrastructure seemed excessive.
Known limitations
The timeout is thread-based, so the background thread of an exceeded call may keep running to completion even after the response is returned.
.pptis not supported — convert to.pptxbefore use.
License
A personal project with no separate license file.
This server cannot be deployed
Maintenance
Related MCP Connectors
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
DocBase MCP server for AI agents
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server that reads PDFs and exposes them as structured Markdown, metadata, outlines, images, and tables to LLM consumers via tools like pdf_read_markdown and pdf_info.Apache 2.0
- AlicenseBqualityDmaintenanceAn MCP server that lets AI assistants read and visually analyze local documents — PDFs, Excel spreadsheets, CSV files, Word documents, PowerPoint presentations, and images.442 npm53 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceLocal MCP server that indexes folders of documents into a hybrid vector + keyword search index for Claude Desktop, with support for PDFs, Office files, and images via OCR.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for indexing, semantic search, and generation of multi-format documents. Exposes 13 tools over JSON-RPC 2.0 so an LLM can search your local PDF, Excel, and Word files, and create or edit Excel and Word documents.AGPL 3.0