Back to catalog

PDF Tools MCP Server

A comprehensive PDF toolkit that integrates with Claude AI through MCP, enabling PDF file operations such as merging, splitting, encryption, optimization, and analysis through natural language commands.

A comprehensive PDF toolkit that integrates with Claude AI through MCP, enabling PDF file operations such as merging, splitting, encryption, optimization, and analysis through natural language commands.

Installation

With Virtual Environment (recommended)

git clone https://github.com/Sohaib-2/pdf-mcp-server.git
cd pdf-mcp-server
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt

Without Virtual Environment

git clone https://github.com/Sohaib-2/pdf-mcp-server.git
cd pdf-mcp-server
pip install fastmcp requests pathlib

Installing PDF Tools - PDFtk

# Ubuntu/Debian
sudo apt-get install pdftk
# macOS
brew install pdftk-java
# Windows: Download from https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

Installing PDF Tools - QPDF

# Ubuntu/Debian
sudo apt-get install qpdf
# macOS
brew install qpdf
# Windows: Download from https://qpdf.sourceforge.io/

Configuration

Claude Desktop (Windows with Virtual Environment)

{
  "mcpServers": {
    "pdf-tools": {
      "command": "C:\\path\\to\\pdf-mcp-server\\.venv\\Scripts\\python.exe",
      "args": ["C:\\path\\to\\pdf-mcp-server\\server.py"]
    }
  }
}

Claude Desktop (Without Virtual Environment)

{
  "mcpServers": {
    "pdf-tools": {
      "command": "python",
      "args": ["C:\\path\\to\\pdf-mcp-server\\server.py"]
    }
  }
}

Claude Desktop (macOS/Linux with venv)

{
  "mcpServers": {
    "pdf-tools": {
      "command": "/path/to/pdf-mcp-server/.venv/bin/python",
      "args": ["/path/to/pdf-mcp-server/server.py"]
    }
  }
}

Available Tools

Tool Description
merge_pdfs Merge multiple PDFs into a single document
split_pdf Split PDF into individual pages
extract_pages Extract specific page ranges from a PDF
rotate_pages Rotate pages by a specified number of degrees
encrypt_pdf Apply AES-256 encryption to PDF
encrypt_pdf_basic Add basic password protection to PDF
decrypt_pdf Remove password protection from PDF
optimize_pdf Compress PDF for web/email delivery
repair_pdf Fix corrupted PDF files
check_pdf_integrity Check PDF structure and integrity
get_pdf_info Get detailed PDF metadata in JSON format
update_pdf_metadata Change PDF title, author, and other metadata
inspect_pdf_structure Analyze internal PDF structure
extract_pdf_attachments Extract embedded files from PDF
download_pdf Download PDF from URL

Features

  • AI-powered natural language commands for PDF operations through Claude integration
  • Merge, split, and extract pages from PDFs
  • AES-256 encryption and password protection
  • PDF optimization and compression
  • Repair of corrupted PDF files
  • PDF metadata extraction and analysis
  • Download PDFs from URLs
  • Flexible file path resolution with multiple search directories
  • Support for both PDFtk and QPDF backends
  • Complete PDF structure analysis and integrity verification

Environment Variables

Optional

  • PDF_WORKSPACE - Custom working directory for PDF operations (first in search order)

Usage Examples

Merge these 3 PDFs into one document
Encrypt my report with password protection
Extract pages 1-10 from this manual
Combine all my research papers into one bibliography
Split this 100-page manual into chapters

Notes

Requires separate installation of PDFtk and QPDF. Supports flexible file path resolution with default search directories including ~/Documents/PDFs, ~/Downloads, ~/Desktop, and the current working directory. Built on the FastMCP framework and provides 16 comprehensive PDF manipulation tools.

Comments (0)

Sign In Sign in to leave a comment.