HTML to PDF in Cursor

HTML to PDF in Cursor

Turn HTML files, templates or URLs into PDFs from Cursor's agent with the html-pdf.com remote MCP server. Paste one JSON config and you're done.

Quick answer: add "html-pdf": { "url": "https://html-pdf.com/mcp", "headers": { "Authorization": "Bearer hp_live_..." } } under mcpServers in ~/.cursor/mcp.json, then ask the agent "Convert https://example.com to PDF".

One-click install

This is the fastest way to connect. Add html-pdf to Cursor opens Cursor with the server filled in.

Cursor then asks you to log in to html-pdf.com (OAuth), so you don't need to copy a key. New accounts get 100 free credits. Prefer a key in a config file? Follow the steps below instead.

Get an API key

For the manual config you need a key. Get one at https://html-pdf.com/login, or with a single request:

curl -X POST https://html-pdf.com/v1/signup \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com"}'

Copy the api_key (shown once), then open the link we email you to confirm your address. That adds 100 free credits, and 1 credit = 1 PDF page.

Connect

This step adds the server to Cursor. Put it in ~/.cursor/mcp.json for all projects, or .cursor/mcp.json for a single project:

{
  "mcpServers": {
    "html-pdf": {
      "url": "https://html-pdf.com/mcp",
      "headers": { "Authorization": "Bearer hp_live_..." }
    }
  }
}

It is a remote Streamable HTTP server, so there is nothing to install. Open Cursor Settings → MCP and check that html-pdf shows a green status and lists html_to_pdf, url_to_pdf, get_credits, buy_credits.

If you put the config in the project, keep the key out of git.

Try it

Once connected, you just ask in plain words. You don't write any code. For example:

You get back a download link (valid 24h), the page count and remaining credits.

Tips

These habits help you iterate on templates without wasting credits.

Troubleshooting

Most issues come from invalid JSON or assets the renderer can't reach.

FAQ

How do I add an MCP server in Cursor?

Add an entry under mcpServers in ~/.cursor/mcp.json (or .cursor/mcp.json per project) with the server url and an Authorization header. Then check for a green status in Cursor Settings → MCP.

Why are images missing from my PDF?

The renderer can't read local files like ./logo.png. Use absolute https:// URLs or data: URIs instead.

Is it free to try?

Yes. Each new account gets 100 free credits once you confirm your email, with no card. 1 credit = 1 PDF page, and failed renders cost nothing.

Do credits expire?

No. Purchased credits never expire. Packs go from $10 for 1,000 credits to $250 for 50,000.

Full reference: API docs · MCP server

This page as markdown · text