
Pdf Toolkit Mcp
io.github.EigenCharlie由 GitHub 账号 EigenCharlie 发布v0.1.2更新于 Oct 24, 2026
Unofficial PDF toolkit (merge/split/compress/OCR/convert/watermark/protect/...) via iLoveAPI.
概览
一个本地 MCP 服务器,通过 iLoveAPI 为助手提供 18 种 PDF 操作:合并、拆分、转换、压缩、OCR、水印、加密和修复。
- 可以做什么
- 整理 PDF:合并多个文件、按页码范围或固定块拆分、提取指定页面。从 PDF 转换为 Word、Excel、PowerPoint 或 JPG,以及把 Office 文档、HTML 或图片转换为 PDF。编辑页面:旋转、添加页码、加盖文字或图片水印。通过添加或移除已知密码来加密或解锁文件。修复损坏的 PDF,并运行 OCR 让扫描件可搜索。
- 适用场景
- 适合让助手在本机串联多步骤 PDF 任务,例如汇总发票、发送前压缩并加密文档,或把扫描版 PDF 转成可编辑的 Word 文件。
- 运行要求
- 通过 npx 以 stdio 在本地运行,需要 Node.js 18 或更高版本。需要 iLoveAPI 账户及项目公钥和密钥,通过环境变量 ILOVEAPI_PROJECT_PUBLIC_KEY 和 ILOVEAPI_PROJECT_SECRET_KEY 提供。每次操作都需要联网,因为处理在 iLoveAPI 服务器上完成。
安装
在 SourceWeft 中
- 打开 控制台中的 Pdf Toolkit Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
pdf-toolkit-mcp
18 PDF operations for Claude Code, Claude Desktop, and any MCP client — via iLoveAPI.
[npm version] [npm downloads] [License: MIT] [Node.js] [TypeScript] [MCP] [Claude Code] [CI]
Disclaimer.
pdf-toolkit-mcpis an independent, community-built open-source client. It is not affiliated with, endorsed, sponsored, or certified by iLovePDF SL. The project talks to the public iLoveAPI REST service using your project credentials — nothing is proxied, resold, or relicensed. "iLovePDF" and "iLoveAPI" are trademarks of iLovePDF SL; this project does not claim ownership of those marks.
📖 Table of contents
- Why pdf-toolkit-mcp
- Quick tour
- Install
- Tool catalog
- Workflow recipes
- Architecture
- Configuration reference
- Security model
- Development
- Testing & CI
- Releasing
- Roadmap
- FAQ
- Contributing
- License & trademarks
- Credits
🎯 Why pdf-toolkit-mcp
Free for personal use. iLoveAPI's free tier grants ~2,500 credits / month; this MCP itself is MIT-licensed and costs nothing.
🚀 Quick tour
After installation, just talk to Claude. The model figures out which tools to call:
📦 Install
Prerequisites
- Node.js ≥ 18 (LTS recommended).
- iLoveAPI project keys — free tier at developer.ilovepdf.com. Takes ~2 minutes:
- Sign up → create a project → copy
Project public keyandProject secret key. - Export them (or drop them into your client's MCP config — examples below).
- Sign up → create a project → copy
Option A — Claude Code (CLI one-liner)
Restart Claude Code and all 18 tools appear in the picker. Verify with /mcp → you should see pdf-toolkit: connected (18 tools).
Option B — Claude Code Plugin (includes the pdf-workflow skill)
The plugin auto-configures the MCP server and installs a skill that teaches Claude five canonical multi-step PDF pipelines (see Workflow recipes).
Option C — Claude Desktop (claude_desktop_config.json)
Click to expand
Edit claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS):
Restart Claude Desktop — the 🔌 icon should show pdf-toolkit connected.
Option D — any MCP client via stdio
The server speaks the standard MCP JSON-RPC 2.0 framing over stdio. Wire it into Cursor, Windsurf, mcphub, mcp-inspector, or anything else that speaks MCP.
Option E — Claude Desktop .mcpb bundle (drag-and-drop)
Grab pdf-toolkit-mcp-<version>.mcpb from the latest GitHub Release and drag it into Claude Desktop → Settings → Extensions. Claude will prompt for your iLoveAPI keys via the user_config section of the bundled manifest. No npx, no Node, no terminal.
Bundles ship unsigned (no publisher certificate yet). macOS Gatekeeper / Windows SmartScreen may warn on first install; verify the SHA-256 in the release notes before accepting.
Option F — MCP Registry (auto-discovered by compatible clients)
The server is indexed on the official MCP Registry under io.github.EigenCharlie/pdf-toolkit-mcp. Clients that browse the registry (Claude Desktop extension pane, VS Code MCP picker, mcphub, etc.) can install it without any manual config — they'll point at the npm package and prompt for the two iLoveAPI env vars automatically.
🧰 Tool catalog
All 18 tools are exposed with strict Zod schemas, additionalProperties: false, and return both a text summary and a file:// resource URI so the client can surface the output.
📚 Organize
🔄 Convert — from PDF
🔄 Convert — to PDF
✏️ Edit
🔐 Security
🩹 Repair / OCR
All tools accept absolute or CWD-relative paths for
input_file(s)and an optionaloutput_path(file or directory). Defaults place the result next to the first input with a timestamped name.
🍳 Workflow recipes
The bundled pdf-workflow skill (skills/pdf-workflow/SKILL.md) teaches Claude five canonical multi-step pipelines. You can also run these manually — just describe the end state and Claude chains the tools for you.
1. Assemble — merge + compress + (optional) protect
2. Convert & secure — Office doc to locked PDF
3. Extract & OCR — pull pages out of a scan and make them editable
4. Prep for email — shrink + lock
5. Scan cleanup — repair + OCR + number
🏛 Architecture
iLoveAPI 5-phase lifecycle (orchestrated in src/api/tasks.ts)
The server emits MCP notifications/progress at each boundary so your client can render a live progress bar for slow operations (OCR, large merges).
Project layout
⚙️ Configuration reference
Environment variables
Structured error codes
Every failure surfaces a PdfToolkitError with a stable machine-readable code:
🔒 Security model
pdf-toolkit-mcp is designed to be safe to install on a developer machine:
- Stdio only. The server never opens a network socket; it only makes outbound HTTPS calls to
api.ilovepdf.comvia the official SDK. - No
console.log. JSON-RPC over stdio would corrupt on any stray stdout write, so every log line goes throughprocess.stderr. - Secrets never persisted. Credentials live in env vars for the lifetime of the process and are never written to disk, log files, or tool responses.
- JWT generated locally. The
@ilovepdf/ilovepdf-nodejsSDK self-signs JWTs with your secret key — no secret leaves the machine. - Path sandbox (opt-in). Set
ILOVEAPI_SANDBOX_ROOTto constrain the server to a single directory tree; any path resolving outside throws before the API is ever called. - Extension whitelists per tool.
html_to_pdfrejects.exe;image_to_pdfonly accepts common raster formats, etc. - MIT licensed, audit-friendly. ~2k lines of TypeScript. No obfuscation, no minification, no postinstall scripts.
👩💻 Development
Common tasks
Debugging inside Claude Code
- Build locally:
npm run build. - Register the local dist instead of npm:
- Set
PDF_TOOLKIT_DEBUG=1in your shell before launching Claude Code for verbose stderr. - Stderr is visible with
claude mcp logs pdf-toolkit.
✅ Testing & CI
- Unit tests — 25 tests across
client,paths,errors, andtools.merge. Fully mocked, no network. Run withnpm test. - Integration smoke test —
tests/integration/smoke.test.tsspins up two minimal valid PDFs and exercises a realmerge_pdfend-to-end. Gated onILOVEAPI_*_KEYenv vars; automatically skipped in PR CI for security. - CI matrix — .github/workflows/ci.yml runs
lint → typecheck → build → teston:- OS:
ubuntu-latest,windows-latest - Node:
18,20,22
- OS:
🚢 Releasing
Publishing is automated on tag push:
The publish workflow then:
- Re-runs lint + typecheck + build + tests.
- Publishes to npm with
--access public --provenance(supply-chain attestation). - Creates a GitHub Release with auto-generated notes.
Repo secret required: NPM_TOKEN (npm automation token).
🗺 Roadmap
- v0.1 — 18 PDF tools, stdio transport, plugin + skill, CI, npm publish
- v0.1.1 — MCPB bundle (
.mcpb) for Claude Desktop, marketplace manifest, MCP Registry submission (mcpName) - v0.2 — Submit the Claude plugin to
anthropics/claude-plugins-official, publish an image-tools companion pack - v0.3 — 8 image tools (resize, convert, compress, crop, rotate, watermark, upscale, remove background)
- v0.4 — Signature tools (signing flows require paid tier — gated behind env flag)
- v1.0 — Optional Streamable-HTTP transport for hosted/multi-user setups
Have a feature request? Open an issue.
🙋 FAQ
Is this legal / safe / allowed by iLovePDF? Yes. It's a thin open-source client that uses your credentials — nothing is resold, relicensed, or proxied. The iLoveAPI Terms of Service explicitly permit open-source libraries using user-provided keys (several community SDKs have existed for years). This project does not ship any keys, does not use "iLovePDF"/"iLoveAPI" in its package name, and carries the required disclaimer.
Does it cost money? iLoveAPI offers ~2,500 credits per month free (enough for thousands of small ops). Heavier workloads need a paid iLoveAPI plan. This MCP itself is MIT and free forever.
Does it work offline? No. iLoveAPI is cloud-only, so every tool call requires internet access.
Can I pin a specific version?
Yes: claude mcp add pdf-toolkit -- npx -y [email protected].
Can I self-host?
Yes. Clone the repo, npm run build, and point your client at node ./dist/index.js. The server is entirely stateless.
What happens if iLoveAPI is down?
The tool returns a PdfToolkitError with code: "API_ERROR" and data.http_status. Claude can retry with exponential backoff on your behalf.
Can I use this without Claude? Yes — any MCP-compatible client works: Cursor, Windsurf, Zed, MCP Inspector, custom clients. The server is 100% spec-compliant.
🤝 Contributing
Contributions welcome! Small checklist before opening a PR:
npm run lint && npm run typecheck && npm test→ all green.- New tools follow the pattern in src/tools/merge.ts (Zod schema →
runTask→writeOutputAndReport). - Add at least one unit test.
- Update the Tool catalog in this README if you add/rename a tool.
Bug reports are even more welcome — include the tool name, the arguments, and (if safe to share) the stderr output.
📜 License & trademarks
Released under the MIT License © 2026 Carlos.
"iLovePDF" and "iLoveAPI" are trademarks of iLovePDF SL. This project is an independent, community-built client and is not affiliated with, endorsed by, sponsored by, or certified by iLovePDF SL. The package name intentionally avoids both marks.
🙏 Credits
- iLovePDF / iLoveAPI — the cloud PDF processing API that powers every tool call.
- Anthropic — for Claude, Claude Code, and the Model Context Protocol specification.
@modelcontextprotocol/sdk, Zod, Vitest, ESLint — the toolchain this project stands on.- Every contributor who reports issues, suggests tools, and sends pull requests. 🙌
来源:README.md,提交 4bc0da7
工具
0版本历史
1- v0.1.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分