Markdown2PDF MCP Server logo

Markdown2PDF MCP Server

by 2b3pro

An MCP server for converting Markdown documents to PDF files. It provides a simple and efficient way to generate PDFs from Markdown content with support for syntax highlighting and custom styling.

View on GitHub

Last updated: N/A

What is Markdown2PDF MCP Server?

Markdown2PDF MCP Server is a tool that converts Markdown documents into PDF files. It utilizes Chrome's rendering engine for modern PDF generation and supports syntax highlighting and custom CSS styling.

How to use Markdown2PDF MCP Server?

First, clone the repository, install dependencies using npm install, and build the project with npm run build. Start the server using npm start. Then, use the create_pdf_from_markdown tool with the MCP SDK, providing the Markdown content and desired options like output filename, paper format, orientation, border, and watermark.

Key features of Markdown2PDF MCP Server

  • Convert Markdown to PDF with a single command

  • Syntax highlighting for code blocks

  • Custom CSS styling for PDF output

  • Support for standard Markdown formatting

  • Modern PDF generation using Chrome's rendering engine

  • Excellent support for modern web features and fonts

  • Reliable resource loading and rendering

Use cases of Markdown2PDF MCP Server

  • Generating reports from Markdown documentation

  • Creating PDF versions of blog posts or articles

  • Archiving Markdown-based notes or documents

  • Automating PDF creation from Markdown content in a CI/CD pipeline

FAQ from Markdown2PDF MCP Server

Does it support LaTeX math equations?

No, LaTeX math equations are not supported.

What Markdown elements are supported?

Headers, text formatting, lists, code blocks, tables, blockquotes, links, images, and task lists are supported.

How do I configure the output directory?

You can configure the output directory in your MCP settings file by setting the M2P_OUTPUT_DIR environment variable.

What happens if the output filename already exists?

The tool automatically handles file name conflicts by appending incremental numbers (e.g., output.pdf, output-1.pdf, output-2.pdf).

Which Chrome version is used?

This package uses Chrome v131.0.6778.204 for consistent PDF generation.