{
  "markdown": "# @codetoimage/mcp-server\n\nOfficial [Model Context Protocol](https://modelcontextprotocol.io) server for [codetoimage.app](https://codetoimage.app) – render HTML/CSS to PNG/JPG/WebP directly from Claude Desktop, Claude Code, Cursor, or any MCP-compatible client.\n\n## What you get\n\nTwo tools, no setup beyond an API key:\n\n- **`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.\n- **`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.\n\n## Install\n\nYou don't need to install anything globally – MCP clients can run it via `npx`. Get an API key at [codetoimage.app/dashboard/keys](https://codetoimage.app/dashboard/keys), then add the config below.\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows):\n\n```json\n{\n  \"mcpServers\": {\n    \"codetoimage\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codetoimage/mcp-server\"],\n      \"env\": {\n        \"CODETOIMAGE_API_KEY\": \"cti_live_...\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. The two tools appear in the tool picker.\n\n### Claude Code\n\n```bash\nclaude mcp add codetoimage -s user -- npx -y @codetoimage/mcp-server\n```\n\nThen set the env var in your shell profile (or pass `-e CODETOIMAGE_API_KEY=cti_live_…` in the `claude mcp add` call).\n\n### Cursor\n\nEdit `~/.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"codetoimage\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@codetoimage/mcp-server\"],\n      \"env\": {\n        \"CODETOIMAGE_API_KEY\": \"cti_live_...\"\n      }\n    }\n  }\n}\n```\n\n## Usage from an agent\n\nThe tools are self-documenting – your agent will pick the right one based on intent. Example prompts that just work:\n\n> \"Render this card as a PNG: `<div style='padding:40px;background:#6366f1;color:white;border-radius:16px'>Hello</div>` at 800×400.\"\n\n> \"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.\"\n\n> \"Take this CSS card and render it as a transparent PNG so I can use it on a dark background.\"\n\n> \"Render my saved template 3f2a91d0-... with title 'Launch day' as an Instagram story.\"\n\n## Tool schemas\n\n### `render_html_to_image`\n\n| Field | Type | Required | Notes |\n|---|---|---|---|\n| `html` | string | ✓* | Full HTML (typically with `<body>`). *Not needed with `template_id` |\n| `css` | string | – | Optional CSS injected as `<style>` |\n| `template_id` | uuid | ✓* | Saved template from the dashboard (Templates page); alternative to `html` |\n| `variables` | object | – | Values for `{{placeholders}}` in the template (HTML-escaped) |\n| `preset` | enum | – | Named size: `og`, `twitter-card`, `facebook-post`, `linkedin-post`, `instagram-square`, `instagram-portrait`, `instagram-story`, `youtube-thumbnail`, `pinterest-pin` |\n| `width` | integer 1-2048 | – | Default 800; overrides `preset` |\n| `height` | integer 1-2048 | – | Default 600; overrides `preset` |\n| `format` | `png` \\| `jpeg` \\| `webp` | – | Default `png` |\n| `quality` | integer 1-100 | – | JPEG/WebP only |\n| `transparent` | boolean | – | PNG/WebP, paid plans |\n| `background` | string | – | e.g. `#ffffff` or `rgb(…)` |\n\nReturns: image content (base64 inline), rendered in the chat.\n\n### `render_html_to_url`\n\nSame input schema as `render_html_to_image`. Returns a text block with:\n\n- `url` – temporary hosted image URL\n- `format` – final output format\n- `expires_at` – ISO timestamp (24h from render)\n- `credits_remaining` – your plan's quota state\n\n## Configuration\n\n| Variable | Default | Purpose |\n|---|---|---|\n| `CODETOIMAGE_API_KEY` | – | **Required.** Get one at [codetoimage.app/dashboard/keys](https://codetoimage.app/dashboard/keys) |\n| `CODETOIMAGE_API_URL` | `https://api.codetoimage.app` | API base URL (override for dev/proxy) |\n\n## Plans + limits\n\n- **Free** – 50 renders/month, no watermark, full features (up to 2048×2048, all formats).\n- **Paid (Starter / Hobby / Pro / Scale)** – from $9/mo for 1,000 renders up to 50,000/month, higher rate limits.\n- **Pay as you go** – prepaid credit packs from $5, valid 12 months, no subscription.\n\nPricing: [codetoimage.app/#pricing](https://codetoimage.app/#pricing)\n\n## Related\n\n- [Web dashboard + REST API](https://codetoimage.app)\n- [`@codetoimage/cli`](https://www.npmjs.com/package/@codetoimage/cli) – terminal/CI usage\n\n## License\n\nMIT\n",
  "bytes": 4643,
  "sha": "97e45bba99a5dc3666dc7c85a993413b10d5f56600ac25def2d6a44afab7d812",
  "repo_slug": "beznazwiska/codetoimage-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_beznazwiska_codetoimage_mcp_se_38b2b9aa/readme"
}