Skip to main content
Glama
Seonja-Lee

file-analysis-mcp

by Seonja-Lee

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가 파이썬 인터프리터와 의존성을 모두 관리합니다.

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 tools
list_folder_structureA

지정한 폴더를 재귀적으로 탐색해 트리 구조, 확장자별 파일 개수, 총 용량을 JSON 문자열로 반환한다.

NameRequiredDescriptionDefault
pathYes
max_depthNo

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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, 이미지)의 내용을 읽어 텍스트/이미지로 반환한다. 반환된 텍스트/이미지를 바탕으로 호출자가 직접 요약을 수행해야 한다.

NameRequiredDescriptionDefault
pathYes
max_charsNo
max_pagesNo

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

  1. 2 tool updatesv0.1.0
    • First observedlist_folder_structure
    • First observedread_document

TDQS

A3.8/5.0

Scored across 2 tools

Disambiguation5/5

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.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern: list_folder_structure and read_document. The naming is predictable and easy to understand.

Tool Count3/5

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.

Completeness3/5

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

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

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