关于 HTML to Image
通过 HTTP 将 HTML 和 CSS 渲染为 PNG 图片。发送 HTML 和 CSS,即可返回 PNG。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
服务地址
https://app.html2img.com/mcp一键复制安装命令
Claude CodeTerminal
claude mcp add --transport http com-html2img-html-to-image https://app.html2img.com/mcpCursor.cursor/mcp.json
{"mcpServers":{"com-html2img-html-to-image":{"type":"http","url":"https://app.html2img.com/mcp"}}}在 Cursor 中打开VS Code.vscode/mcp.json
{"servers":{"com-html2img-html-to-image":{"type":"http","url":"https://app.html2img.com/mcp"}}}在 VS Code 中打开Claude Desktopclaude_desktop_config.json
{"mcpServers":{"com-html2img-html-to-image":{"type":"http","url":"https://app.html2img.com/mcp"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"com-html2img-html-to-image":{"serverUrl":"https://app.html2img.com/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
全部服务地址
Streamable HTTP
https://app.html2img.com/mcp需要授权工具
2| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| css | string | 否 | 要注入页面的可选附加 CSS。 |
| dpi | integer | 否 | 用于提高输出分辨率的缩放系数/设备像素比(1-4)。 |
| html | string | 是 | 要渲染的完整 HTML 标记。请在内联 <style> 块中包含 CSS。可使用可公开访问的远程图像 URL;对于未托管在任何位置的图像,请使用 base64 data URI。 |
| width | integer | 否 | 视口宽度,单位为像素(1-5000)。默认值为 1920。 |
| format | enum | 否 | 输出格式。"png"(默认)返回按宽度和高度设定尺寸的图像。"pdf" 返回 A4 纵向矢量 PDF,文本可选择、可搜索,并自动分页;此时忽略 width、height、dpi 和 fullpage。发票、报告、证书和票据等文档请使用 "pdf"。社交卡片、OG 图像及任何固定像素尺寸的内容请使用 "png"。png | pdf |
| height | integer | 否 | 视口高度,单位为像素(1-5000)。默认值为 1080。 |
| fullpage | boolean | 否 | 截取整个可滚动页面,而非仅截取视口。 |
| ms_delay | integer | 否 | 截取前等待的毫秒数(1-5000),例如等待字体或动画稳定。 |
| wait_for_selector | string | 否 | 等待此 CSS 选择器出现后再截取。 |
详细介绍
维护者还没有提供详细介绍,可以先查看代码仓库中的 README。
评论
支持 Markdown
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。