pdf-letter-mcp
v1.0.3Renders letters as print ready PDFs, DIN 5008 compliant for German window envelopes.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
create_letter Create letter PDF
Renders a letter as a PDF file in the fixed house layout (DIN 5008 address field, 25 mm writing margin, fold and punch marks, bold subject block). Pass content only, the layout is fixed. The signature image intentionally overlaps the closing line. Returns the absolute file path, the page count, layout metrics and warnings.
| Parameter | Type | Description |
|---|---|---|
body * | string | Letter text. Blank lines separate paragraphs, "- " starts a bullet list, "1. " a numbered list, **bold** and *italic* are supported, "\pagebreak" forces a page break. |
recipient * | object | Recipient, positioned in the DIN 5008 address field so it shows in the envelope window. |
closing | string | Default is the closing phrase of the locale. |
copyTo | array | |
countryDisplay | string | When to print the country line, default "auto" (only for foreign recipients). |
date | string | ISO date (2026-07-24), "today" or free text. Default "today". |
dateStyle | string | Default "numeric" (24.07.2026). |
enclosures | array | |
locale | string | Language of the fixed texts and date format. Supported: de, en, fr, es, it, nl, pt, pl, tr, da, sv, cs. Regional tags such as "en-US" are accepted. Default "de". |
marks | array | Remark zone above the address, max. 3 lines, e.g. ["Einschreiben"]. |
metadata | object | |
outputPath | string | Target PDF path. Default: PDF_LETTER_OUTPUT_DIR (or the temp directory) plus a name derived from the subject. |
overwrite | boolean | Overwrite an existing file instead of adding a counter, default false. |
place | string | Place for the "place, date" line. |
profile | string | Sender identity, taken from the profile file on this machine (see list_profiles). The profile provides address, return address line and signature image. Use this instead of typing a sender. |
returnAddressLine | string | Return address line above the recipient. Generated from the sender, pass "" to hide it. |
returnBase64 | boolean | Also return the PDF as base64, default false. |
salutation | string | Default is the generic salutation of the locale. |
sender | object | Sender, printed as the small return address line above the recipient. Only needed when no profile is used, a profile always wins. |
signature | object | Signature below the closing line. The image is scaled and placed by the renderer: it is laid over the blank line above the printed name and deliberately overlaps the closing line, exactly like a signa… |
subject | string | Subject line, printed without a "Betreff:" label as required by DIN 5008. |
subjectLines | array | Further bold lines right below the subject. This is where a normal German letter carries references, e.g. ["Zeichen: 535 B 335D028418", "Kunden-Nummer: 335D028418"]. |
preview_letter Preview letter layout
Renders the letter in memory and returns layout metrics and warnings without writing a file. Use it to check whether the address fits the address field or the letter runs onto a second page.
| Parameter | Type | Description |
|---|---|---|
body * | string | Letter text. Blank lines separate paragraphs, "- " starts a bullet list, "1. " a numbered list, **bold** and *italic* are supported, "\pagebreak" forces a page break. |
recipient * | object | Recipient, positioned in the DIN 5008 address field so it shows in the envelope window. |
closing | string | Default is the closing phrase of the locale. |
copyTo | array | |
countryDisplay | string | When to print the country line, default "auto" (only for foreign recipients). |
date | string | ISO date (2026-07-24), "today" or free text. Default "today". |
dateStyle | string | Default "numeric" (24.07.2026). |
enclosures | array | |
locale | string | Language of the fixed texts and date format. Supported: de, en, fr, es, it, nl, pt, pl, tr, da, sv, cs. Regional tags such as "en-US" are accepted. Default "de". |
marks | array | Remark zone above the address, max. 3 lines, e.g. ["Einschreiben"]. |
metadata | object | |
place | string | Place for the "place, date" line. |
profile | string | Sender identity, taken from the profile file on this machine (see list_profiles). The profile provides address, return address line and signature image. Use this instead of typing a sender. |
returnAddressLine | string | Return address line above the recipient. Generated from the sender, pass "" to hide it. |
salutation | string | Default is the generic salutation of the locale. |
sender | object | Sender, printed as the small return address line above the recipient. Only needed when no profile is used, a profile always wins. |
signature | object | Signature below the closing line. The image is scaled and placed by the renderer: it is laid over the blank line above the printed name and deliberately overlaps the closing line, exactly like a signa… |
subject | string | Subject line, printed without a "Betreff:" label as required by DIN 5008. |
subjectLines | array | Further bold lines right below the subject. This is where a normal German letter carries references, e.g. ["Zeichen: 535 B 335D028418", "Kunden-Nummer: 335D028418"]. |
prepare_signature Prepare signature image
Cleans up a scanned signature: crops white borders, turns the paper background transparent and optionally recolours the ink. Writes a PNG that can be passed to create_letter as signature.path. Needs the optional sharp dependency.
| Parameter | Type | Description |
|---|---|---|
backgroundThreshold | number | Luminance cutoff, default 0.85. |
base64 | string | Image data as base64 or data URL, alternative to path. |
inkColor | string | Recolour the ink, e.g. "#1a1a1a". |
outputPath | string | Target PNG path. Default: output directory plus "signature.png". |
overwrite | boolean | |
path | string | Path to the scan (PNG, JPEG, and with sharp also WebP/TIFF/HEIC). |
removeBackground | boolean | Turn the white background transparent, default true. |
trim | boolean | Crop uniform borders, default true. |
list_profiles List sender profiles
Lists the sender profiles configured on this machine. Each profile carries the address and the signature of one person, so create_letter only needs the profile key.
get_din5008_spec Get DIN 5008 geometry
Returns the millimetre geometry of the layout: address field, remark zone, writing margins, subject position, fold and punch marks.
list_locales List locales
Lists the supported languages together with their fixed texts (salutation, closing, enclosures, page numbering).
| Parameter | Type | Description |
|---|---|---|
locale | string | Return the labels of a single locale. |
list_fonts List fonts
Lists the built-in font families and resolves a font name against the installed system fonts, so you can check what create_letter would embed.
| Parameter | Type | Description |
|---|---|---|
family | string | Font family or .ttf path to resolve. |