# OnDevicePDF

> OnDevicePDF is an open-source MCP server for document processing. Local PDF tools for AI agents: merge, split, compress and repair without uploads. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, VS Code, macOS, Windows, Linux, Self-hosted
- **Website:** https://www.ondevicepdf.com/mcp
- **Repository:** https://github.com/ravichanduedru/ondevicepdf-mcp
- **GitHub stars:** 0
- **License:** MIT
- **MCP Registry name:** io.github.RaviChanduEdru/ondevicepdf-mcp
- **Categories:** [document processing](https://ai-powered.com/categories/document-processing)
- **Listing updated:** 2026-12-05

## About

Once connected, an AI assistant can run PDF jobs on your own machine instead of sending documents to a remote service. The server runs as a local program that talks to the client over standard input and output, opens no network port, and only touches the paths the agent names. It is built on the same engine that powers the companion website's in-browser tools.

The toolset covers 19 operations, including merging, splitting, page reordering, compression at three levels, password protection, unlocking, metadata removal, repairing damaged files, grayscale conversion, cropping, page resizing and flattening form fields. Every operation writes a new file next to the input and does not overwrite anything unless explicitly told to.

It suits people who hand contracts, payslips or statements to an assistant and want the processing kept off third-party servers. Limits to know: scanned pages return no text without OCR, merging drops bookmarks and form fields, and cropping hides content rather than deleting it.

## Features

- **Local processing only:** Files are handled on your computer and the server exposes no network port.
- **19 PDF operations:** Covers merge, split, reorder, compress, protect, unlock, repair, crop and more.
- **Non-destructive output:** Each tool writes a new file and will not overwrite an existing one unless asked.
- **Three compression levels:** Choose lossless, balanced or strong compression while keeping text selectable.
- **Works across MCP clients:** Setup snippets are provided for Claude Code, Claude Desktop, Cursor, Windsurf and VS Code.
- **Open-source MIT package:** Available on npm and usable as a library as well as an MCP server.

## Good for

- Merging a folder of invoices into one file and compressing it
- Splitting a long scanned statement into page ranges
- Removing a password from a file you already have access to
- Repairing a PDF that will not open
- Stripping author and metadata before sharing a document
- Flattening form fields so a filled form cannot be edited

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add ondevicepdf-mcp -- npx -y ondevicepdf-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

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

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "ondevicepdf-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "ondevicepdf-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add ondevicepdf-mcp -- npx -y ondevicepdf-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.ondevicepdf-mcp]
command = "npx"
args = ["-y", "ondevicepdf-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

Or run: gemini mcp add -s user ondevicepdf-mcp npx -- -y ondevicepdf-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

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

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

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

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

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

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "ondevicepdf-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ondevicepdf-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

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

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

From the tool list in its README, going by the names, 2 of 19 tools delete data and 1 changes data; 16 names don't say. From the server's own tool labels and tool names; not verified by us.

- `pdf_info`: Page count, password or restriction status, and stored metadata
- `extract_text`: The text of each page, with scanned pages flagged
- `merge_pdfs` (name suggests: changes): Combine PDFs in the order given
- `split_pdf`: One file per page group, or one per page
- `extract_pages`: Copy chosen pages into a new PDF
- `delete_pages` (name suggests: deletes): Remove pages
- `rotate_pages`: Rotate all or some pages
- `reorder_pages`: Put pages in a new order
- `reverse_pages`: Reverse the page order
- `interleave_pages`: Merge a fronts scan and a backs scan into reading order
- `compress_pdf`: Lossless, balanced or strong compression
- `protect_pdf`: AES-256 password with print, copy and edit permissions
- `unlock_pdf`: Remove a password or restrictions from a file you can open
- `remove_metadata` (name suggests: deletes): Strip author, title, XMP, comment authors and attachments
- `repair_pdf`: Fix files that fail to open
- `grayscale_pdf`: Convert to gray or black and white
- `crop_pdf`: Trim margins in mm, inches, points or percent
- `resize_pages`: Fit pages onto A4, Letter, Legal and other sizes
- `flatten_pdf`: Bake form fields and annotations into the page

## FAQ

### Are my files uploaded anywhere?

No. The server runs locally over stdio, opens no network port, and the only network use is the one-time npm download of the package.

### Does text extraction work on scanned PDFs?

No. Scanned pages have no text layer, so extract_text returns them empty and flags them. OCR is not part of the package.

### Does merging keep bookmarks or form fields?

No, merge_pdfs does not carry over bookmarks or form fields.

### What do I need to run OnDevicePDF?

Node.js 22.13 or newer, plus an MCP-compatible client.

### Is OnDevicePDF free?

Yes. OnDevicePDF is open source, so you can use and self-host it for free.

### How do I add OnDevicePDF to Claude Code?

Run this command in your terminal: claude mcp add ondevicepdf-mcp -- npx -y ondevicepdf-mcp

### What are the best alternatives to OnDevicePDF?

The closest alternatives to OnDevicePDF are DicePDF, Utilitly PDF, Pdf Tools, Pdf Toolkit MCP and Tooldash MCP.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [DicePDF](https://ai-powered.com/mcp/dicepdf): DicePDF is an open-source MCP server for files and documents.
- [Utilitly PDF](https://ai-powered.com/mcp/utilitly-pdf): Utilitly PDF is an MCP server for files and documents.
- [Pdf Tools](https://ai-powered.com/mcp/pdf-tools): Pdf Tools is a free MCP server for files and documents.
- [Pdf Toolkit MCP](https://ai-powered.com/mcp/pdf-toolkit-mcp-2): Pdf Toolkit MCP is an open-source MCP server for files and documents.
- [Tooldash MCP](https://ai-powered.com/mcp/tooldash-mcp): Tooldash MCP is an open-source MCP server for files and documents.

---
Source: https://ai-powered.com/mcp/ondevicepdf
