npm @codetoimage/mcp-serverstdioupdated 1mo ago
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 can you do with codetoimage mcp server?
@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
| Field | Type | Required | Notes |
|---|---|---|---|
html |
string | ✓* | Full HTML (typically with <body>). *Not needed with template_id |
css |
string | – | Optional CSS injected as <style> |
template_id |
uuid | ✓* | Saved template from the dashboard (Templates page); alternative to html |
variables |
object | – | Values for {{placeholders}} in the template (HTML-escaped) |
preset |
enum | – | Named size: og, twitter-card, facebook-post, linkedin-post, instagram-square, instagram-portrait, instagram-story, youtube-thumbnail, pinterest-pin |
width |
integer 1-2048 | – | Default 800; overrides preset |
height |
integer 1-2048 | – | Default 600; overrides preset |
format |
png | jpeg | webp |
– | Default png |
quality |
integer 1-100 | – | JPEG/WebP only |
transparent |
boolean | – | PNG/WebP, paid plans |
background |
string | – | 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 URLformat– final output formatexpires_at– ISO timestamp (24h from render)credits_remaining– your plan's quota state
Configuration
| Variable | Default | Purpose |
|---|---|---|
CODETOIMAGE_API_KEY |
– | Required. Get one at codetoimage.app/dashboard/keys |
CODETOIMAGE_API_URL |
https://api.codetoimage.app |
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
- Web dashboard + REST API
@codetoimage/cli– terminal/CI usage
License
MIT
Install
Add codetoimage mcp server to your client. Pick the one you use.
claude mcp add mcp-server -- npx -y @codetoimage/mcp-servercodex mcp add mcp-server -- npx -y @codetoimage/mcp-serveramp mcp add mcp-server -- npx -y @codetoimage/mcp-server{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"mcp-server","command":"npx","args":["-y","@codetoimage/mcp-server"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"mcp-server": {
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"mcp-server": {
"type": "local",
"command": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"mcp-server": {
"command": {
"path": "npx",
"args": [
"-y",
"@codetoimage/mcp-server"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y @codetoimage/mcp-serverRun `goose configure`, choose **Add Extension → Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance16/25
- Trust6/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 52 days ago
- Has a release history
- Repository is not archived
- No licence detected
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint — no local install
Version history
| Versions | Published |
|---|---|
| 0.2.0Latest | Jul 11, 2026 |
| 0.1.2 | May 28, 2026 |