kw-md2pdf-mcp

v1.0.0
kw-md2pdf-mcp Checked 1 day ago Published 1 month ago

MCP server that converts Markdown to print-optimized A4 HTML (not a PDF: save as PDF via browser Ctrl+P).

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

markdown_to_html

Convert a Markdown string to print-optimized (A4) HTML and return the HTML text. NOTE: this does NOT produce a PDF; open the HTML in a browser and use Ctrl+P > Save as PDF. Raw HTML in the Markdown is escaped. For large documents prefer save_as_html_file to avoid returning a huge string.

ParameterTypeDescription
markdown *stringMarkdown content to convert
themestringVisual theme: 'default' (clean white), 'technical' (dark code blocks), 'elegant' (serif, wide margins). Defaults to 'default'.
titlestringHTML document title (optional, defaults to 'Document')

save_as_html_file

Convert Markdown to print-optimized (A4) HTML and save it to a file (not a PDF; print it from a browser). output_path must end with .html/.htm and lie inside the working directory or MD2PDF_ALLOWED_DIRS.

ParameterTypeDescription
markdown *stringMarkdown content to convert
output_path *stringPath to save the HTML file (must end with .html or .htm, inside an allowed directory)
themestringVisual theme (optional, defaults to 'default')
titlestringHTML document title (optional)

convert_file

Read a .md/.markdown file and convert it to a print-optimized (A4) HTML file (not a PDF; print it from a browser). Input and output must lie inside the working directory or MD2PDF_ALLOWED_DIRS. If output_path is omitted, saves next to the input with .html.

ParameterTypeDescription
input_path *stringPath to the input .md or .markdown file (inside an allowed directory)
output_pathstringPath to save the output HTML file (optional, defaults to same directory as input with .html extension)
themestringVisual theme (optional, defaults to 'default')
titlestringHTML document title (optional, defaults to the input file name)