A persistent, locally hosted HTML server for AI agents to render and iterate on web interfaces.
- Live Server: Hosts content on
http://localhost:17456(or next available port). - Session Persistence: Keeps the server running between tool calls.
- Incremental Edits: Allows replacing specific substrings to avoid re-sending large HTML files.
- File Sync: Mirrors current content to
canvas.htmlin the working directory for easy debugging/viewing.
npx -y html-canvas-mcpAdd this to your MCP settings file:
{
"mcpServers": {
"html-canvas": {
"command": "npx",
"args": ["-y", "html-canvas-mcp"]
}
}
}Arguments: html (string)
Starts the server with the provided content. Returns the URL.
Arguments: html (string)
Overwrites the current content entirely.
Arguments: old_text (string), new_text (string)
Finds and replaces a text fragment. Useful for small tweaks.
Returns the current full HTML string.
Stops the running HTTP server.
-
Install Dependencies:
npm install
-
Build:
npm run build
-
Run (stdio):
node build/index.js
- Base Port: Default is
17456. Automatically increments if occupied.