pdf-toolbox-mcp
v0.1.6Local-first PDF processing MCP server — OCR write-back, text extraction, page rendering, page surgery, encryption (OCRmyPDF + Poppler + qpdf)
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
tool_pdf_info Tool Pdf Info
获取 PDF 元信息:页数、是否加密、页面尺寸、标题作者等。处理任何 PDF 前先调用此工具。
| Parameter | Type | Description |
|---|---|---|
path * | string |
tool_extract_text Tool Extract Text
提取 PDF 文本(pdftotext)。pages 精确页范围如 '1-3,5';layout 保持版面;per_page 按页返回。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
layout | boolean | |
pages | ||
per_page | boolean |
tool_ocr_pdf Tool Ocr Pdf
对扫描件 OCR 并把文本层写回,产出可搜索 PDF(输出 <stem>_ocr.pdf)——本工具箱的核心差异化能力。 默认跳过已有文本层的页;默认语言 chi_sim+eng(缺语言包时自动降级并在结果中说明)。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
deskew | boolean | |
lang | ||
output | ||
overwrite | boolean | |
redo_ocr | boolean |
tool_render_pages Tool Render Pages
渲染指定页为 PNG。return_images=True 时直接返回图像内容块(供视觉查看复杂版面/图表/扫描页)。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
dpi | integer | |
out_dir | ||
overwrite | boolean | |
pages | string | |
return_images | boolean |
tool_unlock_pdf Tool Unlock Pdf
用密码解锁加密 PDF,输出解密文件。user(打开)密码即可,无需 owner 密码。解锁后再走其他工具。
| Parameter | Type | Description |
|---|---|---|
password * | string | |
path * | string | |
output | ||
overwrite | boolean |
tool_split_pdf Tool Split Pdf
拆分 PDF:ranges='1-3,5' 按区间出文件,或 every_n=N 每 N 页一段。二者二选一。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
every_n | ||
out_dir | ||
overwrite | boolean | |
ranges |
tool_merge_pdfs Tool Merge Pdfs
按传入顺序合并多个 PDF 为一个文件。
| Parameter | Type | Description |
|---|---|---|
output * | string | |
paths * | array | |
overwrite | boolean |
tool_rotate_pages Tool Rotate Pages
旋转页面 90/180/270 度。pages 缺省旋转全部页。
| Parameter | Type | Description |
|---|---|---|
angle * | integer | |
path * | string | |
output | ||
overwrite | boolean | |
pages |
tool_protect_pdf Tool Protect Pdf
AES-256 加密(对外分发)。user_password 留空 = 打开无密码、仅权限限制;权限默认可打印可复制、不可修改。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
allow_annotate | boolean | |
allow_assembly | boolean | |
allow_extract | boolean | |
allow_form | boolean | |
allow_modify | boolean | |
allow_print | boolean | |
output | ||
overwrite | boolean | |
owner_password | ||
user_password | string |
tool_is_searchable Tool Is Searchable
智能路由入口:判断 PDF 是否已有可提取文本层,返回建议动作(extract_text 或先 ocr_pdf)。不确定时先调这个。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
sample_pages | integer |
tool_list_fonts Tool List Fonts
字体体检:列出字体与嵌入状态,未嵌入字体跨设备查看/打印可能缺字。
| Parameter | Type | Description |
|---|---|---|
path * | string |
tool_extract_images Tool Extract Images
抽取 PDF 内嵌图片为 PNG;list_only=true 只返回图片清单不落盘。 overwrite=true 才允许覆盖同名图片。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
list_only | boolean | |
out_dir | ||
overwrite | boolean | |
pages |
tool_extract_attachments Tool Extract Attachments
抽取 PDF 内嵌附件文件到指定目录;overwrite=true 才允许覆盖同名文件。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
out_dir | ||
overwrite | boolean |
tool_check_repair Tool Check Repair
结构体检(语法/流编码);repair=true 尝试重建输出修复版文件。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
output | ||
overwrite | boolean | |
repair | boolean |
tool_linearize Tool Linearize
Web 优化:输出渐进加载版,适合在线浏览的发布文件。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
output | ||
overwrite | boolean |
tool_batch_ocr Tool Batch Ocr
批量 OCR 写回:inputs 为文件路径或目录(取全部 PDF)。单文件失败不中断,逐文件返回结果。
| Parameter | Type | Description |
|---|---|---|
inputs * | array | |
deskew | boolean | |
lang | ||
max_retries | integer | |
out_dir | ||
overwrite | boolean | |
per_file_timeout | ||
redo_ocr | boolean |
tool_sanitize Tool Sanitize
发布版脱敏:剥离 JS/OpenAction/元数据/附件(可选注释)。正文文本不动——防元数据与隐藏对象泄密。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
output | ||
overwrite | boolean | |
strip_annotations | boolean | |
strip_attachments | boolean | |
strip_javascript | boolean | |
strip_metadata | boolean |
tool_redact Tool Redact
真涂黑(安全级):regions=[{page,x,y,w,h}](PDF 点、左上原点)。含涂黑区域的页被光栅化—— 被涂文字物理删除,复制/提取/文本层均无法恢复;其余页保留原文本层。 rasterize_all=true 全文档光栅化(最高防护档)。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
regions * | array | |
dpi | integer | |
output | ||
overwrite | boolean | |
rasterize_all | boolean |
tool_locate_text Tool Locate Text
定位文本出现的页面与坐标框(PDF 点、左上原点)——找内容在哪、给 redact 量坐标的地基。 中文无分词、英文跨词均可命中(NFKC 归一化去空白匹配)。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
query * | string | |
max_results | integer | |
pages |
tool_redact_text Tool Redact Text
按内容真涂黑:自动定位每个关键词的全部出现处并涂黑(无需手工量坐标)。 如"把所有合同编号涂掉"。被涂页光栅化、文字物理删除;其余页保留文本层。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
queries * | array | |
dpi | integer | |
output | ||
overwrite | boolean | |
rasterize_all | boolean |
tool_fill_form Tool Fill Form
填写 AcroForm 表单(字段名→字符串/布尔)。未匹配字段在 missing 中返回。
| Parameter | Type | Description |
|---|---|---|
fields * | object | |
path * | string | |
output | ||
overwrite | boolean |
tool_edit_metadata Tool Edit Metadata
编辑元数据(docinfo+XMP 双写);clear=true 清空全部——对外发布前配合 sanitize 使用。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
author | ||
clear | boolean | |
creator | ||
keywords | ||
output | ||
overwrite | boolean | |
subject | ||
title |
tool_compress_pdf Tool Compress Pdf
压缩 PDF(ghostscript,有损:图像重采样)。target_mb 给定时沿 ebook→screen 下探直到达标(尽力而为)。
| Parameter | Type | Description |
|---|---|---|
path * | string | |
output | ||
overwrite | boolean | |
quality | string | |
target_mb |
tool_dependency_status Tool Dependency Status
探测系统依赖、安装命令与可解锁工具。 工具报 missing_dependency 时先看这里。
tool_doctor Tool Doctor
一键诊断:导入、依赖快照、README 关键路径。