@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 19
validate_metadata [DEPRECATED — will be removed in the next major version] For standards conformance, prefer pdf-verify-mcp's \
validate_tagged [DEPRECATED — will be removed in the next major version] 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. The comparison needs both files, so an unreadable file is an error — but the error names which of the two could not be read, and says that the other one was fine. Examples: - Compare two versions of the same document - Verify structural consistency across PDF exports - Identify differences in PDF generation pipelines
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
extract_tables Extract every \
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)
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
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
extract_structured_text Extract a tagged PDF's text in logical content order, with each piece labelled by its structure type. This answers "what is the text of the H1?" — which read_text (flat, coordinate order), inspect_tags (structure, no text) and extract_tables (text, tables only) each cannot. Args: - file_path (string): Absolute path to a local PDF file - pages (string, optional): Page range ("1-5", "3", "1,3,5-7"). Omit for all pages. An element that touches the range is returned whole, even if it continues outside it. - roles (string[], optional): Structure types to include, e.g. ["H1","H2"] for an outline - include_bbox (boolean): Also report where each element is drawn (default: false) - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: isTagged, the document language, and a flat list of elements in logical content order. Each element has: role, depth (nesting; top level is 0), text, pages, and optionally alt / label / rows / boxes / boxNote. \
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 COS types), page tree info (page count, MediaBox samples), object statistics, and encryption status. Object statistics report three separate counts: - byType: the COS type of each indirect object (ISO 32000-2 §7.3) — one of dict, stream, array, name, string, integer, real, boolean, null, ref - byDocType: the /Type of each dictionary (Catalog, Pages, Page, Font, ObjStm, XRef, ...) - unreadable: objects the cross-reference table names but that could not be read. This is counted apart from totalObjects: 0 means "every object was read", not "nothing was checked". Examples: - Examine document catalog for structural features - Count PDF objects and streams - Check page dimensions across the document
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 \
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
read_images Extract embedded images from a PDF document as PNG or JPEG files. Each image is returned as an MCP image content block, so a vision-capable model can look at it directly. A text block lists the metadata for all of them (page, index, size in the file, size returned, colour space, encoded bytes). These are the image XObjects the page draws, not a picture of the page. A page whose content is vector drawing, or whose text is what you want to see, is not covered by this tool. Response size is bounded: at most ${(MAX_IMAGE_RESPONSE_BYTES / (1024 * 1024)).toFixed(0)} MB of encoded image data per call. Images beyond the budget are named in the text block with the reason and are not returned — nothing is dropped silently. A 200 dpi A4 scan is ~11.6 MB of pixels on its own, so pass \
read_url Fetch a PDF from a URL and extract its text content. Text is ALL this tool returns — see the scope note below. 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. **Scope (#25):** the fetched bytes are discarded after extraction; this tool deliberately does not save them. Every other tool of this server takes a \
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') \
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. \
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
render_page Rasterise pages of a PDF to PNG or JPEG images, returned as MCP image content blocks. This is the tool for documents whose text cannot be read as text: pages \
Permissions 4
network medium filesystem low shell high env_vars low