Repository avatar
AI Tools
v0.1.1
active

ondevicepdf-mcp

io.github.RaviChanduEdru/ondevicepdf-mcp

19 PDF tools (merge, split, compress, protect, unlock, repair) that run locally. No uploads.

Documentation

OnDevicePDF MCP server

PDF tools for AI agents that run on your own computer. Ask Claude, Cursor or any MCP client to merge, split, compress, password-protect, unlock, repair or clean up a PDF, and the work happens locally. Your files are never uploaded.

Many PDF services offer MCP servers or chat-app plugins that send your file to their servers to process it. This one has no server to send it to. It runs the same PDF engines as ondevicepdf.com, where every tool works inside your browser.

Tools

ToolWhat it does
pdf_infoPage count, password or restriction status, and stored metadata
extract_textThe text of each page (scanned pages come back empty and are flagged)
merge_pdfsCombine PDFs in the order given
split_pdfOne file per page group ("1-3; 4-6") or per page
extract_pagesCopy chosen pages into a new PDF
delete_pagesRemove pages
rotate_pagesRotate all or some pages by 90, 180 or 270 degrees
reorder_pagesPut pages in a new order
reverse_pagesReverse the page order
interleave_pagesMerge a fronts scan and a backs scan into reading order
compress_pdflossless, balanced or strong; text stays sharp and selectable
protect_pdfAES-256 password, plus print, copy and edit permissions
unlock_pdfRemove a password or restrictions from a file you can open
remove_metadataStrip author, title, XMP, comment authors, attachments and scripts
repair_pdfFix files that fail to open (broken xref, header or end of file)
grayscale_pdfGray or pure black and white, without turning pages into pictures
crop_pdfTrim margins in mm, cm, inches, points or percent
resize_pagesFit pages onto A4, Letter, Legal and other sizes
flatten_pdfBake form fields and annotations into the page

Every tool writes a new file next to the input (for example report-merged.pdf) unless you give an output path. It never overwrites an existing file unless you pass overwrite: true, so an agent cannot quietly replace your original.

Set up

You need Node.js 22.13 or newer.

Claude Code, as a plugin (Claude Code 2.1.275 or later), inside a session:

/plugin install ondevicepdf --marketplace RaviChanduEdru/ondevicepdf-mcp

or as a plain MCP server, from your shell:

claude mcp add ondevicepdf -- npx -y ondevicepdf-mcp

Claude Desktop, Cursor, Windsurf and other clients (add to the client's MCP config file):

{
  "mcpServers": {
    "ondevicepdf": {
      "command": "npx",
      "args": ["-y", "ondevicepdf-mcp"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "ondevicepdf": {
      "command": "npx",
      "args": ["-y", "ondevicepdf-mcp"]
    }
  }
}

Then ask in plain words, for example: "Merge every PDF in my Downloads/invoices folder into one file, then compress it."

How "never uploaded" is checked

npm test runs every tool in a process where all of Node's network APIs (sockets, TLS, HTTP, DNS, UDP, fetch, WebSocket) throw, and fails if anything even tries to use them. A negative control proves the block catches a real fetch. The only network use is the one-time npx download of the package itself.

The server speaks MCP over stdio, so it has no port and accepts no outside connections. It reads and writes only the paths the agent passes to it, with your user account's permissions.

Use it as a library

import { mergePdfs, compress } from 'ondevicepdf-mcp';

await mergePdfs({ inputs: ['a.pdf', 'b.pdf'], output: 'both.pdf' });
await compress({ input: 'both.pdf', level: 'balanced' });

Limits

  • Scanned pages have no text layer, so extract_text returns them empty. OCR is on the website, not in this package yet.
  • merge_pdfs does not carry over bookmarks or form fields.
  • Cropping hides content outside the box; it does not delete it. Use a redaction tool to remove content for good.
  • Re-drawing pages as images (the website's last-resort compression) needs a canvas, so it is not offered here.

Licence

MIT. Third-party components and their licences are listed in NOTICE.md.

NPM
ondevicepdf-mcp
Install Command
npm install ondevicepdf-mcp