url-to-pdf-mcp

MCP serverDocs & knowledge

Convert public web pages to PDF, images, Markdown, or JSON using one API key.

Use url-to-pdf-mcp in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add url-to-pdf-mcp and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use url-to-pdf-mcp

Details

Available today. Use it from your connected AI after setup.

Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

url-to-pdf-mcpStart free

Install url-to-pdf-mcp

The server’s own address, for the clients that take one directly. Or connect Ahel once and every client you use reads it from one address, with the account kept on Ahel rather than in each client’s config.

  • Claude Code

    claude mcp add --transport http --scope user url-to-pdf-mcp 'https://url-pdf.hammbox.com/mcp'

    Run it once in your project, then open /mcp to approve any sign-in the server asks for.

  • Claude Desktop

    https://url-pdf.hammbox.com/mcp

    Add a custom connector in Settings, paste this address, and approve the sign-in.

  • Cursor

    cursor://anysphere.cursor-deeplink/mcp/install?name=url-to-pdf-mcp&config=eyJ1cmwiOiJodHRwczovL3VybC1wZGYuaGFtbWJveC5jb20vbWNwIn0=

    Open the link and Cursor adds the server at that address.

  • ChatGPT

    https://url-pdf.hammbox.com/mcp

    In Settings, enable Developer mode, create an MCP app, and paste this address. Your plan and workspace must allow custom apps.

  • Codex

    codex mcp add url-to-pdf-mcp --url 'https://url-pdf.hammbox.com/mcp'

    Run it once, then sign in with codex mcp login url-to-pdf-mcp if the server asks for an account.

From the project's README

As published by strayly/url-to-pdf in README.md.

把任意公开网页转换为 PDF / 整页截图 / Markdown 的 MCP server 与 HTTP API。 通过 Paddle 购买 API key 后调用,无需自建浏览器渲染环境。

  • 标准 MCP server,兼容 Claude Desktop、Cursor 等支持 tool-calling 的客户端
  • 原生 HTTP API,便于脚本、服务端、低代码平台直接调用
  • SSRF 防护:仅允许公网 http(s) 地址,拦截内网/保留网段
  • 基于 Paddle 的订阅制授权,付款后自动发卡

线上实例

已部署公开实例,可直接使用,无需自建:

https://url-pdf.hammbox.com

获取 API key

  1. 打开 https://url-pdf.hammbox.com/buy 进入结账页。
  2. 完成订阅付款(Paddle 结账,支持主流信用卡)。
  3. 付款完成后,打开 https://url-pdf.hammbox.com/portal/claim?email=<你付款用的邮箱> 即可领取你的 API key(utp_...)。

使用方式

方式一:作为 MCP server(推荐给 AI 客户端)

在 Claude Desktop / Cursor 等客户端的 MCP 配置中加入:

{
  "mcpServers": {
    "url-to-pdf": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://url-pdf.hammbox.com/mcp",
        "--header", "x-api-key: YOUR_API_KEY"
      ]
    }
  }
}

连接后可直接用自然语言调用,例如「把 https://example.com 转成 PDF」。

方式二:作为 HTTP API(推荐给脚本 / 服务端)

所有渲染走 POST /tools/*,请求头带 x-api-key:

# 网页转 PDF
curl -X POST https://url-pdf.hammbox.com/tools/url-to-pdf \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"url":"https://example.com","format":"A4"}'

# 整页截图
curl -X POST https://url-pdf.hammbox.com/tools/url-to-screenshot \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"url":"https://example.com","fullPage":true,"format":"png"}'

# 提取 Markdown
curl -X POST https://url-pdf.hammbox.com/tools/url-to-markdown \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"url":"https://example.com"}'

返回 JSON 含 downloadUrl(有效期 1 小时),再下载即可:

curl -O "<downloadUrl>"

API 参考

工具 / 端点对照

MCP 工具名HTTP 端点说明
list_capabilitiesGET /openapi.json免费。列出能力、价格与购买入口
url_to_pdfPOST /tools/url-to-pdf网页转 PDF
url_to_screenshotPOST /tools/url-to-screenshot整页截图
url_to_markdownPOST /tools/url-to-markdown提取 Markdown

url_to_pdf 参数

参数类型说明
urlstring(必填)待转换页面的公网 http(s) URL
formatA4 / Letter / Legal纸张大小,默认 A4
landscapeboolean横向,默认 false
printBackgroundboolean打印背景图形,默认 true
scalenumber缩放 0.1–2,默认 1
marginstring / object边距,如 "10mm" 或 {top,right,bottom,left}
preferCssPageSizeboolean遵循页面 CSS @page 尺寸

url_to_screenshot 参数

参数类型说明
urlstring(必填)目标 URL
fullPageboolean截取整页,默认 true
formatpng / jpeg默认 png
qualitynumberJPEG 质量 0–1,默认 0.8

url_to_markdown 参数

参数类型说明
urlstring(必填)目标 URL
removeSelectorsstring[]提取前剔除的 CSS 选择器,如 ["nav",".ads","footer"]
keepImagesboolean保留图片链接,默认 false

许可证

MIT

Advanced
Delivery
url-to-pdf MCP server → your Ahel connector (mcp.ahel.ai) → your AI.
Item type
mcp-server
Key
io-github-strayly-url-to-pdf
Source
github.com/strayly/url-to-pdf
Hosted endpoint
https://url-pdf.hammbox.com/mcp