PDF Verify (PDF Agent Stack)

v0.35.0
io.github.shuji-bonji/pdf-verify-mcp Checked 7 hours ago Published 26 days ago

Verify PDF signatures, detect tampering, and identify PDF/A and PAdES conformance levels.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

verify_signatures Verify PDF Digital Signatures (cryptographic)

Cryptographically verify the digital signatures in a PDF document. For each signature this tool: recomputes the ByteRange digest and compares it with the CMS messageDigest attribute, verifies the CMS/PKCS#7 signature value against the signer certificate, verifies any RFC 3161 signature timestamp, evaluates the certificate chain against trust anchors, and checks revocation status. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') - trust_anchors (string[], optional): Paths to trust anchor certificat…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
check_revocationstringRevocation checking: "none", "embedded" (OCSP/CRL data inside the PDF/CMS, default), or "online" (additionally query OCSP responders and CRL distribution points over HTTP).
passwordstringPassword for an encrypted PDF. Omit for permission-encrypted PDFs (an empty user password is tried automatically).
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data
revocation_freshnessintegerSeconds before the validation time that a CRL / OCSP response may have been issued (thisUpdate) and still support "good". Default 86400 (24 h); 0 accepts only data issued at or after the validation ti…
trust_anchorsarrayAbsolute paths to trust anchor certificates (PEM or DER). Merged with the PDF_VERIFY_TRUST_ANCHORS environment variable (a directory of *.pem/*.crt/*.cer/*.der files). When omitted and the env var is…
trusted_ocsp_respondersarrayAbsolute paths to certificates (PEM or DER) of locally trusted OCSP responders (RFC 6960 §4.2.2.2). A response signed by one of them is accepted even when the responder is not the issuing CA or its d…

verify_integrity Verify PDF Integrity (tamper detection)

Analyze a PDF for modifications after signing. Reports: number of revisions (incremental updates), whether bytes were added after each signature's signed range, whether the last signature covers the entire file, DocMDP certification permissions and violations, and DSS presence. DocMDP is assessed against what the P value actually permits (ISO 32000-2 Table 257): P=1 permits nothing, P=2 form fill-in and signing, P=3 additionally annotation creation/deletion/modification. The later changes are classified from the object-level diff (changeClass), so adding an annotation to a P=2 document is re…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data

detect_pades_level Detect PAdES Baseline Level

Observe which PAdES baseline level (ETSI EN 319 142) the structure of each signature matches. **This is an observation, not a conformance verdict.** ETSI EN 319 142 is not in this family's spec corpus, and unlike PDF/A there is no third-party validator to delegate to — so the result says "the structure matches B-LT", never "conforms to PAdES B-LT". Every report carries normativeBasis: "T3" to make that explicit. Detection is structural: B-B (CAdES signature), B-T (+ RFC 3161 signature timestamp), B-LT (+ DSS with validation data), B-LTA (+ document timestamp). Legacy adbe.pkcs7.detached si…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data

identify_conformance Identify PDF/A / PDF/UA Declarations

Identify declared PDF/A (pdfaid) and PDF/UA (pdfuaid) conformance in a PDF's XMP metadata. Args: - file_path (string): Absolute path to a local PDF file - response_format ('markdown' | 'json'): Output format (default: 'markdown') Returns: Every report begins with file_path (the path as received, so answers to side-by-side calls can be matched to their inputs; markdown shows it as "File:" under the heading), then a "scope" object - how far the reading got, not a verdict: whether the cross-reference chain could be walked to the end (chainStop), whether this tool had to rebuild the cross-…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data

validate_conformance Validate PDF/A and PDF/UA Conformance

Validate a PDF against a PDF/A flavour (ISO 19005, archiving) or a PDF/UA flavour (ISO 14289, accessibility). Hybrid engine: when veraPDF is installed (PDF_VERIFY_VERAPDF env var or on PATH) validation is delegated to it for an authoritative result. Otherwise a built-in rule subset is checked natively: - PDF/A (15 rules): encryption, file ID, LZW, font embedding, JavaScript/prohibited actions, OutputIntent, transparency for A-1, XFA, and more - PDF/UA (12 rules): MarkInfo/Marked, StructTreeRoot, pdfuaid declaration, /Lang, DisplayDocTitle, document title, Figure /Alt, image tagging, headi…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
enginestringValidation engine: "auto" (veraPDF when installed, else native subset), "verapdf" (require veraPDF), "native" (built-in rule subset).
flavourstringFlavour to validate against. PDF/A: "pdfa-1b", "pdfa-1a", "pdfa-2b", "pdfa-2u", "pdfa-3b", etc. PDF/A-4 takes no conformance level — use "pdfa-4", or "pdfa-4e" / "pdfa-4f" for the variants ("pdfa-4b…
passwordstringPassword for an encrypted PDF. Omit for permission-encrypted PDFs (an empty user password is tried automatically). Without it, a PDF/A validation of a document whose key cannot be derived returns ENCR…
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data

validate_clauses Check ISO 32000 Clause Constraints

Check a PDF against constraints mapped from ISO 32000-1/-2 clauses — the body of the PDF specification itself, not PDF/A or PDF/UA. This covers what veraPDF does not look at. veraPDF judges PDF/A and PDF/UA profiles; a document can pass those and still violate ISO 32000 (for example embedding a CFF font program under /FontFile2, which Table 124 forbids). The mapping and its evaluation live in @shuji-bonji/pdf-constraints; this tool reports which version decided the result. Same file plus same given facts always produce the same result. Bundled domains: font-embedding, document-metadata, a…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
domainsarrayConstraint domains to apply. Omit to apply all bundled domains (font-embedding, document-metadata, annotation).
givenobjectFacts that are NOT in the file but are needed to decide some clauses, e.g. { "isSubset": true }. A clause whose applicability depends on a missing fact is reported as needs_external_fact — it is nev…
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data

evaluate_policy Evaluate Trust Policy (deterministic verdict)

Produce a deterministic 4-value trust verdict (trust_and_use / use_with_caution / human_review_required / reject) for a PDF. Runs verify_signatures, verify_integrity and detect_pades_level internally (plus validate_conformance for long-term-preservation profiles) and folds the facts through a fixed rule table — the same facts and profile always yield the same verdict. The verdict is decided entirely by code; use the returned firedRules/advisories to explain the outcome, never to override it. It judges authenticity and integrity only, never the truth of the document's content. Args: - fil…

ParameterTypeDescription
file_path *stringAbsolute path to a local PDF file (e.g., "/path/to/document.pdf")
check_revocationstringRevocation checking: "none", "embedded" (default), or "online" (queries OCSP/CRL endpoints over HTTP).
passwordstringPassword for an encrypted PDF. Omit for permission-encrypted PDFs (an empty user password is tried automatically).
profilestringJudgment profile: "general" (default thresholds), "contract" (signature required, identity-focused), "financial" (long-term preservation checks), "legal", "medical" (most conservative; caution escalat…
response_formatstringOutput format: "markdown" for human-readable, "json" for structured data
revocation_freshnessintegerSeconds before the validation time that a CRL / OCSP response may have been issued (thisUpdate) and still support "good". Default 86400 (24 h); 0 accepts only data issued at or after the validation ti…
trust_anchorsarrayAbsolute paths to trust anchor certificates (PEM or DER). Merged with the PDF_VERIFY_TRUST_ANCHORS environment variable. Without anchors, valid signatures are capped at use_with_caution (identity not…
trusted_ocsp_respondersarrayAbsolute paths to certificates (PEM or DER) of locally trusted OCSP responders (RFC 6960 §4.2.2.2). A response signed by one of them is accepted even when the responder is not the issuing CA or its d…