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…
What it can do
- 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 imag
- 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. Cons
What data it sees
Do you need an account
No: the server works without sign-in
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, 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 and HTML to PDF API 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, create a key in the dashboard, and enter it when connecting. Setup guides for Claude, Cursor and other clients are on the MCP page and in the installation docs.
Server tool list (2)
Raw names from tools/list. Only developers need these.
| 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. |