Skip to main content
Glama
kareemaly

MD-PDF MCP Server

by kareemaly

MD-PDF MCP Server

A Model Context Protocol (MCP) server for converting between Markdown and PDF formats.

System Requirements

Tested on:

  • macOS 14.3.0 (Darwin 23.3.0, ARM64)

  • Python 3.13.0

  • uv 0.7.13

  • pandoc 3.6.2

Features

  • Convert Markdown content/files to PDF with size options (small, medium, large)

  • Convert PDF files to Markdown format

  • Extract text from specific PDF pages

  • Retrieve PDF metadata

MCP Tools

  1. convert_markdown_to_pdf(markdown_content, output_filename, size, pdf_engine)

  2. convert_markdown_file_to_pdf(markdown_file_path, output_filename, size, pdf_engine)

  3. convert_pdf_to_markdown(pdf_file_path, output_filename)

  4. extract_text_from_pdf(pdf_file_path, page_numbers)

  5. get_pdf_info(pdf_file_path)

Installation

# Install dependencies
curl -LsSf https://astral.sh/uv/install.sh | sh
brew install pandoc weasyprint

# Setup project
uv sync

Running the Server

uv run python main.py

MCP Integration

Claude Desktop

{
  "mcpServers": {
    "md-pdf": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/md-pdf",
        "run",
        "main.py"
      ]
    }
  }
}

Cursor

Configure MCP in Cursor settings

{
  "servers": {
    "md-pdf": {
      "command": "uv",
      "args": ["run", "main.py"],
      "cwd": "/absolute/path/to/md-pdf"
    }
  }
}

Size Options

  • s: 8pt font, 0.35in margins (compact)

  • m: 9pt font, 0.5in margins (standard)

  • l: 11pt font, 1in margins (detailed)

Project Structure

md-pdf/
├── data/           # Test files
├── tools/          # MCP tool definitions  
├── utils/          # Conversion utilities
├── main.py         # Server entry point
└── server.py       # MCP server instance
Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Resources

Looking for Admin?

Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to authenticate as an admin.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kareemaly/md-pdf-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server