跳轉到

MCP Pro 工具

以下 8 個工具需要 nextpdf/pro 商業授權。設定 NEXTPDF_LICENSE_KEY 環境變數即可解鎖。


compare_pdfs

語意層級比對兩份 PDF 文件的差異。

風險等級low(唯讀操作)

JSON Schema

{
  "name": "compare_pdfs",
  "description": "Semantically compare two PDF documents and report differences.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "pdf_a_path": { "type": "string", "description": "Path to the original PDF." },
      "pdf_b_path": { "type": "string", "description": "Path to the revised PDF." },
      "mode": {
        "type": "string",
        "enum": ["text", "semantic", "visual"],
        "default": "text",
        "description": "text: raw text diff; semantic: meaning-aware diff; visual: pixel-level diff."
      },
      "pages": { "type": "string", "description": "Page range to compare. Defaults to all." },
      "ignore_whitespace": { "type": "boolean", "default": false },
      "ignore_formatting": { "type": "boolean", "default": false }
    },
    "required": ["pdf_a_path", "pdf_b_path"]
  }
}

範例回應

{
  "success": true,
  "data": {
    "summary": {
      "pages_changed": 3,
      "text_additions": 15,
      "text_deletions": 8,
      "text_modifications": 4,
      "image_changes": 2,
      "structural_changes": 1
    },
    "changes": [
      {
        "type": "text_modification",
        "page": 2,
        "reading_order": 5,
        "before": "季度淨利為 NT$12.3 億",
        "after": "季度淨利為 NT$15.7 億",
        "position": { "x": 56.69, "y": 600.0, "width": 280.0, "height": 14.0 }
      },
      {
        "type": "text_addition",
        "page": 3,
        "text": "補充說明:此差異源於匯率調整。",
        "position": { "x": 56.69, "y": 450.0 }
      }
    ]
  }
}

extract_tables

從 PDF 頁面提取表格,支援 JSON / CSV / Markdown 輸出格式。

風險等級low(唯讀操作)

JSON Schema

{
  "name": "extract_tables",
  "description": "Extract tables from PDF pages in structured formats.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": { "type": "string" },
      "pages": { "type": "string" },
      "output_format": {
        "type": "string",
        "enum": ["json", "csv", "markdown"],
        "default": "json"
      },
      "detect_headers": { "type": "boolean", "default": true },
      "merge_spanning_cells": { "type": "boolean", "default": true }
    },
    "required": ["path"]
  }
}

範例回應(output_format: "json"

{
  "success": true,
  "data": {
    "table_count": 3,
    "tables": [
      {
        "table_id": 1,
        "page": 5,
        "position": { "x": 56.69, "y": 400.0, "width": 481.89, "height": 200.0 },
        "has_header": true,
        "rows": 8,
        "columns": 4,
        "headers": ["季度", "營收(億)", "成本(億)", "淨利(億)"],
        "data": [
          ["Q1 2025", "45.2", "32.1", "13.1"],
          ["Q2 2025", "52.8", "35.6", "17.2"]
        ]
      }
    ]
  }
}

extract_forms

讀取 PDF AcroForm 表單的所有欄位定義與現有值。

風險等級low(唯讀操作)

JSON Schema

{
  "name": "extract_forms",
  "description": "Read all AcroForm field definitions and their current values from a PDF.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": { "type": "string" },
      "include_empty": { "type": "boolean", "default": true },
      "flatten": {
        "type": "boolean",
        "default": false,
        "description": "Flatten nested field hierarchy into dotted-path keys."
      }
    },
    "required": ["path"]
  }
}

範例回應

{
  "success": true,
  "data": {
    "has_forms": true,
    "field_count": 8,
    "fields": [
      {
        "name": "applicant.full_name",
        "type": "text",
        "label": "申請人姓名",
        "value": "王小明",
        "required": true,
        "max_length": 100,
        "page": 1
      },
      {
        "name": "gender",
        "type": "radio",
        "label": "性別",
        "value": "male",
        "options": ["male", "female", "other"],
        "page": 1
      }
    ]
  }
}

fill_form

填寫 PDF AcroForm 表單欄位並輸出已填寫的 PDF。

風險等級medium(修改文件)

JSON Schema

{
  "name": "fill_form",
  "description": "Fill AcroForm fields in a PDF and save the result.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "input_path": { "type": "string" },
      "output_path": { "type": "string" },
      "fields": {
        "type": "object",
        "description": "Key-value pairs of field names and their values.",
        "additionalProperties": {
          "oneOf": [
            { "type": "string" },
            { "type": "boolean" },
            { "type": "number" }
          ]
        }
      },
      "flatten": {
        "type": "boolean",
        "default": false,
        "description": "Flatten form fields into static content (no longer editable)."
      }
    },
    "required": ["input_path", "output_path", "fields"]
  }
}

範例請求

