PDF阅读器MCP服务器
模型上下文协议 (MCP) 服务器提供从 PDF 文件读取和提取文本的工具,支持本地文件和 URL。
作者
菲利普·范德沃克
电子邮件: philip.vandewalker@gmail.com
GitHub: https://github.com/trafflux
特征
- 从本地PDF文件中读取文本内容
- 从 PDF URL 读取文本内容
- 损坏或无效 PDF 的错误处理
- 用于访问本地 PDF 的卷安装
- 自动检测 PDF 编码
- 标准化 JSON 输出格式
安装
- 克隆存储库:
- 构建 Docker 镜像:
用法
运行服务器
要运行可以访问本地 PDF 文件的服务器:
将/path/to/pdfs
替换为 PDF 文件目录的实际路径。
如果不使用本地 PDF 文件:
MCP 配置
添加到您的 MCP 设置配置:
不含本地文件的PDF文件:
可用工具
read_local_pdf
- 目的:从本地PDF文件中读取文本内容
- 输入:
- 输出:
read_pdf_url
- 目的:从 PDF URL 读取文本内容
- 输入:
- 输出:
错误处理
服务器通过清晰的错误消息处理各种错误情况:
- 无效或损坏的 PDF 文件
- 缺少文件
- 失败的 URL 请求
- 权限问题
- 网络连接问题
错误响应遵循以下格式:
依赖项
- Python 3.11+
- PyPDF2:PDF解析和文本提取
- 请求:用于从 URL 获取 PDF 的 HTTP 客户端
- MCP SDK:模型上下文协议实现
项目结构
执照
版权所有 2025 菲利普·范德沃克
本文件遵循 Apache 许可证 2.0 版(简称“许可证”);您不得在未遵守该许可证的情况下使用本文件。您可以访问以下网址获取许可证副本:
除非适用法律另有规定或双方以书面形式达成一致,否则根据本许可证分发的软件均按“原样”分发,不附带任何明示或暗示的保证或条件。请参阅许可证,了解本许可证下特定语言的权限和限制规定。
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
接触
如有任何疑问、问题或投稿,请联系 Philip Van de Walker:
- 电子邮件: philip.vandewalker@gmail.com
- GitHub: https://github.com/trafflux
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
提供从 PDF 文件读取和提取文本的工具,支持本地文件和 URL。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityEnables text extraction from web pages and PDFs, and execution of predefined commands, enhancing content processing and automation capabilities.Last updated -3TypeScriptMIT License
- AsecurityAlicenseAqualityProvides comprehensive document processing, including reading, converting, and manipulating various document formats with advanced text and HTML processing capabilities.Last updated -1623111TypeScriptMIT License
- -securityFlicense-qualityA server providing PDF form manipulation tools via MCP's API, allowing users to find PDFs across directories, extract form field information, and visualize form fields in documents.Last updated -Python
- 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 -16Python