Md2pdf Mcp
About
This server provides a tool to convert Markdown text to PDF files using the convert_markdown library. It's designed to work as an MCP (Model Context Protocol) server that can be integrated with various AI assistants and applications.
Details
- Author
- chunliu
- Downloads
- 274
- Categories
- Other
Jump to
- Converts Markdown text to well-formatted PDF files
- Generates random filenames using UUID to avoid conflicts
- Configurable output directory via the PDF_OUTPUT_DIR environment variable
- Returns resource links with metadata for easy integration
- Built on FastMCP for reliable MCP server functionality
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Md2pdf McpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install and run the server via uvx --from md2pdf-mcp md2pdf. Configure it in your MCP client by adding a JSON entry with the command and optional PDF_OUTPUT_DIR environment variable. The server exposes a single tool, convert_md_to_pdf, which takes a markdown_text string parameter and returns a resource link to the generated PDF.
convert_md_to_pdf
Convert Markdown text to PDF. Args: markdown_text (str): The Markdown text to convert. Returns: str: The JSON string with PDF metadata.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"md2pdf mcp": {
"md2pdf": {
"command": "uvx",
"args": [
"--from",
"md2pdf-mcp",
"md2pdf"
],
"env": {
"PDF_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
}
}
McpServers
{
"md2pdf": {
"command": "uvx",
"args": [
"--from",
"md2pdf-mcp",
"md2pdf"
],
"env": {
"PDF_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
md2pdf-mcp
MCP Server for Markdown to PDF conversion.
Description
This server provides a tool to convert Markdown text to PDF files using the convert_markdown library. It's designed to work as an MCP (Model Context Protocol) server that can be integrated with various AI assistants and applications.
Features
- Convert Markdown text to well-formatted PDF files
- Random filename generation using UUID to avoid conflicts
- Configurable output directory via environment variables
- Returns resource links with metadata for easy integration
- Built on FastMCP for reliable MCP server functionality
Installation
You can install and run this tool using uvx:
uvx --from md2pdf-mcp md2pdf
Usage
As MCP Server
Configure the server in your MCP client configuration:
{
"mcpServers": {
"md2pdf": {
"command": "uvx",
"args": ["--from", "md2pdf-mcp", "md2pdf"],
"env": {
"PDF_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
}
Available Tools
The server provides one tool:
convert_md_to_pdf
Converts Markdown text to a PDF file.
Parameters:
- markdown_text (string): The Markdown content to convert
Returns:
A JSON string containing:
- type: "resource_link"
- uri: File URI of the generated PDF
- name: Generated filename (UUID-based)
- mimeType: "application/pdf"
- annotations: Metadata including audience, priority, and last modified timestamp
Environment Variables
- PDF_OUTPUT_DIR: Directory where PDF files will be saved (defaults to user's home directory)
Example Usage
Once the server is running, you can call the tool through your MCP client:
{
"mcpServers": {
"md2pdf": {
"command": "uvx",
"args": ["--from", "md2pdf-mcp", "md2pdf"],
"env": {
"PDF_OUTPUT_DIR": "/path/to/output/folder"
}
}
}
}
License
MIT License
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



