# PaperPilot

> One pure-Rust PDF engine behind a CLI, an MCP server, a REST API, a desktop app and a browser build, with files kept on your machine

- Category: AI Productivity & Writing / Office Documents & Spreadsheets
- Language: Rust
- Licence: Apache-2.0
- Repository: https://github.com/KrushnaVardhanReddy/PaperPilot
- Website: https://usepaperpilot.com
- Canonical page: https://ai-tldr.dev/tools/paperpilot/
- Updated: 2026-10-26

## In short

PaperPilot is an open-source PDF and document toolkit written in Rust. It sits in the Office Documents & Spreadsheets category of the AI Productivity & Writing tools and is open-source, written in Rust and licensed Apache-2.0. To get started: build from source.

## Overview

PaperPilot is an open-source PDF and document toolkit written in Rust. A single engine powers five surfaces: an MCP server for AI agents, a command-line tool for batch jobs, a WebAssembly build that runs in the browser tab, a Tauri and Svelte desktop app with a viewer, markup and diff, and a local REST API on port 7823. The project's promise is that files stay on your machine — the browser version processes documents in the tab without uploading them.

The toolset covers the everyday PDF jobs people usually hand to an online converter: merging, splitting, rotating, reordering and extracting pages, booklet and N-up layouts, lossy compression with stream deduplication, watermarks, signature validation, a PII scan and deep sanitising. For AI pipelines it extracts structured text and Markdown tables, runs OCR with PaddleOCR on the pure-Rust `rten` runtime, and exposes Tika-style endpoints so tools such as Open WebUI can use it as a document extraction server.

The MCP server is the agent-facing part: it runs as a local stdio server and can print ready-made client configuration for Codex, Claude Code, Kimi Code, Pi, Claude Desktop and Cursor, so an assistant can act on a request like "merge these two PDFs and compress the result" without sending the files to a cloud service. The repository is the Apache-2.0 Community Edition; an Enterprise Edition with SSO, RBAC, audit logs and DLP is developed separately under a commercial licence.

## What it does

- One Rust engine shared by the MCP server, CLI, browser WASM build, Tauri desktop app and local REST API
- Page organisation and layout: merge, split, rotate, delete, reorder, extract, booklet imposition, N-up grids and poster tiling
- Compression with lossy image settings, stream deduplication and CMYK safety guards
- Structured text and Markdown-table extraction plus pure-Rust OCR (PaddleOCR on `rten`)
- Tika-compatible endpoints (`/tika/text`, `/tika/json/md`, `/rmeta/text`) for Open WebUI and other RAG ingestion
- Security tools: watermarking, signature validation and removal, PII scanning and deep sanitising
- `paperpilot-mcp --client-config` prints setup for Codex, Claude Code, Kimi Code, Pi, Claude Desktop and Cursor

## Getting started

Pre-built `paperpilot-mcp` binaries are on the GitHub Releases page, and the browser version runs at usepaperpilot.com with no install. To build everything from source you need Rust 1.75+ (plus Node.js and pnpm for the desktop app).

1. Build from source

   Clone the repository and build the CLI, the MCP server and the REST gateway in release mode.

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

2. Connect it to your agent

   The MCP server prints the configuration for a named client. Other supported values are claude-code, kimi-code, pi, claude-desktop and cursor.

```bash
paperpilot-mcp --client-config codex
```

3. Use the CLI

   Merge, compress and rotate files from the command line or a script.

```bash
paperpilot merge --inputs doc1.pdf doc2.pdf --output merged.pdf
paperpilot compress --input in.pdf --quality 75 --output compressed.pdf
paperpilot rotate --input in.pdf --pages 1,3-5 --angle 90 --output out.pdf
```

4. Run the local REST API

   `serve` starts the API on localhost; Swagger docs are at http://localhost:7823/swagger-ui.

```bash
paperpilot serve --port 7823
curl -X PUT http://localhost:7823/tika/text \
  -H "Content-Type: application/pdf" \
  --data-binary @sample.pdf
```

5. Try the desktop app

   The Tauri and Svelte app adds a viewer, markup and diff on top of the same engine.

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

## When to use it

- Let Claude Code, Codex or Cursor merge, compress or OCR PDFs through MCP without uploading confidential documents
- Replace online PDF converters with a browser tool that never sends the file to a server
- Feed scanned or text PDFs into a RAG pipeline through the Tika-compatible extraction endpoints
- Script bulk page operations and compression in CI or n8n through the CLI or the local REST API

## Version history

- 2026-10-26 v0.6.1: Adds MCP setup for Codex, Claude Code, Kimi Code and Pi, automatic page rotation, PDF attachments, dark-mode colour inversion, a scanned-book spine splitter and an embedded libSQL store.
