- Home
- MCP servers
- Markdown2PDF
Markdown2PDF
- javascript
27
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"2b3pro-markdown2pdf-mcp": {
"command": "node",
"args": [
"/path/to/markdown2pdf-mcp/build/index.js"
],
"env": {
"M2P_VERBOSE": "true",
"M2P_OUTPUT_DIR": "YOUR_OUTPUT_DIR"
}
}
}
}You have a Markdown2PDF MCP Server that converts Markdown documents into PDF files. It supports syntax highlighting, custom styling through CSS, optional page numbers, and configurable watermarks. This server is designed to be used with MCP clients to generate PDFs from Markdown content on demand.
How to use
You interact with the server through an MCP client by invoking the create_pdf_from_markdown tool. Provide the Markdown content you want converted and, optionally, formatting options such as output filename, page size, orientation, border, watermark, and whether to show page numbers. The tool renders Mermaid diagrams when you include Mermaid code blocks and uses the built-in syntax highlighting for code blocks.
How to install
Prerequisites you need installed on your machine:
- Node.js and npm (or npx) are available on your system
- A working MCP client setup that can communicate with the server
Install from source and build the project with these steps. Run each command on its own line.
# Clone the project
git clone https://github.com/2b3pro/markdown2pdf-mcp.git
# Navigate to the project directory
cd markdown2pdf-mcp
# Install dependencies
npm install
# Build the project
npm run build
Additional configuration and usage notes
Configure how your server writes output and how verbose you want its logs to be. You can also run the server on demand with npx to avoid a permanent local install.
{
"mcpServers": {
"markdown2pdf": {
"args": ["/path/to/markdown2pdf-mcp/build/index.js"],
"env": {
"M2P_OUTPUT_DIR": "/path/to/output/directory",
"M2P_VERBOSE": "true"
}
}
}
}
Running on demand with npx
If you prefer not to install the package locally, you can start the server on demand using npx. This installs a temporary workspace and launches the MCP server from the packaged entrypoint.
npx -y markdown2pdf-mcp@latest
Output behavior and options
The tool automatically handles file name conflicts by appending incremental numbers (for example: output.pdf, output-1.pdf, output-2.pdf). For large Markdown files, the server adjusts timeouts and memory usage to ensure stable rendering. If you include a watermark, you can specify the scope (all pages or only the first page) and optionally enable page numbers in the PDF footer.
Available tools
create_pdf_from_markdown
Converts Markdown to PDF. Accepts markdown content and optional parameters like outputFilename, paperFormat, paperOrientation, paperBorder, watermark, watermarkScope, and showPageNumbers.