Get the FREE Ultimate OpenClaw Setup Guide →

pdf

MCP server from FabianGenell/pdf-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio fabiangenell-pdf-mcp-server npx github:FabianGenell/pdf-mcp-server

How to use

This MCP server provides a dedicated PDF generation service that converts Markdown content into feature-rich PDFs with theming, image handling, and templates. Core capabilities include generating PDFs from Markdown via generate_pdf, embedding and optimizing images through embed_images, and managing reusable styles and templates with create_styled_template, create_custom_style, and list_custom_styles. You can validate content before rendering with validate_markdown and produce styled PDFs using pre-defined themes (Default, Professional, Minimal, Dark) or custom CSS via custom_style. Typical workflows include validating markdown, embedding images from local/remote/base64 sources, applying a chosen theme, and optionally generating a table of contents and page numbers. The server supports saving outputs to the user’s Downloads folder by default, and you can reuse saved styles for consistent document formatting across projects.

How to install

Prerequisites:

  • Node.js and npm (recommended latest LTS)
  • Basic familiarity with JSON-based configuration for Claude or your MCP manager

Installation options:

  1. Quick Start (no local install required)
  • Add to Claude/host configuration using npx:
{
  "mcpServers": {
    "pdf-generator": {
      "command": "npx",
      "args": ["github:FabianGenell/pdf-mcp-server"]
    }
  }
}

This pulls the server directly from GitHub and runs it on demand.

  1. Local development (clone and run locally)
  • Clone the repository and install dependencies:
git clone https://github.com/FabianGenell/pdf-mcp-server
cd pdf-mcp-server
npm install
  • Run or integrate locally by pointing Claude to your local entry point (example shows index.js):
{
  "mcpServers": {
    "pdf-generator": {
      "command": "node",
      "args": ["/path/to/pdf-mcp-server/src/index.js"]
    }
  }
}
  1. Environment and usage tips
  • Ensure the server has access to your filesystem for reading markdown/images and writing PDFs.
  • When running locally, you can customize themes, templates, and styles via the provided APIs after starting the server.

Additional notes

Tips & troubleshooting:

  • PDFs by default are saved to the user’s Downloads folder unless you supply an absolute output_path in the tool options.
  • Images are automatically optimized, cached, and sized for performance. Ensure image sources (local paths, URLs, or base64 data URLs) are accessible to the server.
  • If embedding images or applying custom styles, verify that the CSS selectors and class names align with the markdown-it-attrs usage described in the docs (e.g., .center, .info-box).
  • When using generate_pdf or generate_pdf_with_style, you can override the default output path by providing output_path in the options.
  • For production deployments, consider configuring environment variables for caches, image proxies, or theme defaults if the MCP environment supports env injection.

Related MCP Servers

Sponsor this space

Reach thousands of developers