pdf-writer-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| PDF_WRITER_FONT | No | Absolute path to a single-face TTF/OTF font (e.g. NotoSansJP-Regular.otf). Allows all tools to render CJK text without specifying fontPath. | |
| SOURCE_DATE_EPOCH | No | UNIX seconds used to pin CreationDate, ModificationDate and XMP timestamps for deterministic, byte-identical output. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| create_text_pdfA | Create a PDF from plain text. Honours line breaks (\n) and treats blank lines as paragraph breaks. Long lines wrap automatically. |
| create_markdown_pdfA | Create a PDF from Markdown. Supports headings, paragraphs, bullet/numbered lists, code blocks, quotes, horizontal rules and tables. Inline decoration markers are stripped and the text rendered plain (single font). |
| create_table_pdfA | Create a ruled table PDF from headers and row data. Column widths are computed from the content, cells wrap, and the header row is redrawn after page breaks. |
| set_metadataA | Update an existing PDF's metadata (the Info dictionary). Only the given fields change; the rest are preserved. At least one of title / author / subject / keywords / creator is required. In documents with XMP (/Metadata), dc:title etc. are synchronized to prevent divergence. For signed PDFs, preserveSignatures: true updates while keeping the signatures intact. |
| merge_pdfsA | Merge multiple PDFs into one, in the given order. Document metadata is carried over from the first file. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed. |
| split_pdfA | Split a PDF into multiple files by page range. Each element of ranges becomes one file, named "1.pdf", "2.pdf", and so on. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed. |
| extract_pagesA | Create a new PDF containing only the given pages. The given order is preserved, so extraction doubles as reordering. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed. |
| delete_pagesA | Create a new PDF with the given pages removed. Deleting every page is an error. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed. |
| reorder_pagesA | Reorder pages. order must list every page exactly once, in the new order. Pages are copied into a new document, so document-level information (tagged structure, XMP, attachments, AcroForm, bookmarks, etc.) is not carried over. Anything lost is reported in warnings; follow up on the output with attach_file / ensure_tagged / add_bookmarks / set_metadata as needed. |
| add_bookmarksA | Set the bookmarks (outline) of a PDF. Existing bookmarks are replaced. Nest with children. For signed PDFs, preserveSignatures: true sets them while keeping the signatures intact. |
| add_annotationA | Add one annotation to a page: sticky note (text), highlight, or rectangle (square). Coordinates are in PDF space (origin bottom-left, pt). For signed PDFs, preserveSignatures: true appends an incremental update without invalidating existing signatures (in tagged documents the enclosure in an Annot structure element rides the same update, preserving PDF/UA conformance). |
| stamp_page_numbersA | Stamp a page number on each page. In tagged PDFs the stamp is wrapped as an Artifact, preserving PDF/UA conformance. Formats containing CJK text need fontPath or the PDF_WRITER_FONT environment variable. |
| add_watermarkA | Overlay a diagonal watermark across the middle of each page ("社外秘" / "DRAFT" / "COPY", etc.). Drawn faintly behind the content by default. In tagged PDFs it is wrapped as an Artifact, preserving PDF/UA conformance. CJK watermarks need fontPath or the PDF_WRITER_FONT environment variable. |
| fill_formA | Fill field values into an existing PDF's interactive form (AcroForm). If you do not know the field names, pass a nonexistent one — the error lists every field name and type. CJK values need fontPath or the PDF_WRITER_FONT environment variable. flatten: true makes the form non-interactive after filling, but on a tagged PDF that breaks PDF/UA conformance and additionally requires allowBreakingTags: true. XFA forms are not supported. |
| flatten_formA | Flatten an existing PDF's interactive form (AcroForm), keeping the filled appearance while removing interactivity. Use it to freeze values before distribution. If existing values contain CJK text, set fontPath or PDF_WRITER_FONT in case appearances must be regenerated. On tagged PDFs, Widget annotations disappear and Form structure elements are left dangling, so it refuses by default (allowBreakingTags: true to force). |
| tag_form_fieldsA | Repair a tagged PDF's form to PDF/UA-1: enclose Widget annotations in Form structure elements (7.18.4-1), set /Tabs S on the affected pages (7.18.3-1), and give fields alternate names /TU (7.18.1-3). Pass human-readable names for screen readers via labels. Widgets already bound to the structure tree are skipped, so it is safe to run repeatedly. Untagged documents are out of scope (rebuild with the create tools' tagged: true, or run ensure_tagged first). For signed PDFs, preserveSignatures: true repairs while keeping the signatures intact (approval signatures only; certification signatures are refused). |
| ensure_taggedA | Put an existing PDF onto the PDF/UA-1 "vessel". If it is already tagged, the structure tree is untouched and only missing document-level requirements are supplied (MarkInfo / Lang / DisplayDocTitle / XMP pdfuaid:part and dc:title). For untagged documents, a minimal structure tree (each page = one P element) is created so the content becomes reachable by assistive technology. IMPORTANT: machines cannot infer meaning — headings, tables, lists, reading order and figure alt text are NOT created. The new tree is a scaffold, not an accessible document; it needs human review. If you can build the structure right from the start, use the create tools' tagged: true. For signed PDFs, preserveSignatures: true (approval signatures only; certification signatures are refused). |
| ensure_pdfaA | Put an existing PDF onto the PDF/A "vessel" (the PDF/A counterpart of ensure_tagged). Choose the flavour: "pdfa-3b" (default) / "pdfa-4" / "pdfa-4f". Supplies only the missing document-level requirements: the trailer /ID (ISO 32000-1 14.4), an sRGB OutputIntent (GTS_PDFA1; an ICC profile is generated and embedded), and XMP pdfaid. The -4 flavours additionally set the header to PDF 2.0 and delete the Info dictionary (-4 forbids Info unless the catalog has /PieceInfo — stricter than ISO 32000-2 14.3.3). Content, structure tree and fonts are never touched. Documents with attachments must use "pdfa-4f" — plain "pdfa-4" requires every attachment to be PDF/A itself, so bundling CSV or JSON (the Japanese e-bookkeeping-law pattern) would not conform. IMPORTANT: this is preparation for claiming PDF/A, not a guarantee of conformance. Violations such as unembedded fonts, encryption, JavaScript or LZW are not repaired. Writing pdfaid into XMP is the document claiming "I am PDF/A" — applied to a non-conforming document it produces a PDF that lies about itself (which is why a warning is always returned). Always confirm with pdf-verify-mcp's validate_conformance (flavour: the same value) — the verdict is veraPDF's, and since ISO 19005 clauses cannot be quoted, the strongest statement is "veraPDF judged it so". In the e-bookkeeping-law context, apply it after attaching machine-readable data with attach_file. For signed PDFs, preserveSignatures: true (approval signatures only; certification signatures are refused). However, the -4 flavours combined with preserveSignatures are refused unless the input is already PDF 2.0 (an incremental update cannot rewrite the file header, and rewriting it would break the signatures). |
| attach_fileA | Embed (attach) a file into a PDF. Registers it under /Names /EmbeddedFiles and the catalog /AF, with an AFRelationship. For PDF/A-3 (ISO 19005-3) and Japanese e-bookkeeping-law (電子帳簿保存法) workflows that bundle "a human-readable invoice PDF + machine-readable data (CSV/XML)" into one file. |
| rotate_pagesB | Rotate pages clockwise (90/180/270 degrees). All pages when pages is omitted. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 20 tools
Each tool has a clearly distinct purpose: creation tools differ by input format, page manipulation tools (split, extract, delete, reorder) are well-separated, and annotation tools (bookmarks, annotations, watermark, page numbers) are unambiguous. Even tightly related operations like fill_form vs flatten_form are clearly delineated.
All 20 tool names follow a consistent verb_noun snake_case pattern (e.g., create_text_pdf, rotate_pages, set_metadata, ensure_pdfa). No camelCase or unpredictable verb forms appear, making the API highly predictable.
At 20 tools, this exceeds the typical 3-15 sweet spot and edges into 'borderline heavy', but each tool fills a distinct need within the broad PDF manipulation domain. The count is justified by the wide feature set (creation, page ops, forms, accessibility, archiving), so it earns its place despite being slightly over the ideal range.
The tool surface covers creation, page manipulation, metadata, bookmarks, annotations, forms, tagging, PDF/A, and attachments, which is comprehensive for a PDF writer. Minor gaps exist (e.g., image insertion, digital signing, or text extraction), but these are generally outside the stated purpose and do not cause dead ends in typical workflows.