mcp-pdf-forms

wjkwmok/mcp-pdf-forms

3.1

If you are the rightful owner of mcp-pdf-forms and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

MCP PDF Forms is a toolkit for manipulating PDF forms using MCP and PyMuPDF.

Tools
6
Resources
0
Prompts
0

MCP PDF Forms

A PDF form manipulation toolkit built with MCP and PyMuPDF.

Features

  • Find PDF files across multiple directories
  • Extract form field information from PDF files
  • Visualize form fields in PDF documents
  • Fill form fields in PDF documents
  • Save filled PDFs to new files or overwrite existing ones

Installation

# Install package from PyPI
pip install mcp_pdf_forms

# Or install from source
git clone https://github.com/Wildebeest/mcp_pdf_forms.git
cd mcp_pdf_forms
pip install -e .

Command Line Tool

After installation, you can use the mcp-pdf-forms command to start the server:

# Start the server with one or more directories to scan for PDFs
mcp-pdf-forms examples

You can also add it to Claude Code as an MCP:

claude mcp add pdf-forms mcp-pdf-forms .

Usage

Once installed, you can use the package to work with PDF forms. The package provides tools through the MCP interface.

PDF Discovery Tool

The PDF Discovery tool helps you find PDF files across specified directories.

  • Input: Directory paths to search for PDFs
  • Output: List of PDF files found in the specified directories
  • Usage: Use this to quickly locate all PDF files in your project or specified folders

Form Field Extraction Tool

The Form Field Extraction tool extracts information about all form fields in a PDF document.

  • Input: Path to a PDF file
  • Output: Detailed information about each form field including field name, type, position, and other properties
  • Usage: Use this to analyze form structure and understand the fields available for filling

Field Highlight Visualization Tool

The Field Highlight tool creates a visual representation of form fields in the PDF.

  • Input: Path to a PDF file
  • Output: Modified PDF with all form fields highlighted for easy identification
  • Usage: Use this to visually inspect the layout and position of form fields in your document

Form Field Filling Tools

The package provides three tools for filling PDF form fields:

Fill Single Form Field Tool

Fill a single form field in a PDF document.

  • Input: PDF file path, field name, and value
  • Output: Success status and field information
  • Usage: Use this to fill one field at a time
Fill Multiple Form Fields Tool

Fill multiple form fields in a PDF document at once.

  • Input: PDF file path and a dictionary mapping field names to values
  • Output: Success status and results for each field
  • Usage: Use this to fill multiple fields efficiently in one operation
Fill and Save PDF Tool

Fill form fields and save the result to a new file or overwrite the original.

  • Input: PDF file path, field values dictionary, and optional output path
  • Output: Success status, field results, and saved file information
  • Usage: Use this when you want to preserve the original PDF or save filled forms with different names

Supported Field Types

The filling tools support all standard PDF form field types:

  • Text Fields: Single-line and multi-line text input
  • Checkboxes: Boolean values (use "true", "yes", "1", "on", "checked" for checked state)
  • Radio Buttons: Select from predefined options
  • Choice Fields: Dropdown lists and list boxes

Libraries Used

  • MCP - Machine Conversation Protocol framework
  • PyMuPDF - Python bindings for MuPDF, a high-performance PDF library

License

MIT