Skip to main content
Glama
pdfedit-mcp

pdfedit-mcp

PDF Editor

A free, offline, license-clean PDF toolkit for people and AI agents.

CI License: MIT Contributions welcome

  • Offline. Your PDFs never leave your machine. No accounts, uploads or telemetry.

  • License-clean. Only MIT, BSD, Apache-2.0 and MPL-2.0 dependencies. CI blocks GPL and AGPL, so you can use it anywhere, including commercially.

  • Fast. Uses native engines: Google's PDFium for rendering and qpdf for structure.

  • Safe. Never modifies your original. Every output is checked: it opens, renders, has the right page count, and kept its text.

  • Built for AI agents. A built-in MCP server lets Claude Code (and any MCP client) edit PDFs for you.

Install

git clone https://github.com/krishnakantnagina/pdf-editor.git
cd pdf-editor
python -m venv .venv
# Windows: .venv\Scripts\activate    macOS/Linux: source .venv/bin/activate
pip install -e ".[mcp]"

Requires Python 3.11+. Tested on Windows, macOS and Linux.

Related MCP server: pdfeverything

Command line

Command

Example

info

pdfedit info file.pdf (a folder works too)

merge

pdfedit merge a.pdf b.pdf -o combined.pdf (or a folder)

split

pdfedit split file.pdf --every 10 · --ranges "1-3,4-" · --max-mb 5

extract

pdfedit extract file.pdf "1-3,7"

delete

pdfedit delete file.pdf "2,5-7"

reorder

pdfedit reorder file.pdf "3,1,2,4-" · reverse

rotate

pdfedit rotate file.pdf 90 --pages even

$ pdfedit merge report.pdf appendix.pdf -o full.pdf
Merged 2 files -> full.pdf
[OK] full.pdf: 8 pages, 6115 text chars

Page specs: 3, 1-3, 5- (to the end), -3 (start to page 3), last, odd, even, reverse, all, or combinations separated by commas. Encrypted PDFs: add -p PASSWORD. Output: saved as <name>_<operation>.pdf by default (never overwrites a file), or choose a path with -o.

Use it from Claude Code (MCP)

claude mcp add pdf-editor -- /full/path/to/.venv/bin/pdfedit-mcp
# Windows: claude mcp add pdf-editor -- C:\path\to\.venv\Scripts\pdfedit-mcp.exe

Then just ask:

"Merge every PDF in ~/Downloads/invoices into one file, then delete the blank last page." "Split thesis.pdf into chapters at pages 1-12, 13-40, 41-."

MCP tool

What it does

pdf_info

Pages, sizes, fonts, images, metadata, encryption

pdf_verify

Check a PDF opens, renders and has the expected pages

pdf_merge

Merge files in order

pdf_split

Split by ranges, every N pages, or max size

pdf_extract_pages

Copy selected pages to a new file

pdf_delete_pages

Copy without selected pages

pdf_reorder_pages

New page order

pdf_rotate_pages

Rotate selected pages

Security: the MCP server can only touch files inside allowed folders. The default is your home folder and the folder it was started in. To restrict it further, set PDFEDIT_ALLOWED_DIRS (separated by ; on Windows, : elsewhere):

claude mcp add pdf-editor -e PDFEDIT_ALLOWED_DIRS=/home/me/pdfs -- pdfedit-mcp

It works with any MCP client (Claude Desktop, Cursor and others): run pdfedit-mcp over stdio.

Roadmap

✅ Phase 1a: info, merge, split, extract, delete, reorder, rotate, output checks, MCP server ⬜ Phase 1b: watermark, page numbers, headers and footers, PDF↔images, text extraction, compression, passwords ⬜ Phase 2: remove watermarks and ads, true redaction, English OCR ⬜ Phase 3: local web UI (drag-and-drop pages, previews) ⬜ Phase 4: add text and images, annotations, forms ⬜ Phase 5: Office/HTML → PDF, batch recipes ⬜ Phase 6: compare PDFs, N-up, watch folders

The full plan, with about 70 features, is in PLAN.md.

Contributing

Contributions are very welcome. Pick a good first issue and read CONTRIBUTING.md. Every new feature goes into both the CLI and the MCP server.

pip install -e ".[dev]"
pytest -q
python scripts/check_licenses.py

License

MIT. All runtime dependencies are permissively licensed (checked in CI).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to perform 13 PDF operations (merge, split, compress, watermark, encrypt, and more) on local files via MCP.
      3
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to inspect PDFs, merge or extract pages, and clean text entirely offline through the Model Context Protocol, with no uploads, API keys, or network calls.
      4
      64 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients to read local PDFs as markdown, plain text, tables, or positioned blocks; inspect metadata; search documents; list and fill form fields into new files; and identify pages needing vision, while keeping documents on-machine and limiting access to allowed directories.
      9
      158 PyPI
      MIT