Konva.js Canvas
БесплатноНе проверенEnables 2D canvas drawing using Konva.js with tools for creating shapes, layers, groups, and exporting PNG images.
Описание
Enables 2D canvas drawing using Konva.js with tools for creating shapes, layers, groups, and exporting PNG images.
README
An MCP (Model Context Protocol) server that gives AI assistants the ability to draw on a 2D canvas using Konva.js, running headlessly on Node.js.
Architecture
Claude ←stdio→ Python MCP (FastMCP) ←HTTP→ Node.js bridge (Express + Konva)
- Python MCP server (
server/) — exposes 12 tools over stdio using FastMCP, proxies calls to the bridge. - Node.js bridge (
bridge/) — runs Konva.js headlessly via thecanvaspackage, manages canvas state, renders PNGs.
Prerequisites
Installation
# Install Node.js bridge dependencies
cd bridge
npm install
# Python dependencies are managed automatically by uv — no manual step needed
Usage
Run as MCP server (for Claude Desktop or Claude Code)
cd server
uv run python main.py
The server starts the Node.js bridge as a subprocess, waits for it to be ready, then begins accepting MCP requests over stdio.
Claude Desktop config
Add to claude_desktop_config.json:
{
"mcpServers": {
"konva-canvas": {
"command": "uv",
"args": ["run", "--directory", "/path/to/konva-mcp/server", "python", "main.py"]
}
}
}
Claude Code config (.mcp.json)
{
"mcpServers": {
"konva-canvas": {
"type": "stdio",
"command": "uv",
"args": ["run", "--directory", "/path/to/konva-mcp/server", "python", "main.py"]
}
}
}
Run the bridge standalone (for testing)
cd bridge
node server.js
The bridge listens on a random free port by default (overridable via BRIDGE_PORT env var) and prints BRIDGE_READY when ready.
Tools
| Tool | Description |
|---|---|
create_canvas |
Create a new canvas (Stage + default layer). Returns canvas_id and layer_id. |
add_layer |
Add a layer to an existing canvas. Layers render bottom-to-top. |
create_shape |
Draw a shape on a layer. See shape types below. |
update_shape |
Update position, size, color, or other attributes of a shape. |
delete_shape |
Permanently remove a shape. |
transform_shape |
Move, rotate, scale, or flip a shape. |
create_group |
Group multiple shapes into a single addressable unit. |
list_shapes |
List all shapes on a canvas, optionally filtered by layer. |
clear_layer |
Remove all shapes from a layer (layer itself remains). |
get_canvas_state |
Return the full JSON state of the canvas. |
preview_canvas |
Render the canvas and return it as an inline image for visual inspection. |
export_canvas |
Export the finished canvas as a PNG file. |
Shape types
rect, circle, ellipse, line, arrow, text, path, star, regular_polygon, wedge, ring, arc
Recommended workflow
create_canvas→ getcanvas_idandlayer_id- Add shapes with
create_shape - Call
preview_canvasafter each major section to visually inspect progress - Fix anything with
update_shapeordelete_shape - Call
export_canvaswhen the design is complete
Project structure
konva-mcp/
├── bridge/
│ ├── server.js # Express entry point
│ └── src/
│ ├── canvasManager.js # Canvas state (Map of canvas_id → Stage)
│ └── handlers/ # Action dispatcher and per-action handlers
└── server/
├── main.py # Entry point: finds free port, starts bridge, runs MCP
├── pyproject.toml
└── src/
├── mcp_server.py # FastMCP tool definitions (12 tools)
├── bridge_client.py # httpx async HTTP client
└── bridge_process.py # asyncio subprocess manager
Dependencies
Node.js bridge
konva^10.2.0 — 2D canvas librarycanvas^3.2.1 — headless Canvas API for Node.jsexpress^5.2.1 — HTTP servernanoid^5 — unique ID generation
Python MCP server
fastmcp>=3.1.0 — MCP server frameworkhttpx>=0.28.1 — async HTTP client
Установка Konva.js Canvas
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/bilaltahseen/konva-mcpFAQ
Konva.js Canvas MCP бесплатный?
Да, Konva.js Canvas MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Konva.js Canvas?
Нет, Konva.js Canvas работает без API-ключей и переменных окружения.
Konva.js Canvas — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Konva.js Canvas в Claude Desktop, Claude Code или Cursor?
Открой Konva.js Canvas на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
LibreOffice Tools
Enables AI agents to read, write, and edit Office documents via LibreOffice with token-efficient design. Supports multiple formats including DOCX, XLSX, PPTX, a
автор: passerbyflutterdannote/figma-use
Full Figma control: create shapes, text, components, set styles, auto-layout, variables, export. 80+ tools.
автор: dannoteLogo.dev
Search and retrieve company logos by brand or domain. Customize size, format, and theme to match your design needs. Accelerate design, prototyping, and content
автор: NOVA-3951Design Inspiration Server
Searches top design platforms like Dribbble and Behance to provide UI inspiration, color palettes, and layout patterns via the Serper API. It allows users to re
автор: YonasValentinCompare Konva.js Canvas with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории design
