markdown2pdf-mcp

create_pdf_from_markdown

Convert markdown content to PDF. Note: Cannot handle LaTeX math equations. Supports basic markdown elements like headers, lists, tables, code blocks, blockquotes, and images (both local and external URLs).

Input Schema

NameRequiredDescriptionDefault
markdownYesMarkdown content to convert to PDF
outputFilenameNoThe filename of the PDF file to be saved (e.g. "output.pdf"). The environmental variable M2P_OUTPUT_DIR sets the output path directory. If not provided, it will default to user's HOME directory.
paperBorderNoBorder margin for the PDF (default: 2cm). Use CSS units (cm, mm, in, px)20mm
paperFormatNoPaper format for the PDF (default: letter)letter
paperOrientationNoPaper orientation for the PDF (default: portrait)portrait
watermarkNoOptional watermark text (max 15 characters, uppercase), e.g. "DRAFT", "PRELIMINARY", "CONFIDENTIAL", "FOR REVIEW", etc

Input Schema (JSON Schema)

{ "properties": { "markdown": { "description": "Markdown content to convert to PDF", "type": "string" }, "outputFilename": { "description": "The filename of the PDF file to be saved (e.g. \"output.pdf\"). The environmental variable M2P_OUTPUT_DIR sets the output path directory. If not provided, it will default to user's HOME directory.", "type": "string" }, "paperBorder": { "default": "20mm", "description": "Border margin for the PDF (default: 2cm). Use CSS units (cm, mm, in, px)", "pattern": "^[0-9]+(.[0-9]+)?(cm|mm|in|px)$", "type": "string" }, "paperFormat": { "default": "letter", "description": "Paper format for the PDF (default: letter)", "enum": [ "letter", "a4", "a3", "a5", "legal", "tabloid" ], "type": "string" }, "paperOrientation": { "default": "portrait", "description": "Paper orientation for the PDF (default: portrait)", "enum": [ "portrait", "landscape" ], "type": "string" }, "watermark": { "description": "Optional watermark text (max 15 characters, uppercase), e.g. \"DRAFT\", \"PRELIMINARY\", \"CONFIDENTIAL\", \"FOR REVIEW\", etc", "maxLength": 15, "pattern": "^[A-Z0-9\\s-]+$", "type": "string" } }, "required": [ "markdown" ], "type": "object" }

You must be authenticated.

Other Tools