file-analysis-mcp
file-analysis-mcp
指定したフォルダ内の非構造化ドキュメント(PDF、PPTX、DOCX、SVG、PNGなどの画像)を読み取り、 呼び出し元ホスト(Claude Code、Codex CLIなど)が内容の要約とフォルダ構造の分析を 行えるように、原文テキスト/画像をそのまま渡す個人用MCPサーバーです。
このサーバーは要約を直接実行しません — テキストを抽出し、画像を そのまま返すだけで、実際の要約はこのツールを呼び出したLLM(Claude Code/Codex)が 実行します。別途APIキーは不要です。
提供ツール
list_folder_structure(path, max_depth=5)指定フォルダを再帰探索し、ツリー構造、拡張子別ファイル数、総容量をJSONで返す。read_document(path, max_chars=20000, max_pages=30)拡張子に応じて内容を抽出し、テキスト/画像で返す。.pdf→ ページごとのテキスト.pptx→ スライドごとのテキスト + ノート.docx→ 段落/見出し/表のテキスト.svg→ 原文XML + ラスタライズしたPNG画像(可能な場合).png/.jpg/.jpeg/.bmp/.gif/.webp→ 画像そのまま(リサイズ後)
Related MCP server: File Context MCP Server
インストール
uvがPythonインタープリタと依存関係をすべて管理します。
cd file-analysis-mcp
uv syncローカルテスト(MCP Inspector)
npx @modelcontextprotocol/inspector uv run --directory . python server.pyブラウザで開くInspector UIで、list_folder_structure、read_documentを
直接呼び出して試せます。test_samples/フォルダにPDF/PPTX/DOCX/SVG/PNGのサンプル
ファイルが用意されており、すぐにテスト可能です。
Claude Codeに登録
claude mcp add file-analysis -s user -- uv run --directory "C:\Users\20210\Desktop\testmcp\file-analysis-mcp" python server.py上記のコマンドでユーザー範囲(user scope)に登録済みのため、すべてのプロジェクトで使用
可能です。新しいMCPサーバーはセッション開始時にロードされるため、Claude Codeを再起動(または
新しいセッションを開始)しないとツールが表示されません。 登録状態の確認: claude mcp list
Codex CLIに登録
codex mcp add file-analysis -- uv run --directory "C:\Users\20210\Desktop\testmcp\file-analysis-mcp" python server.pyすでにグローバル(global)に登録されています。確認: codex mcp list
使用例(登録後の新しいセッションで)
「C:\Users\me\Documents\報告書フォルダの構造を分析して、中のドキュメントを要約して」
と依頼すると、Claude Code/Codexがlist_folder_structureで構造を把握した後、
必要なファイルに対してread_documentを呼び出して内容を読み、直接要約します。
参考 / 制限事項
パスは呼び出しのたびに引数で渡す方式のため、アクセスフォルダ制限(allowlist)は 設定されていません。信頼できるローカル環境で個人用に使用することを前提としています。
テキストは
max_chars、PDFはmax_pagesで長さを制限し、コンテキストの 肥大化を防ぎます。より長い内容が必要な場合は、呼び出し時に値を増やしてリクエストしてください。SVGのラスタライズ(
svglib)は、一部の複雑なSVG機能(フィルター、グラデーションの一部など)を 完全にはサポートしない場合があります。失敗しても原文XMLテキストは常に返されます。
Available Tools
2 toolslist_folder_structureA
지정한 폴더를 재귀적으로 탐색해 트리 구조, 확장자별 파일 개수, 총 용량을 JSON 문자열로 반환한다.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| max_depth | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are absent, so the description carries the burden of explaining behavior. It discloses the recursive traversal, the aggregation of file counts and sizes, and the JSON-string return format. It does not cover edge cases like missing paths or permission errors, but the non-mutating intent is clear.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, dense sentence with no filler. It front-loads the operation, specifies the resource, lists the outputs, and states the return format.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The output schema likely covers return values, and the description covers the core recursive behavior. However, max_depth semantics and path expectations are undocumented, and there is no usage guidance relative to read_document, so the description is only minimally complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It loosely maps to the path parameter via 'specified folder' and mentions recursion, but it does not explain max_depth, its limit semantics, or the path format. The agent is left to infer important parameter behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific action (recursively explores the specified folder) and names concrete outputs: tree structure, per-extension file counts, and total capacity, all returned as a JSON string. This clearly distinguishes it from the sibling read_document, which presumably reads a single document.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance is given, and the sibling read_document is not referenced. The intended use is implied by the description, but the agent gets no direct help choosing between this tool and the alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_documentA
지정한 문서 파일(PDF, PPTX, DOCX, SVG, 이미지)의 내용을 읽어 텍스트/이미지로 반환한다. 반환된 텍스트/이미지를 바탕으로 호출자가 직접 요약을 수행해야 한다.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| max_chars | No | ||
| max_pages | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description takes on the disclosure burden. It usefully discloses that the tool returns text/image and that the caller must perform summarization. However, it does not mention truncation behavior related to max_chars/max_pages, error handling, or how images are represented in the return value.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two compact sentences with no filler. The primary purpose is front-loaded, and the second sentence adds a meaningful caveat about caller responsibility. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The core read-and-return semantics and supported formats are covered, and the 'caller must summarize' note is helpful. However, with no annotations, no output schema, and undocumented max_chars/max_pages, an agent still lacks guidance on partial reads, truncation, or complete return-value structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 0% description coverage, so the description must compensate. It only implies that 'path' points to a supported document file; max_chars and max_pages are not explained at all, leaving the agent to guess their semantics beyond names and defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('reads') and clearly identifies the resource: document files (PDF, PPTX, DOCX, SVG, images). It also states the output type (text/image), and the sibling tool list_folder_structure is clearly different, so an agent can distinguish them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies it is for retrieving document content rather than summarizing, and the sibling is for listing folder structureikuha. However, it never explicitly states when to use this tool vs. list_folder_structure, nor does it mention exclusions or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.1.0- First observed
list_folder_structure - First observed
read_document
TDQS
Scored across 2 tools
The two tools have clearly distinct responsibilities: one summarizes folder structure and statistics, while the other extracts content from document files. There is no overlap or ambiguity between them.
Both tool names follow a consistent verb_noun pattern: list_folder_structure and read_document. The naming is predictable and easy to understand.
With only two tools, the server feels minimal and borderline thin for a file-analysis purpose. Each tool is useful, but the overall surface is small and may leave users wanting more capability.
The pair covers folder structure analysis and document content extraction, but common file types like plain text and CSV are not supported, and there are no file search or metadata retrieval operations. These are notable gaps for a file-analysis server.
Maintenance
Related MCP Connectors
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Securely search and manage workspace context files for AI agents and teams.
Read and search folders on your own computer with explicit consent. Files are never uploaded.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Large Language Models to safely browse and interact with local file systems through secure directory listing, file reading, and content search capabilities. Built with comprehensive security controls and high-performance handling of large directories and files.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, search, and analyze local file systems with tools for reading file contents, listing directories, searching by patterns, and analyzing folder structures for context-aware queries.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to generate annotated file trees, retrieve file statistics, list git-changed files, and read file contents from local directories or GitHub repositories.MIT
- FlicenseAqualityCmaintenanceEnables read-only analysis of local unstructured documents by scanning a folder, extracting text and structural metadata, and passing content with truncation and error-awareness to an LLM for summarization.91-