Skip to main content
Glama

dsh-read-pdf — 让 DSH 阅读 PDF 的 MCP 服务器 + 命令行工具

一个基于 Model Context Protocol 的 PDF 读取服务器: 文字提取、中文 OCR(扫描版)、页面渲染、文件搜索、拖拽收件箱,开箱即用。 兼容任何 MCP 客户端:DSH、Claude Desktop、Codex、Cursor,或你自己的应用。 仓库:https://github.com/xiaoxuPekingUniversity/dsh-read-pdf

English · 中文


中文

功能

工具

说明

pdf_info

页数 / 是否扫描版 / 文件大小

pdf_text

提取指定页文字(pages1-3,5

pdf_ocr

扫描版中文 OCR(RapidOCR,本地运行,无需联网)

pdf_render

把页面渲染成 PNG(公式/图形页面人工查看用)

pdf_find

在目录里按关键词找 PDF(按修改时间倒序)

命令行版 pdf_tools.py 提供同样能力,不依赖 MCP 客户端。

PDF Drop 收件箱(拖拽上传)pdf_drop_server.py 是一个零依赖的本地网页服务, 在浏览器里把 PDF 拖进拖放区即保存到本地文件夹——适合“给 AI 投喂资料”,无需宿主支持附件上传。

安装

pip install -r requirements.txt

用法

命令行(CLI)

python pdf_tools.py info    exam.pdf
python pdf_tools.py text    exam.pdf --pages 1-3
python pdf_tools.py ocr     scanned.pdf            # 扫描版中文识别
python pdf_tools.py render  exam.pdf --pages 1-3
python pdf_tools.py find --dir ~/Downloads "期末"

PDF Drop 收件箱(拖拽上传)

python pdf_drop_server.py --port 8765   # 浏览器打开 http://127.0.0.1:8765

作为 MCP 服务器

DSH(profiles/web/cordis.patch.yml 追加):

- insert:
    - id: mcp-pdf
      name: '@deepseek-ai/dsh-mcp-client'
      config:
        transport: stdio
        serverName: pdf
        command: python
        args:
          - /绝对路径/mcp_pdf_server.py
        failOnStartupError: false

作为 DSH 原生插件(带 Web 设置页开关,推荐)

ds-plugin/ 提供零构建的宿主插件,在设置页给出「PDF 阅读」开关(运行时启停工具),见 ds-plugin/README.md

Claude Desktop(claude_desktop_config.json):见 examples/claude_desktop_config.json

典型场景

  • 把扫描版试卷丢进支持 MCP 的 AI 客户端 → 自动识别成文字 → 生成解析/讲义;

  • 与本地 AI 工作台配合:AI 直接调用 pdf_text/pdf_ocr 读取资料文件夹里的 PDF。

开发计划

  • 支持更多文件类型(docx / xlsx)

  • 拖拽上传(把 PDF 直接拖进聊天框)——需要宿主客户端支持非图片附件,欢迎来这个仓库协作

  • PDF 合并 / 拆分 / 转图片批量处理

Related MCP server: MCP Server Knowledge Engine

English

Features

Tool

Description

pdf_info

Page count / scanned detection / size

pdf_text

Extract text from selected pages (pages like 1-3,5)

pdf_ocr

Chinese OCR for scanned PDFs (RapidOCR, fully local)

pdf_render

Render pages to PNG (for formula/diagram pages)

pdf_find

Find PDFs in a directory by keyword (newest first)

A CLI (pdf_tools.py) provides the same capabilities without any MCP client. pdf_drop_server.py adds a zero-dependency local drag-and-drop inbox web page for feeding PDFs into an AI workspace (no host-side attachment support needed).

Install

pip install -r requirements.txt

Usage

CLI

python pdf_tools.py info    exam.pdf
python pdf_tools.py text    exam.pdf --pages 1-3
python pdf_tools.py ocr     scanned.pdf
python pdf_tools.py render  exam.pdf --pages 1-3
python pdf_tools.py find --dir ~/Downloads "final"

As an MCP server — register with any MCP-capable client (DSH, Claude Desktop, Codex…). See examples/ for config snippets.

Roadmap

  • Support more file types (docx / xlsx)

  • Drag-and-drop upload into chat UIs (requires host-side non-image attachment support — contributions welcome)

  • PDF merge / split / batch conversion

License

MIT

A
license - permissive license
Not graded
quality - not tested
B
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

View all related MCP servers

Related MCP Connectors

  • MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.

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

  • 2,000+ MCP servers read at source level. Know what one does before you connect. Free, no key.

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/xiaoxuPekingUniversity/dsh-read-pdf'

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