PDF Reader

io.github.Xvvln由 GitHub 账号 Xvvln 发布v0.2.1更新于 Oct 24, 2026

MCP server for extracting text, images, tables, links, annotations, and metadata from PDF files.

已验证STDIO仅桌面文件与存储数据与分析

概览

AI 生成的概览

本地 MCP 服务器,让助手读取 PDF 文件:文本、页面图像、表格、图片、链接、批注、目录和元数据。

可以做什么
  • 读取文档元数据、页数、文件大小、加密状态以及单页详情
  • 按页码范围提取文本、带页面上下文搜索文本,并统计文本信息
  • 将页面渲染为 base64 图像,并提取内嵌图片
  • 提取表格、外部链接和内部页面跳转
  • 读取书签目录、评论与高亮,并比较两页文本相似度
适用场景
适合让助手就本地 PDF 报告、论文或合同回答问题、在文档内检索,或提取表格、链接和批注,而无需把文件上传到外部服务。
运行要求
作为本地进程在用户机器上运行(仅桌面端)。需要 Python 3.10+ 和 PyPI 包 pdf-insight-mcp,通常用 uvx 或 pip install 启动。各工具需传入 PDF 文件的绝对路径。未声明账号、API 密钥或环境变量。
安装前请注意
助手可读取你提供的任意 PDF 路径,请只指向愿意在对话中暴露的文件。加密 PDF 除非本身无需密码即可访问,否则会被拒绝;扫描版 PDF 可能几乎提取不到文本。大页码范围与图像渲染有上限,结果可能不完整。

安装

在 SourceWeft 中

  1. 打开 控制台中的 PDF Reader,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

pdf-reader-mcp

一个用于读取和分析 PDF 文件的 MCP 服务器。它可以为支持 MCP(Model Context Protocol)的客户端提供 PDF 文本、页面图片、表格、链接、批注、目录、元数据和基础文本统计。

A PDF-focused MCP server for extracting text, rendered pages, tables, links, annotations, outlines, metadata, and text statistics from PDF files.

Package name

  • GitHub repository: pdf-reader-mcp
  • MCP Registry name: io.github.Xvvln/pdf-reader-mcp
  • PyPI package: pdf-insight-mcp
  • CLI commands: pdf-reader-mcp and pdf-insight-mcp

pdf-reader-mcp is the project name. The PyPI package is published as pdf-insight-mcp because the pdf-reader-mcp package name is not available on PyPI.

Features

ToolWhat it does
get_pdf_infoRead document metadata, page count, file size, and encryption status.
read_pdf_as_textExtract text from selected pages with page and character limits.
read_pdf_as_imagesRender selected pages as base64-encoded images.
get_pdf_outlineRead bookmarks and outline entries.
search_pdf_textSearch text and return per-match page context.
extract_pdf_tablesExtract structured tables when PyMuPDF can detect them.
extract_pdf_imagesExtract embedded PDF images.
get_pdf_page_infoInspect one page's size, text, images, links, and rotation.
extract_pdf_linksExtract external URLs and internal page jumps.
get_pdf_annotationsRead comments, highlights, and annotation metadata.
get_pdf_text_statsCompute text, line, paragraph, and scan-likelihood stats.
compare_pdf_pagesCompare text similarity between two pages.

Quick start

Install uv if you do not already have it:

bash
curl -LsSf https://astral.sh/uv/install.sh | sh

Run the server directly from PyPI:

bash
uvx pdf-insight-mcp

Or install it first:

bash
python -m pip install pdf-insight-mcppdf-reader-mcp

MCP client configuration

Use the published PyPI package:

json
{  "mcpServers": {    "pdf-reader": {      "command": "uvx",      "args": ["pdf-insight-mcp"]    }  }}

Use a local checkout for development:

json
{  "mcpServers": {    "pdf-reader": {      "command": "uv",      "args": [        "--directory",        "/absolute/path/to/pdf-reader-mcp",        "run",        "pdf-reader-mcp"      ]    }  }}

Replace /absolute/path/to/pdf-reader-mcp with the absolute path to this repository on your machine.

Common usage

Ask your MCP client to call tools with an absolute PDF path. Example requests:

text
Read /Users/me/Documents/report.pdf as text.Search /Users/me/Documents/report.pdf for "baseline characteristics".Render pages 1-3 of /Users/me/Documents/report.pdf as images.Extract links and annotations from /Users/me/Documents/review.pdf.

For large PDFs, prefer small page ranges first. For scanned or layout-sensitive PDFs, use read_pdf_as_images with a small pages range and moderate dpi.

Limits and behavior

  • read_pdf_as_text defaults to at most 50 pages and 200000 returned characters.
  • read_pdf_as_images rejects requests above 20 pages.
  • read_pdf_as_images defaults to an overall image payload cap of about 20 MB.
  • extract_pdf_images returns at most 20 embedded images but reports the actual detected total.
  • Encrypted PDFs are rejected unless they are already accessible without a password.
  • Scanned PDFs may have little or no extractable text. Use image rendering or OCR outside this server when needed.

Development

Install dependencies:

bash
uv sync --extra dev

Run tests:

bash
uv run pytest -q

Build the package:

bash
uv builduvx twine check dist/*

Run the local server:

bash
uv run pdf-reader-mcp

Release

Releases are published through GitHub Actions.

Before the first release, configure PyPI Trusted Publishing with:

text
PyPI project name: pdf-insight-mcpOwner: XvvlnRepository name: pdf-reader-mcpWorkflow filename: publish.ymlEnvironment name: leave empty

Then release by bumping versions in pyproject.toml and server.json, committing the change, and pushing a version tag:

bash
git tag vX.Y.Zgit push origin main --tags

The Publish workflow runs tests, builds the Python package, publishes to PyPI, authenticates to the MCP Registry with GitHub OIDC, and publishes server.json.

Tech stack

  • Python 3.10+
  • MCP Python SDK
  • PyMuPDF
  • uv
  • pytest

License

MIT

来源:README.md,提交 88d4232

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分