{
  "tool": "fill_form",
  "arguments": {
    "input_path": "/workspace/application-form.pdf",
    "output_path": "/workspace/application-filled.pdf",
    "fields": {
      "applicant.full_name": "王小明",
      "gender": "male",
      "date_of_birth": "1990-05-15",
      "agree_terms": true
    }
  }
}

sign_pdf

對 PDF 文件執行 PAdES B-B 數位簽章。

風險等級high(不可逆操作,具法律效力)

JSON Schema

{
  "name": "sign_pdf",
  "description": "Apply a PAdES B-B digital signature to a PDF document.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "input_path": { "type": "string" },
      "output_path": { "type": "string" },
      "certificate_path": {
        "type": "string",
        "description": "Path to PKCS#12 (.p12/.pfx) certificate file."
      },
      "certificate_password": {
        "type": "string",
        "description": "Password for the PKCS#12 file."
      },
      "signature_info": {
        "type": "object",
        "properties": {
          "reason": { "type": "string", "description": "Reason for signing (e.g., 'Approved')." },
          "location": { "type": "string", "description": "Physical location of signing." },
          "contact_info": { "type": "string" }
        }
      },
      "visible_signature": {
        "type": "object",
        "description": "Optional visible signature appearance.",
        "properties": {
          "page": { "type": "integer", "minimum": 1 },
          "x": { "type": "number" }, "y": { "type": "number" },
          "width": { "type": "number" }, "height": { "type": "number" },
          "text": { "type": "string" }
        }
      },
      "timestamp_url": {
        "type": "string",
        "description": "RFC 3161 timestamp server URL for PAdES B-T."
      }
    },
    "required": ["input_path", "output_path", "certificate_path", "certificate_password"]
  }
}

HITL 強制要求:此工具為 high 風險等級,且具法律效力。AI 助理必須在執行前明確告知使用者操作的法律含義,並取得明確確認。


validate_signatures

驗證 PDF 中現有數位簽章的有效性。

風險等級low(唯讀操作)

JSON Schema

{
  "name": "validate_signatures",
  "description": "Validate digital signatures in a PDF document.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": { "type": "string" },
      "check_revocation": {
        "type": "boolean",
        "default": true,
        "description": "Check certificate revocation status via OCSP/CRL."
      },
      "trusted_ca_path": {
        "type": "string",
        "description": "Path to trusted CA bundle. Defaults to system trust store."
      }
    },
    "required": ["path"]
  }
}

範例回應

{
  "success": true,
  "data": {
    "signature_count": 2,
    "all_valid": true,
    "signatures": [
      {
        "signer": "王小明 (ACME Corp)",
        "certificate_subject": "CN=王小明, O=ACME Corp, C=TW",
        "signed_at": "2026-01-15T10:30:00Z",
        "is_valid": true,
        "covers_entire_document": true,
        "level": "pades-b-b",
        "revocation_status": "good"
      }
    ]
  }
}

convert_to_pdfa

將 PDF 轉換為 PDF/A 長期存檔格式。

風險等級medium(修改文件結構)

JSON Schema

{
  "name": "convert_to_pdfa",
  "description": "Convert a PDF document to PDF/A archival format.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "input_path": { "type": "string" },
      "output_path": { "type": "string" },
      "conformance": {
        "type": "string",
        "enum": ["PDF/A-1b", "PDF/A-2b", "PDF/A-3b", "PDF/A-4"],
        "default": "PDF/A-4"
      },
      "embed_fonts": { "type": "boolean", "default": true },
      "convert_colors": { "type": "boolean", "default": true }
    },
    "required": ["input_path", "output_path"]
  }
}

redact_pdf

永久移除 PDF 中的敏感文字(不可逆操作)。

風險等級high(不可逆,永久刪除內容)

JSON Schema

{
  "name": "redact_pdf",
  "description": "Permanently remove sensitive text from a PDF (irreversible).",
  "inputSchema": {
    "type": "object",
    "properties": {
      "input_path": { "type": "string" },
      "output_path": { "type": "string" },
      "redactions": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": ["text_match", "regex", "coordinates", "auto_detect"],
              "description": "Redaction targeting method."
            },
            "pattern": { "type": "string", "description": "Text or regex pattern to redact." },
            "pages": { "type": "string" },
            "fill_color": { "type": "string", "default": "#000000" }
          }
        }
      },
      "auto_detect": {
        "type": "object",
        "properties": {
          "pii": { "type": "boolean", "default": false, "description": "Auto-detect PII (names, IDs, emails)." },
          "credit_cards": { "type": "boolean", "default": false },
          "phone_numbers": { "type": "boolean", "default": false }
        }
      }
    },
    "required": ["input_path", "output_path"]
  }
}

HITL 強制要求:此工具為 high 風險等級,且操作不可逆。AI 助理必須在執行前展示將被塗黑的區域預覽,並取得使用者的明確確認。


參見

Commercial License

This feature requires a commercial license. Contact our team for pricing and deployment support.

Contact Sales