io.github.beznazwiska/codetoimage-mcp-server

Official registry Media and design

Pixel-perfect HTML/CSS to PNG/JPG/WebP for AI agents — inline image or 24h hosted URL.

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

NPM package @codetoimage/mcp-server
Claude Code
claude mcp add codetoimage-mcp-server -e 'CODETOIMAGE_API_KEY=<your codetoimage_api_key>' -e 'CODETOIMAGE_API_URL=https://api.codetoimage.app' -- npx -y @codetoimage/mcp-server@0.2.0
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "codetoimage-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@codetoimage/mcp-server@0.2.0"
            ],
            "env": {
                "CODETOIMAGE_API_KEY": "<your codetoimage_api_key>",
                "CODETOIMAGE_API_URL": "https://api.codetoimage.app"
            }
        }
    }
}

Environment variables

  • CODETOIMAGE_API_KEY required secret API key from https://codetoimage.app/dashboard/keys (starts with cti_live_…). Sandbox tier is free.
  • CODETOIMAGE_API_URL Override the API base URL. Defaults to https://api.codetoimage.app.

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. @codetoimage/mcp-server
  2. What you get
  3. Install
  4. Usage from an agent
  5. Tool schemas
  6. Configuration
  7. Plans + limits
  8. Related
  9. License

@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.

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-server

Then 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
FieldTypeRequiredNotes
htmlstring✓*Full HTML (typically with <body>). *Not needed with template_id
cssstring–Optional CSS injected as <style>
template_iduuid✓*Saved template from the dashboard (Templates page); alternative to html
variablesobject–Values for {{placeholders}} in the template (HTML-escaped)
presetenum–Named size: og, twitter-card, facebook-post, linkedin-post, instagram-square, instagram-portrait, instagram-story, youtube-thumbnail, pinterest-pin
widthinteger 1-2048–Default 800; overrides preset
heightinteger 1-2048–Default 600; overrides preset
formatpng \jpeg \webp–Default png
qualityinteger 1-100–JPEG/WebP only
transparentboolean–PNG/WebP, paid plans
backgroundstring–e.g. #ffffff or rgb(…)

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 URL
  • format – final output format
  • expires_at – ISO timestamp (24h from render)
  • credits_remaining – your plan's quota state

Configuration

VariableDefaultPurpose
CODETOIMAGE_API_KEY–Required. Get one at codetoimage.app/dashboard/keys
CODETOIMAGE_API_URLhttps://api.codetoimage.appAPI 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

License

MIT

Frequently asked questions

What is io.github.beznazwiska/codetoimage-mcp-server?

Pixel-perfect HTML/CSS to PNG/JPG/WebP for AI agents — inline image or 24h hosted URL.

How do I install io.github.beznazwiska/codetoimage-mcp-server?

It runs on your machine. In Claude Code: claude mcp add codetoimage-mcp-server -e 'CODETOIMAGE_API_KEY=<your codetoimage_api_key>' -e 'CODETOIMAGE_API_URL=https://api.codetoimage.app' -- npx -y @codetoimage/mcp-server@0.2.0. For other clients, paste the JSON configuration from this page into their MCP settings.

Does io.github.beznazwiska/codetoimage-mcp-server need an API key?

Yes. It expects CODETOIMAGE_API_KEY, which you set in its configuration.

Is io.github.beznazwiska/codetoimage-mcp-server open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains io.github.beznazwiska/codetoimage-mcp-server?

It is published by beznazwiska. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.