io.github.cyanheads/docgen-mcp-server
Render HTML/markdown to PDF, export rows to xlsx, and fill AcroForm PDFs.
Versions
0.2.0latestTools 4
docgen_fill_form Fill the AcroForm fields of a supplied PDF and optionally flatten it. Provide the source PDF as exactly one of { base64 } or { url } (an https URL fetched behind an SSRF guard; base64 avoids any fetch), plus a fields map of AcroForm field name → value. Field names must match the PDF internal names exactly (case-sensitive); obtain them from whoever supplied the form, since docgen does not expose them. Names with no AcroForm counterpart come back in unmatchedFields[] rather than failing — correct them and re-render. Set flatten to bake the values in so the result is no longer editable. Returns a delivery envelope with a documentId, resource URI, pageCount, and inline base64 when small enough.
docgen_get_document Re-fetch a previously rendered document by the id a docgen render/export/fill tool returned. Returns the same delivery envelope (metadata plus resource URI, and inline base64 when small enough). Use it to recover a document whose inline copy was dropped (over the inline size limit) while it is still within its TTL. The documentId is obtainable ONLY from an earlier docgen_render_pdf, docgen_export_spreadsheet, or docgen_fill_form result — it is not guessable, and an expired or unknown id returns document_expired.
docgen_export_spreadsheet Render one or more named worksheets of row objects to a downloadable .xlsx workbook. Each sheet is a name plus an array of row objects (property → scalar), with an optional column spec controlling header label, value type, width, and number/date format. An empty rows array yields a header-only sheet; provide at least one sheet. Returns a delivery envelope with a documentId, resource URI, sheetCount, byte size, and inline base64 when small enough. The natural export stage for tabular data pulled from another server — reshape its rows into sheets[] and render.
docgen_render_pdf Render content to a downloadable PDF document. Provide exactly one source: { html } (raw HTML you compose — the recommended path), { markdown } (converted to HTML then rendered), or { template, data } (a {{key}} template filled from a data object, server-owned layout). Control page size, orientation, margins, header/footer, and page numbers via pageOptions. Returns a delivery envelope with a documentId, resource URI, pageCount, byte size, and inline base64 when small enough. The lightweight engine renders structured layout (headings, paragraphs, lists, tables) but not arbitrary CSS — a degraded flag is set when unsupported styling is dropped.
Permissions 3
network medium shell high env_vars low