convert_markdown_to_pdfLABSCO SUMMARY
Markdown out to a PDF, and PDFs back to something you can edit.
Both directions sit in one server, with the layout question reduced to picking small, medium or large — enough to hand someone a readable document without opening a word processor.
What it is
A two-way converter between Markdown and PDF, run locally through pandoc. Conversion goes both directions and nothing leaves the machine.
What you get
- Markdown to PDF from content passed inline, or from a file already on disk
- Density presets instead of a stylesheet — pick how tight the type and margins should be on the conversion call
- A choice of PDF engine on the conversion call
- PDF back to Markdown, so a document you were sent becomes editable text
- Text lifted from the specific pages you name, and the PDF's own metadata read off the file
Requirements
uv and Python, plus pandoc and weasyprint installed locally — the conversion runs through them. No account, no key and no upload: files are read and written on the machine running the server.
Setup effort
Build from source — git clone https://github.com/kareemaly/md-pdf-mcp.git
USE CASES
Sending someone a document you wrote in Markdown
Pass the file, choose the density, get a PDF. No template and no export dialog.
Turning something an assistant just drafted into a file
The Markdown goes in as content rather than as a path, so a draft written in the conversation becomes a PDF without being saved first.
Editing a PDF you were sent
Convert it to Markdown, make the change in text, and convert it back.
Quoting from one page of a long report
Pull the text of only the pages you name, and read the document's metadata to check which version you are holding.
5 tools
Listed in project docs. Your client may show a different list.
convert_markdown_file_to_pdfconvert_pdf_to_markdownextract_text_from_pdfget_pdf_infoBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- uv on PATH
- Python 3.13.0
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/kareemaly/md-pdf-mcp.git
cd md-pdf-mcp
curl -LsSf https://astral.sh/uv/install.sh | sh
brew install pandoc weasyprint
uv sync
uv run python main.pyMCP Clients
Claude Desktop
{
"mcpServers": {
"md-pdf": {
"command": "uv",
"args": [
"--directory",
"<YOUR_PATH_TO_MD_PDF_MCP>",
"run",
"main.py"
]
}
}
}