MCP MD2PDF Server is an MCP server that enables automated conversion of Markdown documents into formatted PDF files with full support for Mermaid diagrams. It connects directly to an underlying containerized engine powered by Pandoc, TeX Live, and headless Chrome via mermaid-filter, allowing AI agents and external tools to transform text and flowcharts into professional documents. Developers, technical writers, and automation engineers use it to streamline the generation of reports, software specifications, and developer documentation straight from Markdown notes. The server exposes tools to compile inline Markdown strings or existing disk files, configure document paper sizes, generate tables of contents, and adjust code syntax highlighting styles. Output can be received as structured base64 payloads or saved directly to a target file path on the host system.
Category: Design, Media & Creative
Tags: conversion, document processing, markdown, mermaid, pdf
bash git clone https://github.com/valyc0/mcp-md2pdf cd mcp-md2pdf ./install.sh Alternatively, install dependencies manually by running pip3 install -r requirements.txt and building the Docker image using docker build -t pandoc-mermaid .. 2. Configure your MCP client (such as Claude Desktop) by adding the server configuration to your configuration file: json { "mcpServers": { "md2pdf": { "command": "python3", "args": ["/path/to/mcp_md2pdf_server.py"], "cwd": "/path/to/mcp-md2pdf/" } } } 3. Restart your MCP client to load the tools.Part of MCP Servers
You can install it by running the automated installation script ./install.sh inside the cloned repository, which sets up the Python dependencies, verifies Docker, and builds the pandoc-mermaid image. You can also manually install the requirements using pip3 and build the Docker container using docker build -t pandoc-mermaid .
It provides tools to convert raw Markdown strings or local Markdown files into PDF documents. It handles complex Mermaid diagrams such as flowcharts and Gantt charts, applies syntax highlighting via customizable styles, configures paper formats like A4 or Letter, and includes optional tables of contents.
Any MCP client that supports communication over standard input and output (stdio) can use this server. This includes applications like Claude Desktop, Cursor, or custom script integrations that configure command-line execution of Python MCP servers.
Yes, Docker is required to run the conversion environment. The system executes Pandoc, TeX Live, and headless Chrome via a containerized setup to ensure consistent PDF rendering and proper generation of Mermaid diagram graphics.