Skip to content

Commit dc98a8c

Browse files
committed
document the mcp server
1 parent 6bfe257 commit dc98a8c

File tree

5 files changed

+301
-0
lines changed

5 files changed

+301
-0
lines changed

example-code/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ To get started quickly, take a look at our example code for generating images.
1414

1515
[Live demo](https://htmlcsstoimage.com/demo){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
1616
[Get an API Key](https://htmlcsstoimage.com){: .btn .fs-5 .mb-4 .mb-md-0 }
17+
18+
{% include hint.md title="Using an AI coding assistant?" text="Skip writing code entirely. Connect our [MCP Server](/integrations/mcp/) to generate images directly from Cursor or Claude Code." %}

getting-started/using-the-api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Generate images from HTML and CSS.
1515
[Live demo](https://htmlcsstoimage.com/demo){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
1616
[Get an API Key](https://htmlcsstoimage.com){: .btn .fs-5 .mb-4 .mb-md-0 }
1717

18+
{% include hint.md title="Using Cursor or Claude Code?" text="Generate images without writing code using our [MCP Server integration](/integrations/mcp/)." %}
19+
1820
<hr>
1921

2022
Table of contents

index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ To get started quickly, take a look at our example code.
7171

7272
Prefer #NoCode? We also integrate with **[Zapier](integrations/zapier)** and **[Make](integrations/make)**.
7373

74+
Using an AI coding assistant? Connect the **[MCP Server](/integrations/mcp/)** to generate images directly from Cursor or Claude Code.
75+
7476
{% include hint.md title="Works with any language" text="Your favorite language not here? Don't worry, we work with any language or framework. See the [curl](example-code/curl) example for how to make a request. [Email us](mailto:[email protected]) if you need help getting started. We'd love to add more example code here." %}
7577

7678
<hr>

integrations/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@ Connect the HTML/CSS to Image API to thousands of other services.
1515

1616
[Live demo](https://htmlcsstoimage.com/demo){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
1717
[Get an API Key](https://htmlcsstoimage.com){: .btn .fs-5 .mb-4 .mb-md-0 }
18+
19+
<hr>
20+
21+
## Available Integrations
22+
23+
| Integration | Description |
24+
|:------------|:------------|
25+
| **[Zapier](/integrations/zapier/)** | Connect with thousands of apps to automate image generation. |
26+
| **[Make](/integrations/make/)** | Build powerful automation workflows with Make (formerly Integromat). |
27+
| **[MCP Server](/integrations/mcp/)** | Generate images from AI assistants like Cursor, Claude, Windsurf, Cline, Zed, and OpenCode. |

integrations/mcp.md

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
---
2+
layout: page
3+
title: MCP Server
4+
permalink: /integrations/mcp/
5+
parent: Integrations
6+
nav_order: 4
7+
description: >-
8+
Use the HTML/CSS to Image MCP server to generate images directly from AI assistants like Cursor, Claude, Windsurf, Cline, Zed, and OpenCode.
9+
---
10+
# MCP Server Integration
11+
{: .no_toc }
12+
{: .fs-9 }
13+
14+
Generate images with AI assistants using the Model Context Protocol.
15+
{: .fs-4 .fw-300 }
16+
17+
[Get an API Key](https://htmlcsstoimage.com){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 target="_blank" }
18+
<hr>
19+
20+
Table of contents
21+
{: .text-delta }
22+
- TOC
23+
{:toc}
24+
25+
## What is MCP?
26+
27+
The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard that allows AI assistants to connect to external tools and services. With our MCP server, you can generate images directly from your AI coding assistant without writing any code.
28+
29+
Simply describe what you want, and the AI will use the HTML/CSS to Image API to create it for you.
30+
31+
**MCP Server URL:** `mcp.hcti.io`
32+
33+
## Available Tools
34+
35+
The MCP server provides the following tools:
36+
37+
### Image Creation
38+
39+
| Tool | Description |
40+
|:-----|:------------|
41+
| **create_image** | Generate an image from HTML and CSS. Supports all standard parameters like `device_scale`, `viewport_width`, `viewport_height`, `ms_delay`, and more. |
42+
| **create_url_image** | Take a screenshot of any public URL. Includes options for selectors, viewport settings, and cookie banner blocking. |
43+
| **create_templated_image** | Generate an image using a saved template. Pass `template_id` and `template_values` to substitute variables in your template. |
44+
| **create_batch_images** | Create up to 25 images in a single request. Set `default_options` and provide `variations` for each image. |
45+
| **get_max_batch_size** | Check the maximum number of images you can create in a single batch based on your plan. |
46+
47+
### Template Management
48+
49+
| Tool | Description |
50+
|:-----|:------------|
51+
| **create_template** | Save a reusable HTML/CSS template for generating images with variable substitution. |
52+
| **update_template** | Modify an existing template by providing the `template_id` and new content. |
53+
| **list_templates** | View all saved templates in your account. Returns up to 100 templates per request. |
54+
| **list_template_versions** | View the version history of a specific template. |
55+
56+
## Authentication
57+
58+
The MCP server uses OAuth for authentication. When you first connect, your browser will open automatically to authorize access to your HTML/CSS to Image account. No manual credential configuration is required.
59+
60+
## Setup for Cursor
61+
62+
To use the HTML/CSS to Image MCP server in Cursor, add the following configuration to your `.cursor/mcp.json` file:
63+
64+
```json
65+
{
66+
"mcpServers": {
67+
"hcti": {
68+
"type": "http",
69+
"url": "https://mcp.hcti.io"
70+
}
71+
}
72+
}
73+
```
74+
75+
Restart Cursor after saving the configuration. The first time you use the server, you'll be prompted to authorize access via your browser.
76+
77+
## Setup for Claude Code
78+
79+
To use the MCP server with Claude Code, run the following command:
80+
81+
```bash
82+
claude mcp add hcti --transport http https://mcp.hcti.io
83+
```
84+
85+
To verify the server was added:
86+
87+
```bash
88+
claude mcp list
89+
```
90+
91+
The first time you use the server, you'll be prompted to authorize access via your browser.
92+
93+
## Setup for Claude Desktop
94+
95+
Claude Desktop (the standalone app) also supports MCP servers. Edit your Claude Desktop configuration file:
96+
97+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
98+
99+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
100+
101+
Add the following configuration:
102+
103+
```json
104+
{
105+
"mcpServers": {
106+
"hcti": {
107+
"command": "npx",
108+
"args": ["-y", "mcp-remote", "https://mcp.hcti.io"]
109+
}
110+
}
111+
}
112+
```
113+
114+
Restart Claude Desktop after saving the configuration. The first time you use the server, you'll be prompted to authorize access via your browser.
115+
116+
## Setup for Windsurf
117+
118+
[Windsurf](https://codeium.com/windsurf) (by Codeium) supports MCP servers. Add the following to your `~/.codeium/windsurf/mcp_config.json` file:
119+
120+
```json
121+
{
122+
"mcpServers": {
123+
"hcti": {
124+
"serverUrl": "https://mcp.hcti.io"
125+
}
126+
}
127+
}
128+
```
129+
130+
Restart Windsurf after updating the configuration. The first time you use the server, you'll be prompted to authorize access via your browser.
131+
132+
## Setup for Cline (VS Code)
133+
134+
[Cline](https://github.com/cline/cline) is a popular autonomous coding agent for VS Code. To add the MCP server:
135+
136+
1. Open VS Code and go to **Cline Settings**
137+
2. Navigate to **MCP Servers**
138+
3. Click **Add Server** and configure:
139+
140+
```json
141+
{
142+
"hcti": {
143+
"url": "https://mcp.hcti.io"
144+
}
145+
}
146+
```
147+
148+
Alternatively, edit your Cline MCP settings file directly at `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`.
149+
150+
The first time you use the server, you'll be prompted to authorize access via your browser.
151+
152+
## Setup for Zed
153+
154+
[Zed](https://zed.dev) is a high-performance code editor with AI features. Add the MCP server to your Zed settings (`~/.config/zed/settings.json`):
155+
156+
```json
157+
{
158+
"context_servers": {
159+
"hcti": {
160+
"command": "npx",
161+
"args": ["-y", "mcp-remote", "https://mcp.hcti.io"]
162+
}
163+
}
164+
}
165+
```
166+
167+
The first time you use the server, you'll be prompted to authorize access via your browser.
168+
169+
## Setup for OpenCode
170+
171+
[OpenCode](https://opencode.ai) is an open-source AI coding assistant. Add the MCP server to your `opencode.json` configuration file:
172+
173+
```json
174+
{
175+
"mcp": {
176+
"hcti": {
177+
"type": "remote",
178+
"url": "https://mcp.hcti.io",
179+
"enabled": true
180+
}
181+
}
182+
}
183+
```
184+
185+
Alternatively, add it via the command line:
186+
187+
```bash
188+
opencode mcp add
189+
```
190+
191+
The first time you use the server, you'll be prompted to authorize access via your browser.
192+
193+
## Automation Platforms
194+
195+
You can also use the MCP server with automation platforms:
196+
197+
### Zapier
198+
199+
Zapier has a dedicated MCP Client that connects to MCP servers. This lets you use the HTML/CSS to Image MCP server within Zapier workflows without writing code.
200+
201+
[Zapier MCP Client Integration](https://zapier.com/apps/mcp-client-by-zapier/integrations){: .btn .fs-5 .mb-4 .mb-md-0 target="_blank" }
202+
203+
### Pipedream
204+
205+
Pipedream supports MCP servers for building serverless workflows. Connect the HTML/CSS to Image MCP server to automate image generation in your Pipedream workflows.
206+
207+
[Pipedream MCP Integration](https://mcp.pipedream.com/app/html_css_to_image){: .btn .fs-5 .mb-4 .mb-md-0 target="_blank" }
208+
209+
## Example Prompts
210+
211+
Once configured, you can ask your AI assistant to generate images naturally. Here are some examples:
212+
213+
### Create an Image from HTML
214+
215+
> "Create an image of a blue button that says 'Subscribe Now' with rounded corners and a subtle shadow"
216+
217+
The AI will generate the HTML/CSS and use the `create_image` tool to render it.
218+
219+
### Screenshot a Website
220+
221+
> "Take a screenshot of https://stripe.com with device_scale set to 2 for high resolution"
222+
223+
### Screenshot a Specific Element
224+
225+
> "Screenshot the pricing table on https://example.com/pricing using the selector '.pricing-grid'"
226+
227+
### Generate Social Media Images
228+
229+
> "Create a Twitter/X card image with a gradient background, the title 'Launching Soon', and our logo"
230+
231+
### Batch Create Images
232+
233+
> "Create 10 variations of a product card image, each with a different background color"
234+
235+
### Work with Templates
236+
237+
> "List my saved templates"
238+
239+
> "Create an image using my 'social-card' template with the title set to 'New Feature Release'"
240+
241+
> "Save this HTML/CSS as a template called 'blog-header' so I can reuse it"
242+
243+
## Image Parameters
244+
245+
When creating images, the main parameters are:
246+
247+
| Parameter | Type | Description |
248+
|:----------|:-----|:------------|
249+
| **html** | `String` | The HTML content to render. Required for `create_image`. |
250+
| **css** | `String` | CSS styles for your HTML. |
251+
| **url** | `String` | The URL to screenshot. Required for `create_url_image`. |
252+
253+
### Additional Parameters
254+
255+
{% include additional_parameters.md %}
256+
257+
## Troubleshooting
258+
259+
### Authentication Errors
260+
261+
If you receive authentication errors:
262+
- Try disconnecting and reconnecting the MCP server to trigger a new OAuth flow
263+
- Ensure you're logged into the correct HTML/CSS to Image account in your browser
264+
- Check that pop-ups are not blocked when the OAuth window tries to open
265+
266+
### Connection Issues
267+
268+
If the MCP server is not connecting:
269+
- Ensure your network allows outbound HTTPS connections
270+
- Check that the URL is exactly `https://mcp.hcti.io`
271+
- Restart your AI assistant after updating the configuration
272+
273+
### Image Generation Errors
274+
275+
If images fail to generate:
276+
- Check your account has available renders on the [dashboard](https://htmlcsstoimage.com/dashboard)
277+
- Ensure HTML content is valid
278+
- For URL screenshots, verify the URL is publicly accessible
279+
280+
## Need Help?
281+
282+
We're happy to help you get started with the MCP server. Send us an email: **[email protected]**
283+
284+
{% include code_footer.md version=1 %}
285+

0 commit comments

Comments
 (0)