MD-PDF MCP Server is an MCP server that provides two-way document conversion tools between Markdown and PDF formats. It connects an AI agent running in Model Context Protocol clients directly to local conversion utilities powered by Pandoc and WeasyPrint. Developers, technical writers, and researchers use it to automate document generation and content extraction. The server enables clients to generate styled PDF files directly from raw Markdown text or existing Markdown files, offering preset layout options for compact, standard, and detailed document sizing. In reverse, it allows users to convert PDF documents back into clean Markdown files for text analysis and editing. Additionally, the server exposes targeted tools to extract plain text from specific page numbers within a PDF file and inspect PDF metadata such as document properties. By managing document rendering locally via standard command-line engines, it provides predictable formatting and automated conversion workflows directly within supported LLM development environments.
Category: Developer Tools & Code Intelligence
Tags: conversion, markdown, pandoc, pdf, weasyprint
brew install pandoc weasyprint, and install uv with curl -LsSf https://astral.sh/uv/install.sh | sh. 2. Clone the repository and run uv sync in the project root to install Python dependencies. 3. To use with Claude Desktop, add the server to your claude_desktop_config.json file: json { "mcpServers": { "md-pdf": { "command": "uv", "args": [ "--directory", "/absolute/path/to/md-pdf", "run", "main.py" ] } } } 4. For Cursor, add the server under Cursor settings with command: uv, args: ["run", "main.py"], and set cwd to /absolute/path/to/md-pdf. 5. Restart your client to start using the tools.• Generate formatted PDF reports directly from raw Markdown text strings using compact, standard, or detailed layout sizing options. • Batch convert existing Markdown files on your local file system into publication-ready PDF documents using WeasyPrint. • Transform received PDF files into editable Markdown documents to enable fast downstream content parsing and analysis. • Extract plain text contents from targeted PDF page ranges without processing the entire document. • Inspect PDF file metadata to extract file properties and document structures directly within AI workflows.
Part of MCP Servers
MD-PDF MCP Server provides Model Context Protocol tools to convert Markdown text or files into PDF format, convert PDFs into Markdown, extract text from specified PDF pages, and retrieve document metadata. It supports multiple sizing presets including compact, standard, and detailed font and margin configurations.
First install Pandoc and WeasyPrint along with the uv package manager. Clone the repository and execute uv sync to install the project dependencies. Then register the server in your MCP client configuration file by pointing the uv command to run main.py inside the repository directory.
It works with any standard Model Context Protocol client. The documentation explicitly provides configuration setups for Claude Desktop and Cursor by setting the command to run uv with main.py.
The server requires Python 3.13 or newer, the uv package manager, Pandoc (version 3.6.2 tested), and WeasyPrint installed on your local host system.
Yes, MD-PDF MCP Server is an open-source project hosted on GitHub under the kareemaly/md-pdf-mcp repository.