pdf-modifier-mcp
The pdf-modifier-mcp server provides tools to inspect, modify, and batch‑process PDF documents with font‑style preservation.
Analyze PDF structure – Extract page dimensions, text elements, coordinates, fonts, and colors.
Inspect font properties – Search for text and retrieve its exact font name, size, and styling to plan replacements.
Modify text content – Find & replace literal or regex text while preserving font (family, size, color), create or neutralize hyperlinks, and target specific page ranges. Supports encrypted PDFs via optional password.
List hyperlinks – Extract all clickable URIs with their locations and associated text.
Extract embedded fonts – Retrieve metadata and binary buffers for custom fonts (TrueType, OpenType).
Batch‑modify PDFs – Apply the same set of replacements to multiple files simultaneously, isolating failures so one error doesn't halt the entire batch.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pdf-modifier-mcp redact credit card numbers from invoice.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
PDF Modifier
CLI + MCP server + Web UI for PDF text replacement with font style preservation.
Quick start
pip install pdf-modifier
# CLI
pdf-mod modify input.pdf output.pdf -r "Draft=Final"
# MCP server (for Claude/Cursor/Codex)
claude mcp add -s user pdf-modifier -- uvx pdf-modifierRelated MCP server: 1pdf
Interfaces
Interface | Description | Run |
CLI |
|
|
MCP Server |
|
|
Web UI | FastAPI + SvelteKit — drag & drop, preview, replace |
|
Features
Text replacement — find and replace with font style preservation (family, weight, size, color)
Regex support — pattern-based bulk replacements (
--regex)Hyperlinks — create clickable links or neutralize existing ones
Batch processing — apply same replacements to multiple files
Web UI — drag & drop PDF upload, structure browser, page preview with zoom, text highlighting
MCP tools —
read_pdf_structure,inspect_pdf_fonts,list_pdf_hyperlinks,modify_pdf_content
Development
# Setup
make setup
# Run tests
make test
# Full check (lint + type + test)
make check
# Start dev stack (Docker)
make up
# API: http://localhost:8000 | Web: http://localhost:8080
# Start servers locally
make run api # FastAPI dev server
make run frontend # SvelteKit dev serverDocumentation
License
MIT
Available Tools
6 toolsbatch_modify_pdf_contentA
Apply the same text replacements to multiple PDF files at once.
Each file is processed independently -- a failure in one file does
not stop the rest of the batch. Output files are written to
output_dir using the same filename as the input.
Inputs: input_paths (required), output_dir (required), replacements (required), use_regex, +2 more. Returns: result
extract_embedded_fontsA
Extract metadata and buffers of all embedded fonts in a PDF.
Use this tool to inspect which fonts are actually embedded in a document. Custom fonts (TrueType, OpenType) appear as Type0 with their binary buffer. Base 14 system fonts (Helvetica, Times, Courier) are NOT embedded and will not appear in the results.
Inputs: input_path (required), password, max_file_size. Returns: result
inspect_pdf_fontsA
Search for specific text terms and report their font properties.
Use this tool to understand the exact font styling of text you want to replace. This ensures replacements will match the surrounding document style as closely as possible.
The tool searches through all pages and returns matches with:
Page number where the term was found
The search term that matched
Surrounding context (first 100 characters)
Font name (e.g., "Helvetica-Bold", "Times-Roman")
Font size in points
Origin coordinates for precise positioning
Inputs: input_path (required), terms (required), password, max_file_size. Returns: result
list_pdf_hyperlinksA
Extract all existing hyperlinks and clickable URIs from a PDF.
Use this tool to inventory the links in a document before or after making modifications. It reports the target URI, its location (bbox), and the text covered by the link if detectable.
Inputs: input_path (required), password, max_file_size. Returns: result
modify_pdf_contentA
Find and replace text in a PDF while preserving font styles.
This tool performs text replacement by:
Locating all occurrences of the search text
Redacting the original text (white fill)
Inserting the replacement text with matched styling
IMPORTANT BEHAVIORS:
Text is matched within individual text spans
Font style is approximated using Base 14 fonts (Helvetica, Times, Courier)
Replacement text should be similar length to avoid overlap
Multiple replacements can be specified in a single call
HYPERLINK SUPPORT:
Append "|URL" to create a clickable link: "Click Here|https://example.com"
Use "|void(0)" to neutralize existing links: "Product|void(0)"
REGEX SUPPORT:
Set use_regex=true to treat keys as regex patterns
Useful for matching dates, IDs, or variable content
Example: {"Order #\d+": "Order #REDACTED"}
PAGE RANGE:
Use pages="1-3" to process only pages 1 through 3 (1-indexed, inclusive)
Use pages="5" to process only page 5
Omit to process all pages
Inputs: input_path (required), output_path (required), replacements (required), use_regex, +3 more. Returns: result
read_pdf_structureA
Extract the complete structural content of a PDF document.
Returns detailed information about each page including:
Page dimensions (width, height)
All text elements with their:
Exact text content
Bounding box coordinates (x0, y0, x1, y1)
Origin point for text insertion
Font name and size
Color value
Use this tool FIRST to understand the document layout before making any modifications. The output helps identify exact text to target for replacements.
Inputs: input_path (required), password, max_file_size. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools have clearly distinct purposes: reading structure, modifying content, listing hyperlinks, and batch processing are unambiguous. However, read_pdf_structure and inspect_pdf_fonts both report font name, size, and coordinates, so an agent could be uncertain which to use when investigating text styling.
All tools follow a consistent verb_noun snake_case pattern (extract_, read_, inspect_, modify_, list_, batch_modify_). The batch_ prefix clearly signals the multi-file variant of modify_pdf_content, making the naming predictable and scannable.
Six tools is a well-scoped set for a PDF modification server. Each tool covers a distinct aspect of the domain—inspection, single-file modification, batch modification, font analysis, and hyperlink inventory—without bloat or redundancy.
The core workflow is covered: read structure, inspect fonts, modify text, list hyperlinks, and batch process. Minor gaps exist such as no page-level operations (reorder, delete, rotate) or image extraction, but these fall outside the server's evident text-and-link modification focus.
Maintenance
Related MCP Connectors
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
AI document editing: edits the exact section, leaves the rest. 38 MCP tools; agent self-signup.
MCP-native collaborative markdown editor with real-time AI document editing
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to perform 13 PDF operations (merge, split, compress, watermark, encrypt, and more) on local files via MCP.3-
- AlicenseCqualityDmaintenanceEnables AI assistants to perform PDF operations like merge, split, compress, convert, encrypt, OCR, and summarize using natural language.9815 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to extract structured data from PDFs with confidence scores and provenance, and to search, review, and correct documents via MCP tools, resources, and prompts.-
- AlicenseNot gradedqualityCmaintenanceIt enables AI agents and MCP clients to read, fill, create, export, and reconstruct fillable PDF forms, plus extract, search, and edit text and layout blocks, entirely against local files over stdio.Apache 2.0