目录 / html2img - HTML to Image API
html2img - HTML to Image API
Give your AI agent production-quality rendering: this MCP server turns the HTML your agent writes into pixel-perfect PNG images and A4 vector PDFs, and captures live web pages by URL. It is the official MCP server for the [HTML to Image API](https://html2img.com/), rendered on real headless Chrome, with every result uploaded to a fast CDN and returned as a shareable URL. ## Tools - **generate-image-from-html** - render HTML and CSS into a PNG (social cards, OG images, charts, banners) or a paginated A4 PDF with selectable text (invoices, reports, certificates). PNG results include an inline preview, so the agent can see what it made and refine the markup. - **screenshot-url** - capture any public web page as a full-page or viewport PNG screenshot, or archive it as a vector PDF. Supports custom viewports, element selectors, injected CSS, waits and retina scaling. The same rendering engine powers our [Screenshot API](https://html2img.com/screenshot-api/) and [HTML to PDF API](https://html2img.com/html-to-pdf/) if you would rather integrate directly over REST. ## Authentication You will need an API key (`htim_...`) from a paid HTML to Image plan - each render costs one credit. Sign up at [html2img.com](https://html2img.com/pricing/), create a key in the dashboard, and enter it when connecting. Setup guides for Claude, Cursor and other clients are on the [MCP page](https://html2img.com/mcp/) and in the [installation docs](https://html2img.com/docs/mcp/installation/).
接入信息
- 传输形态
- http
- 鉴权方式
- 鉴权未知
- 端点
https://html2img.run.tools
{
"mcpServers": {
"html2img - HTML to Image API": {
"url": "https://html2img.run.tools"
}
}
}
能力清单
| 工具 | 说明 |
|---|---|
| generate-image-from-html | Render HTML and CSS into a PNG image, or into an A4 vector PDF with format "pdf". Provide complete, self-contained HTML and put styles in an inline <style> block. Remote image URLs load if they are real and publicly accessible; embed generated or local images as base64 data URIs rather than inventing URLs. Returns the rendered image plus a shareable CDN URL; PDF renders return the URL only. Consumes one credit per call. |
| screenshot-url | Capture a live web page by URL as a PNG screenshot, or as an A4 vector PDF with format "pdf". Returns the rendered image plus a shareable CDN URL; PDF renders return the URL only. Consumes one credit per call. |
提交举报 / 纠错
侵权举报经核验成立后,我们会即时下线该条目并删除已存的内容副本。