Convert-Markdown-PDF-MCP
by seanivore
Overview
Converts Markdown content into gorgeously styled PDF documents using VS Code's markdown styling and Python's ReportLab, integrated as an MCP server.
Installation
uv --directory /path/to/your/local/md-pdf-mcp run md-pdf-mcpSecurity Notes
Critical risks identified: 1. **Directory Traversal**: The `output_path` argument for the `convert_markdown` tool is directly used to construct file paths for PDF output. An attacker could specify paths like `../../../../evil.pdf` to write files to arbitrary locations outside the intended directory. 2. **SSRF/Malicious Image Download**: The `download_image` function in `converter.py` fetches image URLs directly from markdown `img src` attributes. If markdown input is untrusted, this could lead to Server-Side Request Forgery (SSRF) or downloading large/malicious files, causing resource exhaustion or internal network exposure. 3. **Arbitrary File Read (Potential)**: While less direct, the `read_resource` handler for `pdf://local/` and `markdown://local/` schemes might allow reading arbitrary files if the URI path is not sufficiently sanitized beyond basic scheme replacement, given that `Path()` is used directly with the extracted path component. The `list_resources` also lists all markdown/pdf files in the current working directory, which might expose more than intended. These vulnerabilities make the server unsafe to run with untrusted user input without significant hardening.
Similar Servers
paperdebugger
An AI-powered academic writing assistant integrated with Overleaf for debugging and improving LaTeX papers through intelligent suggestions, critique, and revision.
html-to-markdown-mcp
Converts HTML content (from a URL or raw string) into clean, formatted Markdown and can save it to a file.
markitdown-mcp
A Model Context Protocol (MCP) server for converting over 29 file formats (PDFs, Office docs, images, audio, etc.) into clean, structured Markdown, primarily for integration with AI workflows and MCP clients like Claude Desktop.
markitdown-mcp
A Model Context Protocol (MCP) server designed to convert various document and media file formats into Markdown, primarily for integration with AI workflows like Claude Desktop.