Skip to main content
Glama

markdown2pdf-mcp

by 2b3pro

create_pdf_from_markdown

Convert markdown content to PDF with support for headers, lists, tables, code blocks, images, and Mermaid diagrams. Specify paper format, orientation, border, and optional watermark. Output saved to a defined filename and directory.

Instructions

Convert markdown content to PDF. Supports basic markdown elements like headers, lists, tables, code blocks, blockquotes, images (both local and external URLs), and Mermaid diagrams. Note: Cannot handle LaTeX math equations. Mermaid syntax errors will be displayed directly in the PDF output.

Input Schema

NameRequiredDescriptionDefault
markdownYesMarkdown content to convert to PDF
outputFilenameNoCreate a filename for the PDF file to be saved (default: "final-output.pdf"). The environmental variable M2P_OUTPUT_DIR sets the output path directory. If directory is 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": "Create a filename for the PDF file to be saved (default: \"final-output.pdf\"). The environmental variable M2P_OUTPUT_DIR sets the output path directory. If directory is 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" }

Other Tools from markdown2pdf-mcp

Related Tools

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/2b3pro/markdown2pdf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server