Skip to main content
Glama

Markdown2PDF MCP Server

by LAMENTIS1

create_pdf_from_markdown

Convert Markdown content to PDF documents with support for headers, lists, tables, code blocks, images, and Mermaid diagrams. Customize paper format, orientation, borders, page numbers, and optional watermarks.

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.
paperFormatNoPaper format for the PDF (default: letter)letter
paperOrientationNoPaper orientation for the PDF (default: portrait)portrait
paperBorderNoBorder margin for the PDF (default: 2cm). Use CSS units (cm, mm, in, px)20mm
watermarkNoOptional watermark text (max 15 characters, uppercase), e.g. "DRAFT", "PRELIMINARY", "CONFIDENTIAL", "FOR REVIEW", etc
watermarkScopeNoControl watermark visibility: "all-pages" repeats on every page, "first-page" displays on the first page only (default: all-pages)all-pages
showPageNumbersNoInclude page numbers in the PDF footer (default: false)

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" }, "showPageNumbers": { "default": false, "description": "Include page numbers in the PDF footer (default: false)", "type": "boolean" }, "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" }, "watermarkScope": { "default": "all-pages", "description": "Control watermark visibility: \"all-pages\" repeats on every page, \"first-page\" displays on the first page only (default: all-pages)", "enum": [ "all-pages", "first-page" ], "type": "string" } }, "required": [ "markdown" ], "type": "object" }

Other Tools from Markdown2PDF MCP Server

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/LAMENTIS1/mcp_pdf'

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