mcp-server
v1.5.0MCP server for the PDFGate API.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
generate_pdf
Generate a PDF from a URL or raw HTML. Provide either 'url' or 'html', not both.
| Parameter | Type | Description |
|---|---|---|
css | string | CSS to inject before rendering |
emulateMediaType | string | |
enableFormFields | boolean | Enable interactive PDF form fields from HTML |
footer | string | HTML string for the page footer |
header | string | HTML string for the page header |
html | string | Raw HTML string to render as PDF |
javascript | string | JavaScript to inject before rendering |
marginBottom | string | Bottom margin |
marginLeft | string | Left margin |
marginRight | string | Right margin |
marginTop | string | Top margin e.g. '10mm' |
metadata | object | Custom metadata to attach |
orientation | string | Page orientation (default: portrait) |
pageSizeType | string | Page size (default: a4) |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
printBackground | boolean | Print background graphics (default: true) |
url | string | Public URL to render as PDF |
waitForNetworkIdle | boolean | Wait for network idle before rendering |
upload_file
Upload a PDF to PDFGate so it can be referenced by other operations. Provide either 'filePath' (local path) or 'url'.
| Parameter | Type | Description |
|---|---|---|
filePath | string | Absolute local path to the PDF file to upload |
metadata | object | Custom metadata to attach |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
url | string | Publicly accessible URL of the PDF to upload |
get_document
Retrieve metadata for a stored PDFGate document by its ID.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The document ID |
preSignedUrlExpiresIn | integer | Generate a fresh pre-signed download URL expiring in this many seconds (60–86400) |
delete_document
Delete a PDFGate document.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The document ID to delete |
flatten_pdf
Flatten an interactive PDF into a static, non-editable PDF. Creates a new document; does not overwrite the original.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The source document ID to flatten |
metadata | object | Custom metadata to attach |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
extract_form_data
Extract form field values from a fillable PDF. Returns a JSON object mapping field names to their values.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The document ID of the fillable PDF |
add_form_fields
Add interactive form fields to a stored PDF — from placeholder tags (refined via fieldOverrides) and/or explicitly positioned fields.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The document ID |
fieldOverrides | object | Per-field overrides keyed by field name |
fields | array | Fields to add at explicit positions |
preSignedUrlExpiresIn | integer | Generate a fresh pre-signed download URL expiring in this many seconds (60–86400) |
compress_pdf
Compress/optimise a PDF to reduce file size without changing visual content.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The source document ID to compress |
linearize | boolean | Linearise the PDF to enable fast web view (first page renders sooner) |
metadata | object | Custom metadata to attach |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
protect_pdf
Encrypt a PDF with a password and optional permission restrictions. Produces a new document; the original is unchanged.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The source document ID to protect |
algorithm | string | Encryption algorithm (default: AES256) |
disableCopy | boolean | Prevent copying text |
disableEditing | boolean | Prevent editing |
disablePrint | boolean | Prevent printing |
encryptMetadata | boolean | Encrypt PDF metadata (default: false) |
metadata | object | Custom metadata to attach |
ownerPassword | string | Full-control owner password; required when using AES256 with a userPassword |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
userPassword | string | Password required to open the PDF |
watermark_pdf
Apply a text or image watermark to a PDF. For type='text' provide 'text'; for type='image' provide 'watermarkImagePath'.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The source document ID |
type * | string | Watermark type |
font | string | Standard PDF font name |
fontColor | string | Font colour as hex e.g. '#FF0000' |
fontFilePath | string | Local path to a .ttf/.otf font file (overrides 'font') |
fontSize | number | Font size in points |
imageHeight | number | Image watermark height |
imageWidth | number | Image watermark width |
metadata | object | Custom metadata to attach |
opacity | number | Opacity 0–1 |
preSignedUrlExpiresIn | integer | Pre-signed download URL expiry in seconds (60–86400) |
rotate | number | Rotation in degrees (0–360) |
text | string | Watermark text (required when type='text') |
watermarkImagePath | string | Local path to a .png/.jpg watermark image (required when type='image') |
xPosition | number | Horizontal position |
yPosition | number | Vertical position |
download_file
Download the raw PDF bytes of a stored document, returned as an embedded resource. For a shareable link instead, use get_document.
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The document ID |
create_envelope
Create a signing envelope from one or more existing PDFGate documents. Each recipient is given either as email and name or as the recipientId of a stored recipient. A recipient signs through the hosted flow (emailed link), embedded signing (embedded: sign inside your application via create_embed_link, no emails) or automatic signing (autoSign: the stored signature of a recipient enrolled with request_recipient_signature is applied on their behalf, no signing session). Use signingOrder to make recipients sign in sequence. Returns an envelope in 'created' status; call send_envelope to dispatch s…
| Parameter | Type | Description |
|---|---|---|
documents * | array | Documents to include in the envelope |
requesterName * | string | Name of the user or system creating the envelope |
expiresInDays | integer | Days until the envelope and its signing links expire, counted from creation. Defaults to the account's envelope expiration setting. |
metadata | object | Custom metadata to attach |
send_envelope
Send a created envelope to its recipients. PDFGate dispatches signing emails with secure, OTP-protected links that stay valid until the envelope expires. Embedded recipients receive no email; create their signing links with create_embed_link after sending. On documents with a signingOrder only the first recipients are emailed; later recipients are activated as earlier ones sign.
| Parameter | Type | Description |
|---|---|---|
envelopeId * | string | The envelope ID to send |
get_envelope
Retrieve the current state of an envelope including its status, document progress, and per-recipient signing status. Each recipient carries an embedded boolean; embedded recipients have no signing link — mint one with create_embed_link instead. Recipients on ordered documents carry signingOrder and, once it is their turn, activatedAt. Each recipient also carries autoSign (signed automatically with their stored signature) and sendSignedCopy (emailed the signed document on completion) booleans.
| Parameter | Type | Description |
|---|---|---|
envelopeId * | string | The envelope ID to retrieve |
void_envelope
Void (cancel) an envelope in 'created' or 'in_progress' status. Recipients who have not signed are notified by email and their signing links stop working; documents already signed by all recipients are not affected. The optional reason is visible to recipients. Cannot be undone.
| Parameter | Type | Description |
|---|---|---|
envelopeId * | string | The envelope ID to void |
reason | string | Reason for voiding. Included in the cancellation email sent to recipients |
delete_envelope
Permanently delete an envelope and the files it produced (signed documents and audit logs). Recipient data is anonymized and recipients lose access; source documents are not deleted. Only envelopes in 'draft', 'completed', 'expired', or 'voided' status can be deleted — void an active envelope first. Cannot be undone.
| Parameter | Type | Description |
|---|---|---|
envelopeId * | string | The envelope ID to delete |
create_embed_link
Create a short-lived signing URL for an embedded recipient, to be rendered in an iframe inside your application. The envelope must be in 'in_progress' status and the link expires after 10 minutes, so create it when the signer is ready (one link per signing session). On documents with a signingOrder the link can only be created once it is the recipient's turn; the envelope.recipient.activated webhook event signals that moment. When the session ends the iframe redirects to returnUrl with event (signing_complete, voided, expired or not_found), envelopeId, documentId and recipientId appended as qu…
| Parameter | Type | Description |
|---|---|---|
documentId * | string | The envelope document ID (sourceDocumentId) |
envelopeId * | string | The envelope ID |
recipientId * | string | The recipient ID of the embedded recipient |
returnUrl * | string | URL the signing session redirects to when it ends |
create_recipient
Store a recipient in your account so envelopes can reference them by recipientId. Emails are not unique; every call creates a new recipient, so use list_recipients first when reuse is intended.
| Parameter | Type | Description |
|---|---|---|
email * | string | Recipient email address. Stored lowercased and cannot be changed later |
metadata | object | Custom metadata to attach |
name | string | Recipient display name |
list_recipients
List stored recipients with the given email (case-insensitive), oldest first.
| Parameter | Type | Description |
|---|---|---|
email * | string | Email to look up |
get_recipient
Retrieve a stored recipient by ID. Once a stored signature was requested the response carries a signature object (status pending, active or revoked, plus requestedAt, adoptionMethod, enrolledAt, revokedAt, lastUsedAt and useCount); while the signature is active it also includes image, the signature as a PNG data URL, which can be very long.
| Parameter | Type | Description |
|---|---|---|
recipientId * | string | The recipient ID |
update_recipient
Update a stored recipient's name or metadata. The email cannot be changed. Existing envelopes are not affected; they keep the recipient name they were created with.
| Parameter | Type | Description |
|---|---|---|
recipientId * | string | The recipient ID |
metadata | object | Replacement custom metadata |
name | string | New recipient display name |
delete_recipient
Delete a stored recipient from your account directory. The record is kept with its personal data removed (email, name, phone, metadata and any stored signature), so later reads return 404 and a new envelope to the same address creates a fresh recipient; envelopes already sent keep their own copy and are not affected. Rejected with a 400 error while the recipient has an active stored signature or a pending enrolment — call remove_recipient_signature first.
| Parameter | Type | Description |
|---|---|---|
recipientId * | string | The recipient ID |
request_recipient_signature
Automatic signing: email a stored recipient a link to store a reusable signature (they verify their email with a one-time code, accept the authorization text and type, draw or upload their signature). The link is valid for 7 days and calling this again replaces a pending request with a new link. Returns the recipient with signature.status 'pending'; once they complete the enrolment the recipient.signature.enrolled webhook fires and envelopes can set autoSign on this recipient. Rejected with a 400 error when the recipient has no email or already has an active stored signature (remove it first w…
| Parameter | Type | Description |
|---|---|---|
recipientId * | string | The recipient ID |
remove_recipient_signature
Automatic signing: remove the stored signature of a recipient (signature.status becomes 'revoked' and the recipient.signature.revoked webhook fires) or cancel a pending enrolment so its link stops working. Envelopes already waiting on the automatic signature fall back to a signing link emailed to the recipient. Idempotent: a recipient without a stored signature is returned unchanged. Required before delete_recipient while a signature is active or an enrolment is pending.
| Parameter | Type | Description |
|---|---|---|
recipientId * | string | The recipient ID |
create_webhook
Create a PDFGate webhook subscription. The response includes a signing secret — store it securely to verify incoming event signatures.
| Parameter | Type | Description |
|---|---|---|
eventTypes * | array | Event types to subscribe to |
url * | string | The HTTPS endpoint that will receive webhook events |
description | string | Optional label to identify this webhook |
get_webhook
Retrieve a PDFGate webhook subscription by its ID.
| Parameter | Type | Description |
|---|---|---|
webhookId * | string | The webhook ID |
delete_webhook
Delete a PDFGate webhook subscription. Future events will no longer be delivered to the associated endpoint.
| Parameter | Type | Description |
|---|---|---|
webhookId * | string | The webhook ID to delete |