@codetoimage/mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@codetoimage/mcp-server Render a card with 'Hello World' in blue on white, 400x200 PNG."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@codetoimage/mcp-server
Official Model Context Protocol server for codetoimage.app – render HTML/CSS to PNG/JPG/WebP directly from Claude Desktop, Claude Code, Cursor, or any MCP-compatible client.
What you get
Two tools, no setup beyond an API key:
render_html_to_image– returns the image inline so your agent (or you, in chat) can see it immediately. Best for "show me the rendered card", OG preview iteration, chart generation, badge mockups.render_html_to_url– returns a temporary hosted URL (24h TTL). Best when the image needs to live somewhere external – Instagram Graph API, OpenGraph meta tags, Slack unfurls, docs/posts embeds.
Related MCP server: ShotAPI
Install
You don't need to install anything globally – MCP clients can run it via npx. Get an API key at codetoimage.app/dashboard/keys, then add the config below.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"codetoimage": {
"command": "npx",
"args": ["-y", "@codetoimage/mcp-server"],
"env": {
"CODETOIMAGE_API_KEY": "cti_live_..."
}
}
}
}Restart Claude Desktop. The two tools appear in the tool picker.
Claude Code
claude mcp add codetoimage -s user -- npx -y @codetoimage/mcp-serverThen set the env var in your shell profile (or pass -e CODETOIMAGE_API_KEY=cti_live_… in the claude mcp add call).
Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"codetoimage": {
"command": "npx",
"args": ["-y", "@codetoimage/mcp-server"],
"env": {
"CODETOIMAGE_API_KEY": "cti_live_..."
}
}
}
}Usage from an agent
The tools are self-documenting – your agent will pick the right one based on intent. Example prompts that just work:
"Render this card as a PNG:
<div style='padding:40px;background:#6366f1;color:white;border-radius:16px'>Hello</div>at 800×400."
"Generate an Open Graph image for the blog post 'Why agents need pixel-perfect rendering' and give me a URL I can paste into the og:image meta tag."
"Take this CSS card and render it as a transparent PNG so I can use it on a dark background."
"Render my saved template 3f2a91d0-... with title 'Launch day' as an Instagram story."
Tool schemas
render_html_to_image
Field | Type | Required | Notes |
| string | ✓* | Full HTML (typically with |
| string | – | Optional CSS injected as |
| uuid | ✓* | Saved template from the dashboard (Templates page); alternative to |
| object | – | Values for |
| enum | – | Named size: |
| integer 1-2048 | – | Default 800; overrides |
| integer 1-2048 | – | Default 600; overrides |
|
| – | Default |
| integer 1-100 | – | JPEG/WebP only |
| boolean | – | PNG/WebP, paid plans |
| string | – | e.g. |
Returns: image content (base64 inline), rendered in the chat.
render_html_to_url
Same input schema as render_html_to_image. Returns a text block with:
url– temporary hosted image URLformat– final output formatexpires_at– ISO timestamp (24h from render)credits_remaining– your plan's quota state
Configuration
Variable | Default | Purpose |
| – | Required. Get one at codetoimage.app/dashboard/keys |
|
| API base URL (override for dev/proxy) |
Plans + limits
Free – 50 renders/month, no watermark, full features (up to 2048×2048, all formats).
Paid (Starter / Hobby / Pro / Scale) – from $9/mo for 1,000 renders up to 50,000/month, higher rate limits.
Pay as you go – prepaid credit packs from $5, valid 12 months, no subscription.
Pricing: codetoimage.app/#pricing
Related
@codetoimage/cli– terminal/CI usage
License
MIT
Available Tools
2 toolsrender_html_to_imageA
Render HTML (and optional CSS) into a PNG/JPEG/WebP image using codetoimage.app. Instead of raw HTML you can pass template_id (a template saved in the dashboard) plus variables to fill its {{placeholders}}, and preset for named platform sizes (og, instagram-story, ...). Returns the image inline so the conversation can display it directly. Use this when you need to see or hand back a finished image (cards, OG previews, charts, badges). If the caller needs a URL to embed elsewhere (Instagram Graph API, OpenGraph meta, Slack unfurl), use render_html_to_url instead.
Inputs: css, html, width, format, +7 more.
render_html_to_urlA
Render HTML (and optional CSS) to an image and return a temporary hosted URL (instead of inline bytes). Supports the same template_id + variables + preset inputs as render_html_to_image. Use this when the caller needs to reference the image elsewhere – Instagram Graph API, OpenGraph meta tags, Slack unfurls, embedding in docs/posts. URL is valid for 24 hours.
Inputs: css, html, width, format, +7 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: one returns inline image data, the other a temporary URL. Their descriptions explicitly contrast when to use each, leaving no ambiguity.
Both tool names follow the exact pattern 'render_html_to_X', where X is the output type (image vs url). The naming is perfectly consistent and descriptive.
With only two tools, the server is tightly scoped to its single purpose of rendering HTML to images. Each tool covers a necessary output format, so the count is ideal.
For a server focused solely on rendering HTML to images, offering both inline and URL outputs covers all common use cases. There are no missing features or dead ends.
Maintenance
Related MCP Connectors
Screenshot, PDF and HTML-to-image rendering API so Claude and Cursor can see any web page.
Screenshot, PDF and HTML-to-image rendering API so Claude and Cursor can see any web page.
Screenshot any URL/HTML as PNG/JPEG/WebP, or read it as clean Markdown/text for LLMs.
Generate images, GIFs, videos, and PDFs from HTML, URLs, or templates — from your AI agent.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceScreenshot & Render API for AI Agents. MCP Server lets Claude, Cursor capture webpages and render HTML. Direct access, no VPN needed.-
- AlicenseNot gradedqualityDmaintenanceScreenshot and HTML Rendering MCP Server for AI Agents. Capture screenshots, render HTML to images, and generate PDFs via simple API calls. Compatible with Claude, Cursor, and any MCP client.1MIT
- AlicenseAqualityBmaintenanceDeterministic file operations for AI agents: 40 operations over plain HTTPS. PDF merge, split, redact, sanitize, OCR, Office and PDF to Markdown, RAG chunking, charts, QR codes, C2PA AI labelling. find_tool suggests the right one. $0.01 per operation, 100 free, no signup, credits never expire.5330 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to render any URL or raw HTML into PDF files or PNG/JPEG/WebP screenshots over MCP stdio or Streamable HTTP. Output stays in memory with SSRF protection, bounded concurrency, and configurable size and timeout limits.18 npm1MIT