# html2pdfconverter

> html2pdfconverter is an MCP server for files and documents. MCP server that lets AI clients turn HTML or URLs into PDF files via an API key. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, API
- **Repository:** https://github.com/html2pdfconverter/mcp-server
- **MCP Registry name:** io.github.html2pdfconverter/mcp-server
- **Categories:** [files and documents](https://ai-powered.com/categories/files-and-documents)
- **Listing updated:** 2026-11-21

## About

The README describes this as a Model Context Protocol server that wraps the HTML2PDF Converter service, so AI assistants such as Claude Desktop or Cursor can request PDF output on a user's behalf. Its single exposed tool accepts either a URL or a raw HTML string and writes the resulting PDF to a temporary file, returning the file path to the client.

Setup runs through npx with the npm package @html2pdfconverter/mcp-server, which requires Node.js 18 or newer. The service itself needs an HTML2PDF Converter API key, passed as an environment variable; the registry marks that key as required and secret. Configuration snippets for Claude Desktop and Cursor are included in the README.

It suits developers and teams who already use an MCP-capable assistant and want document generation from HTML inside that workflow rather than through a separate web interface.

## Features

- **Single PDF generation tool:** Exposes a generate_pdf tool that converts a URL or raw HTML into a PDF.
- **URL or HTML input:** Accepts either a web address or an HTML string as the source for the document.
- **Temporary file output:** Saves the generated PDF to a temporary file and returns its path to the client.
- **npx-based installation:** Runs directly through npx with no local install step beyond Node.js 18+.
- **API key configuration:** Reads the HTML2PDF Converter API key from an environment variable, marked as secret in the registry.

## Good for

- Letting an AI assistant export a web page or HTML snippet as a PDF during a conversation
- Automating PDF creation of reports or invoices written as HTML from within an MCP client
- Converting a live URL to PDF as part of a multi-step assistant workflow

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp-server --env YOUR_API_KEY='<YOUR_API_KEY>' -- npx -y @html2pdfconverter/mcp-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@html2pdfconverter/mcp-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@html2pdfconverter/mcp-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp-server": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@html2pdfconverter/mcp-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@html2pdfconverter/mcp-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@html2pdfconverter/mcp-server"
      ],
      "env": {
        "YOUR_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}
```

## Tools

- `generate_pdf`: Converts a URL or raw HTML string into a PDF and saves it to a temporary file, returning the file path.

## FAQ

### What tool does the server expose?

The README lists one tool, generate_pdf, which converts a URL or raw HTML string into a PDF saved to a temporary file.

### What do I need to run html2pdfconverter?

Node.js 18 or newer and an HTML2PDF Converter API key, which the README says is obtained from the service's website.

### Which AI clients are covered?

The README gives configuration steps for Claude Desktop and Cursor and says it works with other MCP-compatible clients.

### How do I add html2pdfconverter to Claude Code?

Run this command in your terminal: claude mcp add mcp-server --env YOUR_API_KEY='<YOUR_API_KEY>' -- npx -y @html2pdfconverter/mcp-server

### What are the best alternatives to html2pdfconverter?

The closest alternatives to html2pdfconverter are Markdown to HTML Got Simplified, PDFGate, Htmlpdf Transform Mcp, RenderDock and MCP Server Filesystem.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Markdown to HTML Got Simplified](https://ai-powered.com/mcp/markdown-to-html-got-simplified): Markdown to HTML Got Simplified is a freemium MCP server for files and documents.
- [PDFGate](https://ai-powered.com/mcp/pdfgate): PDFGate is an MCP server for files and documents.
- [Htmlpdf Transform Mcp](https://ai-powered.com/mcp/htmlpdf-transform-mcp): Htmlpdf Transform Mcp is a freemium MCP server for files and documents.
- [RenderDock](https://ai-powered.com/mcp/renderdock): RenderDock is an MCP server for files and documents.
- [MCP Server Filesystem](https://ai-powered.com/mcp/mcp-server-filesystem): MCP Server Filesystem is an open-source MCP server for files and documents.
- [Mindlm MCP](https://ai-powered.com/mcp/mindlm-mcp): Mindlm MCP is a free MCP server for productivity.
- [pdf.net](https://ai-powered.com/mcp/pdf-net): pdf.net is a free MCP server for files and documents.
- [Markdown Logic Express](https://ai-powered.com/mcp/markdown-logic-express): Markdown Logic Express is a free MCP server for files and documents.

---
Source: https://ai-powered.com/mcp/html2pdfconverter
