@shuji-bonji/pdf-reader-mcp
MCP server for PDF structure analysis - read, inspect, and validate PDF internals
Versions
0.11.1latest0.11.00.10.00.9.20.9.1+ show 14 moreshow less
0.9.00.8.00.7.00.6.30.6.20.6.10.6.00.5.00.4.00.3.00.2.30.2.20.2.10.2.0Tools 18
validate_tagged [DEPRECATED — will be removed in the next major version] Prefer pdf-verify-mcp's \
validate_metadata [DEPRECATED — will be removed in the next major version] For standards conformance, prefer pdf-verify-mcp's \
compare_structure Compare the internal structures of two PDF documents and identify differences. Args: - file_path_1 (string): Absolute path to the first PDF file - file_path_2 (string): Absolute path to the second PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Structural comparison including: property-by-property diff (page count, PDF version, encryption, tagged status, object counts, page dimensions, file size, catalog entries, signatures), font comparison (fonts unique to each file and shared fonts), and a summary. Examples: - Compare two versions of the same document - Verify structural consistency across PDF exports - Identify differences in PDF generation pipelines
locate_objects Report where the given objects sit on the page. Bridges "which object" to "which coordinates": pdf-verify-mcp's verify_integrity names the objects an incremental update changed, and pdf-writer-mcp's add_annotation wants a page number and a rectangle. The rectangle is returned in PDF user space (origin bottom-left, pt, x1 < x2 and y1 < y2 — ISO 32000-1 §7.9.5 normalised form), which is exactly what add_annotation takes. Args: - file_path (string): Absolute path to a local PDF file - object_numbers (number[]): Object numbers to locate, e.g. [25, 27] - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Per object: whether it exists, its /Type and /Subtype, and the places it occupies, each with the basis the coordinates rest on: - annotation-rect — the object's own /Rect. Exact. - page-box — the object is a page; the rectangle is its crop/media box. - page-content-stream — the object draws the page; the rectangle is the WHOLE page, not the part that changed. - page-resource — a font, image or colour space used by the page. No rectangle exists for it. Limits (observations, not judgements): - Narrowing a content stream to the paragraph that moved needs a content-stream walk with graphics state; this tool does not do it and says so rather than inventing a rectangle. - An object that does not exist (freed by a later revision) is returned with found: false — not as "no coordinates". - In an encrypted document, coordinates and types are still reliable (numbers and names are not encrypted, ISO 32000-1 §7.6.2) but field names are reported as null instead of mojibake. Examples: - Turn verify_integrity's "obj 27 was added after signing" into a page and rectangle - Find which page a changed form field widget is on before annotating it
inspect_fonts List all fonts used in a PDF document with their properties. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Font name, type (TrueType, Type1, CIDFont, etc.), encoding, embedded/subset status, and pages where each font is used. Examples: - Check if all fonts are embedded (required for PDF/A, PDF/X) - Identify font types and encodings - Find which pages use specific fonts
inspect_tags Analyze the Tagged PDF structure tree for accessibility assessment. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Whether the PDF is tagged, the structure tree hierarchy with roles, max nesting depth, total element count, and role distribution (e.g., Document, P, H1, Table, Figure). Examples: - Check if a PDF is tagged for accessibility (PDF/UA) - Inspect the tag hierarchy and role distribution - Assess document structure quality
inspect_signatures Examine digital signature fields in a PDF document. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Total signature field count, signed/unsigned breakdown, and details for each field (signer name, reason, location, signing time, filter/subFilter). Note: This tool inspects signature field structure only. Cryptographic signature verification is not performed. Examples: - Check if a PDF has been digitally signed - Inspect signer information and signing dates - Verify signature field structure
inspect_annotations Extract and categorize all annotations in a PDF document. Args: - file_path (string): Absolute path to a local PDF file - pages (string, optional): Page range. Format: "1-5", "3", or "1,3,5-7". Omit for all pages. - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Total annotation count, breakdown by subtype (Link, Widget, Highlight, Text, etc.) and by page, flags for links/forms/markup presence, and individual annotation details. Examples: - Check for form fields (Widget annotations) - Find all links in a document - Inventory markup annotations (highlights, comments)
extract_tables Extract every \
inspect_structure Examine PDF internal object structure including catalog entries, page tree, and object statistics. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Catalog entries (keys and types), page tree info (page count, MediaBox samples), object statistics (total count, stream count, type distribution), and encryption status. Examples: - Examine document catalog for structural features - Count PDF objects and streams - Check page dimensions across the document
extract_structured_text get_metadata Extract metadata from a PDF document including title, author, creation date, page count, PDF version, and structural information. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Metadata including: title, author, subject, keywords, creator, producer, creation/modification dates, page count, PDF version, linearized/encrypted/tagged/signature flags, file size. Examples: - Get document properties for cataloging - Check if a PDF is tagged (accessibility) - Verify PDF version compatibility
get_page_count Get the total number of pages in a PDF document. This is a lightweight operation that only reads the PDF header, not the full content. Args: - file_path (string): Absolute path to a local PDF file Returns: Page count as a number. Examples: - Quick check before deciding which pages to extract - Validate a PDF file is readable
read_text Extract text content from a PDF document with Y-coordinate-based reading order preservation. Text is extracted page by page, sorted by vertical position (top to bottom) then horizontal position (left to right), providing natural reading order. \
read_url Fetch a PDF from a URL and extract its text content. Downloads the PDF from the specified URL, then extracts text with Y-coordinate-based reading order. Supports HTTP and HTTPS. Maximum file size: 50MB. Timeout: 30 seconds. Like \
summarize Generate a quick overview report of a PDF document. Combines metadata, text presence check, image count, and a text preview from the first page into a single summary. Useful as a first step before deciding which detailed tools to use. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Summary including: page count, PDF version, file size, tagged/encrypted/signature flags, text presence, image count, and a text preview from page 1. Examples: - Quick overview: { file_path: "/path/to/doc.pdf" } - Machine-readable: { file_path: "/path/to/doc.pdf", response_format: "json" }
read_images Extract images from a PDF document as base64-encoded data. Extracts embedded images from specified or all pages. Returns image metadata (dimensions, color space) along with raw pixel data in base64. Args: - file_path (string): Absolute path to a local PDF file - pages (string, optional): Page range. Format: "1-5", "3", or "1,3,5-7". Omit for all pages. Returns: Array of extracted images with: page number, index, width, height, color space (RGB/RGBA/Grayscale), bits per component, and base64-encoded data. Note: Large images may produce very large responses. Use the pages parameter to limit scope. Examples: - Extract all images: { file_path: "/path/to/doc.pdf" } - Extract from page 1: { file_path: "/path/to/doc.pdf", pages: "1" }
search_text Search for text within a PDF document. Returns matching locations with surrounding context. Case-insensitive search across all or specified pages. Each match includes the page number, the matched text, and configurable surrounding context. The search runs over the same text \
Permissions 3
network medium shell high env_vars low