Skip to main content

MCP Server for Markdown to PDF conversion

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md2pdf_mcp-0.1.4.tar.gz (160.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2pdf_mcp-0.1.4-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file md2pdf_mcp-0.1.4.tar.gz.

File metadata

  • Download URL: md2pdf_mcp-0.1.4.tar.gz
  • Upload date:
  • Size: 160.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.0

File hashes

Hashes for md2pdf_mcp-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2c46bef653c4a5297493e57f926c0771356bf1838639846e063806bffc01830a
MD5 372a4fe5b2564eaf096f87f82d607013
BLAKE2b-256 2dbda3d3cfccec12a570a5789c062a79926de6dcca1893cba2ba71a73a3e55d6

See more details on using hashes here.

File details

Details for the file md2pdf_mcp-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for md2pdf_mcp-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 971b3c089c5d3e856a62eb5ae7935b8b427c78336d2f245b7b452b40bc89c64f
MD5 40e5e53f2c2f82d7d2c669a6224218f5
BLAKE2b-256 7d3befce0ca45d4c1fbf847c03499139ac99faeb4c13da409db33835de107899

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page