Markdown2pdf MCP Server

MCP server for converting markdown to PDF - run with npx markdown2pdf-mcp to start the server

Local serverstdioTypeScript

What is the Markdown2pdf MCP server?

MCP server for converting markdown to PDF - run with npx markdown2pdf-mcp to start the server. The markdown2pdf mcp server wraps that behind the Model Context Protocol, so an assistant can use it rather than through you.

What it actually does

An MCP server for converting Markdown documents to PDF files. This server provides a simple and efficient way to generate PDFs from Markdown content with support for syntax highlighting, custom styling, optional page numbers, and flexible watermark placement (first page only or all pages).

  • Convert Markdown to PDF with a single command
  • Syntax highlighting for code blocks
  • Custom CSS styling for PDF output
  • Support for standard Markdown formatting
  • Mermaid diagram rendering
  • Modern PDF generation using Chrome's rendering engine

Adding it to your client

The server ships on npm as markdown2pdf-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Configuration

You will need 2 environment variables: M2P_OUTPUT_DIR, M2P_VERBOSE. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the markdown2pdf mcp server does with a few real requests.

When to reach for it

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. It is maintained by hasithy; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Markdown2pdf's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

How to install the Markdown2pdf MCP server

{
  "mcpServers": {
    "markdown2pdf-1": {
      "command": "npx",
      "args": ["-y", "markdown2pdf-mcp"],
      "env": {
        "M2P_OUTPUT_DIR": "your-value",
        "M2P_VERBOSE": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
M2P_OUTPUT_DIRFilesystem location the server is allowed to use.Optional
M2P_VERBOSEConfiguration value read at startup.Optional

Frequently asked questions

It connects Markdown2pdf to MCP-compatible AI assistants such as Claude and Cursor. Instead of copying data back and forth by hand, the assistant works with Markdown2pdf directly.