MCP PDF Server
Provides tools to convert Markdown content into PDF documents with customizable paper formats and orientations
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP PDF Serverconvert my meeting notes to a landscape PDF"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP PDF Server
An MCP (Model Context Protocol) server exposing tools to render Markdown into PDF.
What’s included
MCP tools:
pdf_from_markdown(primary) andmd_to_pdf(alias).Accepts inline Markdown or a file path.
Options for paper format and orientation; sensible
output/defaults.
Prerequisites
Node.js 18+ recommended.
Install
npm install
# Download browsers for Playwright (Chromium only is enough):
npx playwright install chromiumBuild
npm run buildRun (stdio)
npm startConfigure in your MCP-compatible client by pointing to the compiled binary or npm start command.
MCP Tools
Tool ids:
pdf_from_markdown(primary) andmd_to_pdf(alias for discoverability)Purpose: Generate a PDF from Markdown.
Inputs:
markdown(string, optional): Inline Markdown content. If set,pathis ignored.path(string, optional): Absolute or relative path to a.mdfile. Ignored ifmarkdownis provided.outputPath(string, optional): Desired output PDF path. Defaults tooutput/<timestamp>.pdfand creates missing directories.paperFormat(string, optional):A4|Letter|Legal(default:A4).paperOrientation(string, optional):portrait|landscape(default:portrait).Provide exactly one of
markdownorpath. If both are set,markdowntakes precedence.
Output:
Returns a text message containing the absolute path to the created PDF.
Example (inline):
{ "tool": "md_to_pdf", "arguments": { "markdown": "# Hello\nThis will render to PDF.", "paperFormat": "A4" } }Example (file path):
{ "tool": "pdf_from_markdown", "arguments": { "path": "examples/sample.md", "outputPath": "output/sample.pdf", "paperOrientation": "landscape" } }
Tool Schema (compact)
tools:
- id: pdf_from_markdown
alias: md_to_pdf
params:
markdown?: string # Inline Markdown (preferred if both set)
path?: string # Path to a .md file
outputPath?: string # Output PDF path (default: output/<timestamp>.pdf)
paperFormat?: 'A4'|'Letter'|'Legal' # default: 'A4'
paperOrientation?: 'portrait'|'landscape' # default: 'portrait'
constraints:
- Provide exactly one of markdown or path (if both provided, markdown is used)
result:
- type: text
text: "PDF created at: <absolute path>"Client configuration (example) If your MCP client supports JSON configuration for a stdio server, a minimal entry might look like:
{
"servers": {
"mcp-pdf": {
"command": "node",
"args": ["dist/index.js"]
}
}
}Notes
Uses Playwright (Chromium) to render HTML from Markdown and print to PDF.
On first install, Playwright may download a browser. You can also point it to an existing Chrome/Chromium.
One‑liner with npx
After this package is published to npm, you can run the server directly:
npx -y md-2-pdf-mcp(runs themd-2-pdf-mcpbin)Or explicitly:
npx -y -p md-2-pdf-mcp mcp-pdfThe package defines
binentries and apostinstallthat installs Chromium.
From the local repo (without publishing):
npx --yes .This uses the
binin package.json and thepreparescript to build.
This server cannot be deployed
Maintenance
Related MCP Connectors
I create PDF documents from markdown, preview, then generate a downloadable file
- blinkpdfOAuthio.blinkpdf
Render Markdown and LLM output into accessible PDF/UA-1 PDFs. No headless Chromium.
Compliant PDFs (PDF/A-2A + PDF/UA-1) from markdown or a compact DSL - fast, no headless browser.
Convert Markdown, HTML, and web pages to high-quality PDF with Prince.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts Markdown documents to PDF files with support for syntax highlighting, custom styling, Mermaid diagrams, optional page numbers, and configurable watermarks.129 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides tools for converting Markdown content and files into professional PDF documents with full support for Mermaid diagrams and LaTeX rendering. It allows for high-quality output customization, including paper size, table of contents, and syntax highlighting styles.-
- FlicenseNot gradedqualityDmaintenanceConverts Markdown files and standalone Mermaid diagrams into high-quality PDF or PNG documents using Puppeteer and SVG rendering. It supports custom CSS styling and provides tools for professional document generation from markdown-based content.4-
- FlicenseNot gradedqualityDmaintenanceConverts Markdown files and raw content into professionally styled PDFs with full support for Mermaid diagrams and syntax highlighting. It offers customizable page formats, margins, and modern typography for high-quality document generation.11-