mcpField
M
Md2pdf Mcp

Md2pdf Mcp

Local
github.com/chunliuFiles & Storage0Updated 54w ago

About Md2pdf Mcp

Md2pdf Mcp is an MCP server for converting Markdown text into PDF files, for users who need document conversion from AI applications. It generates UUID-based filenames and returns resource links with metadata.

Key features

  1. 01Convert Markdown to PDF
  2. 02Generate UUID-based filenames
  3. 03Set output directory through an environment variable
  4. 04Return resource links with metadata

Use cases

  1. 01Export Markdown content as a PDF
  2. 02Get generated PDF files through an MCP client
  3. 03Save generated files to a chosen directory

MCP support

It exposes the `convert_md_to_pdf` tool to MCP clients, converting text to PDF and returning a resource link with the file URI and metadata.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"md2pdf": {
"command": "uvx",
"args": [
"md2pdf-mcp"
],
"env": {
"PDF_OUTPUT_DIR": "<PDF_OUTPUT_DIR>"
}
}
}
}
Run commanduvx md2pdf-mcp
Environment variables to set
PDF_OUTPUT_DIR

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypimd2pdf-mcp

Tools

1

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
markdown_textstringYes

Details

From the project README

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.