Skip to main content
Glama
skaosqkf0-del

file-analyzer-mcp

效果演示

指向一个文件夹,它返回的是真实的目录树,而不是猜测:

$ analyze_folder_structure({ "folder_path": "tests/fixtures" })
{
  "status": "OK",
  "file_count": 6,
  "supported_file_count": 6,
  "extension_stats": [
    { "extension": ".pdf",  "count": 2, "bytes": 723995 },
    { "extension": ".docx", "count": 1, "bytes": 35505 },
    { "extension": ".pptx", "count": 1, "bytes": 33067 },
    { "extension": ".svg",  "count": 1, "bytes": 319 },
    { "extension": ".png",  "count": 1, "bytes": 74 }
  ],
  "tree_text": "fixtures/\n├── sample.docx (34.7KB)\n├── sample.pdf (431B)\n├── sample.png (74B)\n├── sample.pptx (32.3KB)\n├── sample.svg (319B)\n└── sample_scanned.pdf (706.6KB)"
}

然后读取其中一个文件——标题、段落和表格以结构化形式返回,而不是被压平:

$ read_docx({ "file_path": "tests/fixtures/sample.docx" })
{
  "status": "OK",
  "headings": ["테스트 문서"],
  "text": "테스트 문서\n본문 첫 문단입니다.",
  "tables": [{ "index": 0, "rows": [["A", "B"], ["1", "2"]] }]
}

两个调用都可复现——克隆本仓库,运行 uv sync --extra dev,然后自行对 tests/fixtures/ 调用它们。

Related MCP server: Agent Helper

它是什么

一个个人 MCP 服务器,读取文件夹中的任何内容——PDF、Word、PowerPoint、SVG、 PNG——并将结构和原始内容交还给调用它的任何代理 (Claude Code、Claude Desktop、Codex)。它本身不进行任何摘要。

整个设计就是这样:服务器负责提取,宿主负责解释。这个服务器中不存放任何 LLM API 密钥。PNG 以 base64 图像内容返回,而不是一段说明文字—— 由你宿主的视觉模型自行读取。扫描版 PDF 只在你要求时才进行 OCR。

工具

工具

作用

analyze_folder_structure

文件夹的递归目录树 + 按扩展名统计

list_supported_files

仅列出 pdf/docx/pptx/svg/png 路径,已过滤

read_pdf

逐页文本。ocr=True 时对没有文本层的页面运行 Tesseract

read_docx

段落、标题、表格(不支持 .doc)

read_pptx

逐页幻灯片的标题、正文、演讲者备注(不支持 .ppt)

read_svg

尺寸、标签计数、<text> 内容——不进行栅格化

read_image

PNG 以元数据 + 图像内容返回,供宿主直接查看

大文档支持分页:PDF 用 page_start/page_end,PPTX 用 slide_start/slide_end。 默认上限为 30 页 / 60 张幻灯片——超过后,响应的 next_actions 会告诉你下一步要请求的范围。

安装

uv sync --extra dev

使用 Claude Code 注册:

claude mcp add -s user file-analyzer -- "<uv.exe path>" --directory "<this folder>" run python src/file_analyzer_mcp/server.py

在 Windows 上,如果 uv 是通过 pip 安装的,它不会出现在 Claude 的 PATH 中——请使用 uv.exe 的 完整路径(用 pip show uv 查找)。Claude Desktop 和 Codex 的示例在 config/ 中:claude_code.example.mdclaude_desktop_config.example.jsoncodex-config.example.toml

安全

敏感路径会被确定性地拒绝——这不依赖于模型自行决定不去读取它们。参见 paths.py

模式

保护内容

.ssh.aws.gnupg.azure.kube.docker

凭据和云配置目录

浏览器配置文件根目录(例如 User Data

已保存的登录信息和 Cookie

.env**.pem*.key*.pfx*.p12

密钥文件,按名称模式匹配

id_rsaid_ed25519known_hosts.netrccredentialscredentials.jsonlogin datacookiesweb data

特定的凭据文件名

每次调用也都会被审计——工具名称、参数和结果(成功或阻止) 都会追加到 logs/audit.jsonl。参见 audit.py。 除此之外还有 50MB 的文件大小上限。

扩展此服务器的约定见 AGENTS.md

错误

每次失败都会抛出带代码的 ToolFailure,包含通俗易懂的原因以及 恢复方法——消息是写给调用它的模型去阅读和执行的, 而不仅仅是给人类看的。

代码

触发时机

PATH_NOT_FOUND

文件夹或文件路径不存在

NOT_A_DIRECTORY / NOT_A_FILE

工具收到了错误类型的路径

UNSUPPORTED_EXTENSION

文件不是 pdf/docx/pptx/svg/png

WRONG_TOOL_FOR_EXTENSION

例如对 .docx 调用了 read_pdf

FILE_TOO_LARGE

文件超过 50MB 上限

SENSITIVE_PATH_BLOCKED

路径匹配上方的安全表

OCR_ENGINE_NOT_FOUND

ocr=True 但 Tesseract 未安装/未配置

SVG_PARSE_ERROR

.svg 文件不是有效的 XML

扫描版 PDF 的 OCR

read_pdf(ocr=True) 需要 Tesseract:

winget install UB-Mannheim.TesseractOCR
uv run python scripts/setup_ocr.py   # copies eng/osd, downloads kor.traineddata

ocr_lang 默认为 "kor+eng"。Tesseract 路径不对?设置 TESSERACT_CMD

测试

uv run pytest -q                        # parser / path / audit unit tests
uv run python scripts/smoke_stdio.py    # real stdio round-trip against the server

两者都应通过,一项更改才算完成——pytest 在隔离环境中检查各模块, 冒烟测试是唯一实际演练 MCP 协议并捕获模式层面破坏的测试。

限制

限制

原因 / 处理方法

不支持 .doc / .ppt

旧版二进制格式——请先另存为 .docx/.pptx

扫描版 PDF 默认返回空文本

传入 ocr=True(默认关闭——因为它较慢)

SVG 不进行栅格化

作为 XML 解析以获取结构,而不是渲染为图像

Install Server
F
license - not found
A
quality
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

  • F
    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.
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to inspect and convert PDF, PowerPoint, Excel, and many other file formats into clean, structured Markdown, with chunking support for long documents.
    Apache 2.0
  • 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

View all related MCP servers

Related MCP Connectors

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • Securely search and manage workspace context files for AI agents and teams.

  • Read PDFs and images as markdown or text, with exact costs and hard spend caps. $0.75/1k pages.

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/skaosqkf0-del/MCP_test'

If you have feedback or need assistance with the MCP directory API, please join our Discord server