Md To PDF MCP logo

Md To PDF MCP

by MarceauSolutions

Convert Markdown files to styled PDFs with TOC, code highlighting, images, and batch support via MCP server.

Install Md To PDF MCP

Run the project’s own setup commands, in order.

Setup steps from the project

MarceauSolutions/md-to-pdf-mcp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    pip install mcp
    
  2. 2. Start the server
    python mcp-server/md_to_pdf_mcp.py
    

Overview

This server converts markdown (.md) files into professional PDF documents featuring automatic tables of contents, clickable navigation, syntax-highlighted code blocks, tables, and embedded images. It supports batch processing and customizable styling via CSS. Use it when you need to generate shareable, navigable PDFs from markdown content, including documentation, reports, or manuals, and integrate this capability into AI workflows via MCP.

Use cases

  • Convert markdown documentation to shareable PDFs
  • Generate professional reports with navigation
  • Create user manuals with interactive table of contents
  • Batch convert multiple markdown files to PDFs
  • Integrate markdown-to-PDF conversion into AI workflows

Key features

  • Automatic table of contents generation from markdown headers
  • Interactive clickable TOC links in PDFs
  • Syntax highlighting for code blocks
  • Support for markdown tables and embedded images
  • Batch file conversion
  • Customizable PDF styling with CSS

Tools3

What Md To PDF MCP lets your agent do. Expand a tool for its parameters.

Self-reported~40 tokens of context

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 112d

Supply-chain signal

6 high-severity advisories on record for this package. Most advisories affect transitive dependencies and may not be exploitable in this server's actual usage β€” this is a directional signal, not a security audit.

Critical 0High 6Medium 0Low 6

Scanned 8/20/2026 via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars8Stargazers on the source repository.
Last commit10mo agoMost recent push to the default branch.
Tools exposed3Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

Markdown to PDF Converter

Convert markdown (.md) files into professional, interactive PDF documents with automatic table of contents.

mcp-name: io.github.wmarceau/md-to-pdf

Features

  • Automatic Table of Contents - Generated from markdown headers
  • Interactive Navigation - Clickable TOC links to sections
  • Professional Styling - Clean, readable PDF output
  • Code Block Support - Syntax highlighting preserved
  • Table Support - Markdown tables convert to PDF tables
  • Image Support - Embedded images in PDFs
  • Batch Conversion - Process multiple files at once
  • MCP Integration - Use as an MCP server for AI assistants

Use Cases

  • Convert documentation to shareable PDFs
  • Create professional reports from markdown
  • Generate user manuals with navigation
  • Archive markdown content in PDF format
  • Prepare presentations or handouts
  • AI-powered document generation workflows

Project Structure

Code
md-to-pdf/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ md_to_pdf.py          # Core conversion logic
β”‚   └── convert.sh            # Wrapper script (sets library paths)
β”œβ”€β”€ mcp-server/
β”‚   └── md_to_pdf_mcp.py      # MCP server wrapper
β”œβ”€β”€ registry/
β”‚   └── manifest.json         # MCP Registry manifest
β”œβ”€β”€ workflows/
β”‚   └── convert-md-to-pdf.md  # Conversion workflow guide
β”œβ”€β”€ testing/                  # Multi-agent test infrastructure
β”œβ”€β”€ VERSION                   # Current version
β”œβ”€β”€ CHANGELOG.md              # Version history
β”œβ”€β”€ SKILL.md                  # MCP skill documentation
└── README.md                 # This file

Requirements

  • Python 3.8+
  • markdown2 (markdown parsing)
  • weasyprint (PDF generation)
  • pygments (code syntax highlighting)
  • mcp (MCP server - for MCP mode only)

macOS Additional Requirements

bash
brew install pango cairo

Quick Start

CLI Usage

server.ts
# Set library path (macOS)
export DYLD_LIBRARY_PATH=/opt/homebrew/lib:$DYLD_LIBRARY_PATH

# Convert single file
python src/md_to_pdf.py input.md output.pdf

# Using wrapper script
./src/convert.sh input.md output.pdf

# Batch convert
python src/md_to_pdf.py "docs/*.md" --output-dir pdfs/

# With custom styling
python src/md_to_pdf.py input.md output.pdf --css custom.css

# Without table of contents
python src/md_to_pdf.py input.md output.pdf --no-toc

MCP Server Usage

bash
# Install MCP SDK
pip install mcp

# Run MCP server
python mcp-server/md_to_pdf_mcp.py

MCP Tools

ToolDescription
convert_markdown_to_pdfConvert markdown to PDF with optional TOC
extract_tocExtract table of contents structure
get_default_stylesGet default CSS for customization

See SKILL.md for detailed MCP tool documentation.

Version

Current version: 1.0.0

License

MIT License

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about Md To PDF MCP

It accepts markdown (.md) files as input for conversion to PDF.

Yes, you can provide custom CSS files to style the PDF output.

Yes, it can process multiple markdown files at once, outputting PDFs in a specified directory.

Python 3.8+, and the Python packages markdown2, weasyprint, pygments, and mcp are required.

Yes, the generated PDFs include clickable table of contents links for easy navigation.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMd To PDF MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/marceausolutions-md-to-pdf-mcp?style=directory)](https://allmcps.com/mcp/marceausolutions-md-to-pdf-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/marceausolutions-md-to-pdf-mcp"><img src="https://allmcps.com/api/badge/marceausolutions-md-to-pdf-mcp?style=directory" alt="Md To PDF MCP on AllMCPs" /></a>