PaperPilot – 零云、纯 Rust PDF 引擎,支持 WASM 与 MCP
PaperPilot – Zero-Cloud, Pure-Rust PDF Engine with WASM and MCP

原始链接: https://github.com/KrushnaVardhanReddy/PaperPilot

PaperPilot 是一个纯 Rust、本地优先的 PDF 和文档工具包,支持多端使用:MCP 服务器(用于 Claude/Cursor)、CLI、浏览器(WASM)、桌面应用(Tauri)以及本地 REST API。文件从不离开您的机器——无 Chromium、C++ 运行时或云调用。 当前 v0.6 功能包括整理(合并、拆分、旋转、删除/重新排序/提取页面、册子、N-up)、压缩、文本提取和 OCR(通过 rten 的 PaddleOCR)、安全(水印、签名验证/移除、PII 扫描、深度清理)以及 Excel 转 JSON/CSV 转换。 即将发布的版本将添加格式转换(Markdown/HTML/JSON、Word/Excel/PowerPoint)、加密/签名/脱敏、表单、注释、渲染、修复、PDF/A 以及 Bates 编号。 所有端共享一个 Rust 核心以确保一致的行为,基于 lopdf、pdf_oxide 和 rten 构建。社区版采用 Apache 2.0 许可;企业版(SSO、RBAC、审计日志、DLP)单独提供。MCP 支持是一等公民,使其可被代理使用。

PaperPilot 是一个本地优先、基于 Rust 的 PDF 工具集,提供 CLI、桌面端、浏览器 WASM、REST 和 MCP 接口,支持合并/拆分/签名/脱敏/提取以及离线 RAG。其 Hacker News 发布因隐私和浏览器可用性受到关注,但也有批评认为它重复了现有 Rust PDF 库,且可能大量由 AI 生成。作者辩称其专注于处理畸形的真实世界 PDF,而非文档合成,从而区别于 printpdf。一名评论者的安全审查指出严重问题:未认证的本地 API 暴露文件、XSS 风险、未验证的模型/包下载、SSRF 绕过以及薄弱的 CI 实践,结论是它尚未达到生产就绪。讨论还涉及 LLM 驱动的重复实现、PDF 边缘情况、许可问题,以及 Bento PDF 和 Typst 等替代方案。
相关文章

原文

PDF tools for your AI agent — and for you. Pure Rust. Runs locally. Files never leave your machine.

PaperPilot demo

Try it in your browser → · Download · Roadmap

PaperPilot is a PDF and document toolkit written in Rust. The same engine runs as:

Surface Use it for
MCP server Give Claude Desktop, Cursor, or any MCP client the ability to merge, split, OCR, and compress PDFs
CLI Batch and scripted workflows
Browser (WASM) Zero-install tools; files are processed in browser memory, nothing is uploaded
Desktop app Tauri + Svelte GUI with viewer, markup, and diff
Local REST API Call it from Python, Node, or n8n at localhost:7823

No Chromium, no C++ runtime, no cloud calls.


1. Use it with Claude / Cursor (MCP)

Download paperpilot-mcp from Releases, then add it to claude_desktop_config.json:

{
  "mcpServers": {
    "paperpilot": {
      "command": "/path/to/paperpilot-mcp"
    }
  }
}

Restart Claude and try: "Merge these two PDFs and compress the result."

# Merge
paperpilot merge --inputs doc1.pdf doc2.pdf --output merged.pdf

# Compress
paperpilot compress --input in.pdf --quality 75 --output compressed.pdf

# Rotate pages 1, 3–5 by 90°
paperpilot rotate --input in.pdf --pages 1,3-5 --angle 90 --output out.pdf

Go to usepaperpilot.com. Open your browser's Network tab while you work — you'll see no file uploads.

git clone https://github.com/KrushnaVardhanReddy/PaperPilot.git
cd PaperPilot
cargo build --release -p paperpilot-cli -p paperpilot-mcp -p paperpilot-gateway

Desktop app:

cd apps/desktop && pnpm install && pnpm tauri dev

Requires Rust 1.75+, Node.js, and pnpm.


What it can do today (v0.6)

Organize: merge, split, rotate, delete pages, reorder pages, extract pages, booklet imposition, N-up grid Optimize: compress Extract: plain text, OCR (pure-Rust PaddleOCR via rten) Security: watermark, validate signatures, remove signatures, PII scan, deep sanitize Office data: Excel → JSON, Excel → CSV

Coming next (see ROADMAP.md):

  • v0.7: PDF ↔ Markdown / HTML / JSON
  • v0.8: PDF → Word / Excel / PowerPoint
  • v0.9: encrypt, decrypt, sign, redact, forms, annotations
  • v1.0: render, flatten, repair, compare, PDF/A, Bates numbering

  • Private by default. Everything runs locally or in your browser tab.
  • Agent-ready. MCP support is first-class, not an afterthought.
  • One engine, many surfaces. CLI, MCP, REST, WASM, and desktop share the same Rust core, so behavior is consistent.
  • Small and dependency-light. Pure Rust, built on lopdf, pdf_oxide, rten, and friends.

Run cargo bench --workspace to reproduce. Methodology and results: SYSTEM_BENCHMARK_REPORT.md.


Desktop (Tauri) · CLI · REST (Axum) · MCP (stdio) · WASM (browser / edge)
                              │
                       Rust core workspace
   paperpilot-core · paperpilot-pdf · paperpilot-nlp · paperpilot-gateway
   paperpilot-mcp · paperpilot-wasm · paperpilot-storage
<script src="https://cdn.usepaperpilot.com/embed.js" data-tools="merge,compress,ocr"></script>
<div id="paperpilot-widget"></div>
paperpilot serve --port 7823
curl -X POST http://localhost:7823/api/v1/pdf/merge \
  -H "Content-Type: application/json" \
  -d '{"inputs": ["a.pdf", "b.pdf"], "output": "out.pdf"}'

Swagger docs at http://localhost:7823/docs.


Issues and PRs are welcome. Good first contributions: bug reports with a sample PDF, new tool requests, and docs fixes.

Community Edition (this repo): Apache 2.0. It includes the CLI, MCP server, REST gateway, WASM engine, and desktop app.

An Enterprise Edition (SSO, RBAC, audit logs, DLP) is developed separately.

联系我们 contact @ memedata.com