📄 MCP PDF 服务器
基于FastMCP的PDF文件阅读服务器。
支持通过MCP协议进行PDF文本提取、OCR识别、图像提取,内置Web调试器,方便测试。
🚀 功能
读取 PDF 文本
从 PDF 中提取普通文本(逐页)。通过 OCR 读取
使用 OCR 识别扫描或基于图像的 PDF 中的文本。读取 PDF 图像
从指定的 PDF 页面中提取所有图像(Base64 编码输出)。
📂 项目结构
⚙️ 安装
推荐 Python 版本:3.9+
注意:要使用 OCR 功能,您可能需要构建具有 OCR 支持或外部 OCR 库的 MuPDF。
🔦启动服务器
运行以下命令:
您应该会看到如下日志:
🌐 Web 调试接口
打开浏览器并访问:
从左侧面板选择一个工具
在右侧面板填写参数
单击“运行”以测试该工具
无需编码——通过 Web UI 轻松调试和测试。
🛠️ API 工具列表
工具 | 描述 | 输入参数 | 返回 |
| 从 PDF 页面中提取普通文本 |
、
、
| 页面文本列表 |
| 通过 OCR 识别文本 |
、
、
、
、
| OCR提取的文本 |
| 从 PDF 页面中提取图像 |
、
| 图片列表(Base64编码) |
📝 使用示例
从第 1 至第 5 页提取文本:
对第1页进行OCR识别:
提取第 3 页的所有图像:
📢 注释
文件必须放在
pdf_resources/
目录中,或者必须提供绝对路径。OCR 功能需要环境中适当的 OCR 支持。
处理大文件时,根据需要调整内存和超时设置。
📜 许可证
该项目已获得 MIT 许可。
如需商业使用,请注明原始出处。
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
PDF 处理服务器通过常规解析或 OCR 提取文本,并通过内置 Web 调试器的 MCP 协议从 PDF 文件中检索图像。
Related MCP Servers
- AsecurityFlicenseAqualityAn MCP server that provides a tool to extract text content from local PDF files, supporting both standard PDF reading and OCR capabilities with optional page selection.Last updated -118
Textin MCP Serverofficial
AsecurityAlicenseAqualityA server that enables OCR capabilities to recognize text from images, PDFs, and Word documents, convert them to Markdown, and extract key information.Last updated -34523MIT License- -securityAlicense-qualityA Model Context Protocol (MCP) based server that efficiently manages PDF files, allowing AI coding tools like Cursor to read, summarize, and extract information from PDF datasheets to assist embedded development work.Last updated -7Apache 2.0
- -securityFlicense-qualityAn MCP server that provides comprehensive PDF processing capabilities including text extraction, image extraction, table detection, annotation extraction, metadata retrieval, page rendering, and document structure analysis.Last updated -