drawing-mcp
MCP経由でAIエージェントが利用できる、Procreateに着想を得たペイントスタジオ。25種類のブラシ、RGBAレイヤー、筆圧、対称描画、ブラウザーでのライブプレビュー、レイヤー構造を保持したSVGエクスポート、アニメーション、グローバルタイポグラフィに対応(依存関係ゼロ)。
ドキュメント
🎨 drawing-mcp
Give your agents a canvas and a brush.
Nine 1024×1024 pictures, each painted stroke by stroke by an agent through drawing-mcp · see the prompts
Layers, pressure, a palette and undo — the same tools people draw with.
Watch it paint stroke by stroke, then export PNG, SVG, stickers or video.
Works with Claude · Codex · Antigravity · Grok · Muse · OpenClaw · Hermes — and any MCP client
Quick Start · Showcase · Why drawing-mcp? · How It Works · Brushes · Tools · Benchmark · License
Why drawing-mcp?
When people draw, they don't get the picture in one go. They sketch, block in color, add detail on a new layer, step back, and fix what looks off. drawing-mcp started from a simple idea: let an agent use a drawing app the way a person does. Every brush stroke is a tool call you can watch, point at, and undo — so the finished piece comes with editable layers and a replayable history, not just pixels.
| 🖌️ Real Studio Brushes & Pressure | 25 painterly brushes (ink, oil, watercolor, charcoal, neon, smudge…) with [x, y, pressure] curves and symmetry guides. Shapes are painted by hand, not stamped. |
| 👀 Live Preview & Visual Feedback | Every stroke streams live to a browser canvas over SSE. Click a spot or drag a box to leave feedback; the agent fixes it and returns before/after crops. |
| 📐 Pure Vector SVG & Global Text | Export layered, zero-raster scalable SVGs (save_svg, live /canvas.svg) and render typography in any script — Latin, CJK, Arabic/RTL, Hindi, Thai, Cyrillic, Greek & Emoji. |
| ✨ Lighting, Textures & 3D Pose Guides | Paint luminous additive glows, beams, halos & lens flares (draw_light), FBM organic textures (draw_texture), seeded petals/snow/rain/bokeh/branches and anime cumulus clouds (draw_scatter), and 3D-to-2D articulated character mannequin guides (set_pose_guide). |
| 🎬 Frame Animation & 2K Video | Build multi-layer animations with tween_frames (punchy easings, motion trails, camera shake), per-frame durationMs holds, onion skinning, and allFrames effects. Export transparent WebP/APNG stickers, looping GIFs, or 2K H.264 MP4 shorts. |
| ⚡ Zero Runtime Dependencies | Plain ES modules on Node ≥ 18 with pure-JS PNG, APNG, GIF & SVG encoders. Only optional ffmpeg (MP4) and img2webp (WebP). |
| 🔌 Works With Any MCP Client | Plug into Claude, Codex, Antigravity, Grok, Muse, OpenClaw, Hermes, Cursor, or any other Model Context Protocol host. |
Quick start
git clone https://github.com/gogoymh/drawing-mcp.git
Claude Code · Codex
claude mcp add drawing -- node /path/to/drawing-mcp/src/server.js
codex mcp add drawing -- node /path/to/drawing-mcp/src/server.js
Antigravity · Grok · Muse · OpenClaw · Hermes · any MCP client
Add the server to the agent's MCP config:
{
"mcpServers": {
"drawing": {
"command": "node",
"args": ["/path/to/drawing-mcp/src/server.js"]
}
}
}
[!TIP] Try your first prompt: "Paint a cozy red fox asleep in fresh snow under a pine tree at dusk, and save it as both PNG and SVG."
The built-in
drawprompt guides the agent through layers, lighting, self-critique withview_canvas, and export.
Showcase
Every artwork below was painted directly by an agent through drawing-mcp tool calls — no scripts, no image-gen models, no post-processing. Unless a model is named, the painter was Claude Fable 5.2 in Claude Code.
1. Scalable Vector SVG & Global Unicode Typography
[!TIP] Prompts used
- Native vector SVG (
save_svg): "Paint a symmetrical glowing golden luna moth hovering above a blooming pink lotus flower under a crescent moon and stars, Art Nouveau botanical style — export as pure layered vector SVG."- Global typography (
draw_text): "Design a gallery-quality Global Art Studio poster with a painterly aurora backdrop and crisp multilingual typography across Latin diacritics, Korean, Japanese, Chinese, Arabic (RTL), Hindi, Thai, Cyrillic, Greek & Emoji."
Native Vector SVG (save_svg) | Global Unicode Typography (draw_text) |
|---|---|
![]() 768×768 · 17 layers · 245 vector paths · 36 gradients · 0 raster vector-studio.svg · png | ![]() 960×540 · 11 layers · live <text> in Latin, CJK, Arabic RTL, Hindi, Thai, Cyrillic, Greek & Emoji · 0 rasterglobal-typography.svg · png |
2. Animated Stickers (360×360 Transparent WebP & APNG)
[!TIP] Prompts used
01-cheer: "Paint a fluffy, expressive hand-drawn watercolor & ink Red Fox cub cheering joyfully — organic variable-pressure brush strokes, seamless 24-frame loop at 12 fps with a crisp white sticker halo."02-heart: "Paint a fluffy, expressive hand-drawn watercolor & ink Red Fox cub hugging a hand-painted glowing heart — organic brush strokes, seamless 24-frame loop with a crisp white sticker halo."03-sleepy: "Paint a fluffy hand-drawn watercolor & ink Red Fox cub curled up asleep on a cozy leaf cushion with a breathing sleep bubble and floating Zzz — seamless 24-frame loop with a white sticker halo."
webp · apng | webp · apng | webp · apng |
360×360 · transparent RGBA · WebP (≤ 650 KB) & APNG · 24 frames · 12 fps · 2 s · ready for Telegram, LINE, Discord, WhatsApp & KakaoTalk
3. Animated Short (2K Vertical Video · 9:16 MP4)
[!TIP] Prompt used "Paint a 2K vertical looping animation: glowing paper sky lanterns and fireflies drifting upward over a moonlit mountain lake with a hand-painted wooden boat gently rocking on shimmering water — painterly night illustration, 120 frames at 24 fps, seamless 5-second loop."
Watch full 2K MP4 (reel.mp4) · 1440×2560 (9:16) · H.264 · 24 fps · 120 frames · 5 s · ready for YouTube Shorts, Instagram Reels & TikTok
4. Anime Illustration Timelapse (one prompt, two models)
[!TIP] Same prompt, two models. Both agents got only "Try drawing something in Japanese anime style." and painted through
drawing-mcp; every step was recorded withDRAWING_MCP_RECORD.
| Gemini 4 Neon · Antigravity | Claude Fable 5.2 · Claude Code |
|---|---|
![]() | ![]() |
| 768×1024 · 351 steps · 15 tool calls · gif · png | 1280×720 · 212 steps · 29 tool calls · gif · png |
5. 256×256 Quick Gallery

Rebuild this gallery with node bench/run.js --agent claude --judge claude then node bench/examples.js bench/results/<run> --gif-only; the hero grid takes --queries bench/queries-hard.json --size 1024 and --out examples/hard --block hard --cell 384 --clips --hero.
How it works
flowchart LR
U["You (Prompt)"] --> A["AI Agent"]
A -- "MCP tools (stroke, layers, symmetry, tween)" --> S["drawing-mcp Studio"]
S -- "Live SSE updates + /canvas.svg" --> P["Browser Live Preview"]
P -- "Click / drag box comments" --> F["get_feedback / resolve_feedback"]
F --> A
S -- "PNG · SVG · WebP · APNG · GIF · 2K MP4" --> O["Finished Artwork"]
- Set the stage.
new_canvasnever stops to ask: leave out the size and it opens a 512×512 canvas. - Watch live.
new_canvasreturns a local browser URL (http://127.0.0.1:<port>/) showing every stroke over SSE, the layer stack, active brush, and live/canvas.svg. - Paint in layers. Background, rough forms, details, and lighting — with 25 brushes, pressure curves, symmetry & 3D pose guides, additive lighting, procedural textures, seeded scatter, alpha lock, clipping masks, and 17 blend modes.
- Critique & refine.
view_canvasreturns a PNG (with optionalcrop,grid,guides,onionSkin, orsheet) so the agent inspects its own work and refines witherase,adjust_layer,undo/redo. It never paints blind: after every 8 painting steps without a full look, and on export of unseen changes, the whole picture is attached to the reply at full resolution. - Point & collaborate. Click a spot or drag a box on the live preview to leave a comment. The agent reads it with
get_feedback, fixes it, and resolves it withresolve_feedback— complete with before/after crops and a Reopen flow. - Export anywhere.
save_canvas(PNG),save_svg(layered scalable SVG),save_animation(WebP / APNG / GIF),save_video(H.264 MP4), orsave_timelapse(GIF).
Live preview & environment variables
| Variable | Effect |
|---|---|
DRAWING_MCP_PREVIEW=0 | Disable the local live preview server |
DRAWING_MCP_AUTO_VIEW=8 | Painting steps between forced full-resolution views (0 turns it off) |
DRAWING_MCP_PREVIEW_PORT=4777 | Pin the preview port (default: automatic free port) |
DRAWING_MCP_RECORD=/some/dir | Record every drawing step to /some/dir/frames/ as numbered PNGs |
DRAWING_MCP_FFMPEG=/path/to/ffmpeg | Custom ffmpeg binary for save_video (default: ffmpeg on PATH) |
DRAWING_MCP_IMG2WEBP=/path/to/img2webp | Custom img2webp binary for .webp in save_animation (default: img2webp on PATH) |
DRAWING_MCP_RSVG=/path/to/rsvg-convert | Optional rsvg-convert (Pango/HarfBuzz) path for Unicode draw_text on Linux |
DRAWING_MCP_TEXT_ENGINE=vector | Force pure-JS fallback vector text instead of OS native text shaping |
Brushes
25 expressive brushes across five families — all supporting inline size, opacity, hardness, taper, pressureOpacity, nib angle, and per-point [x, y, pressure] sensitivity.
Lines
| Sample | Brush | Feel |
|---|---|---|
![]() | pencil | Hard 1px line without anti-aliasing. Outlines and sketches. |
pixel | Square, aliased tip that fills whole pixels. Pixel art. | |
![]() | pen | Crisp anti-aliased ink line. |
![]() | ink | Ink brush that swells in the middle and thins to points at both ends. Hair, leaves, expressive lines. |
![]() | calligraphy | Flat nib at an angle: thick and thin strokes by direction. Lettering, elegant lines. |
![]() | dashed | Dashed line. Seams, paths, cut lines, motion. |
![]() | dotted | Row of round dots. Stitches, bead strings, trails. |
Paint
| Sample | Brush | Feel |
|---|---|---|
![]() | marker | Wide translucent stroke. Overlap within one stroke does not darken. |
![]() | highlighter | Chisel tip, very translucent. Glazes and color washes. |
![]() | brush | Soft-edged paint brush. |
![]() | oil | Thick paint with visible bristle streaks. Fur, wood, grass, painterly texture. |
![]() | dry_brush | Bristles that run out of paint and break up toward the end. Bark, rough stone, weathered surfaces. |
![]() | watercolor | Soft wash with a darker drying rim. Layer it for depth. |
![]() | crayon | Waxy stroke that skips over paper grain. |
![]() | charcoal | Dark, smudgy, heavily textured. Shading and drama. |
Effects
| Sample | Brush | Feel |
|---|---|---|
![]() | airbrush | Speckled soft spray for shading and gradients. |
![]() | splatter | Paint droplets flung around the path. Splashes, dirt, rain, texture. |
![]() | sparkle | Four-pointed stars along the path. Glints, stars, magic. |
![]() | neon | Bright white-hot core with a colored glow around it. Lights, signs, lasers. Best on dark backgrounds. |
![]() | rainbow | Six color bands side by side, red to purple. Ignores the selected color. |
Blend
| Sample | Brush | Feel |
|---|---|---|
![]() | smudge | Drags the paint already on the layer along the stroke. Soften edges, blend colors, smoke. |
![]() | blur | Blurs the paint under the stroke. Soft shadows, depth of field, smooth gradients. |
Erasers
| Sample | Brush | Feel |
|---|---|---|
![]() | eraser | Removes paint: transparent on upper layers, the background color on the background layer. With fill it clears an area. |
![]() | soft_eraser | Soft, partial eraser that fades paint out. Lighten or feather edges. |
pixel_eraser | Square, aliased eraser that clears whole pixels. Pixel art cleanup. |
Colors: Built-in palette names (red, sky, skin, …), custom swatches saved via manage_palette / pick_color, #rgb, #rrggbb, #rrggbbaa, rgba(r, g, b, a), hsl(h, s%, l%) / hsla(h, s%, l%, a), or [r, g, b, a].
Tools
49 focused MCP tools covering the complete digital painting, lighting, procedural atmosphere, animation, collaboration, and export workflow.
| Category | Tools |
|---|---|
| Canvas & Animation | new_canvas · load_image · transform_canvas · new_animation · select_frame · next_frame · tween_frames · batch |
| Brushes, Lighting, Atmosphere & Guides | stroke · draw_gradient · draw_light · draw_texture · draw_scatter · draw_text · fill · erase · select_brush · select_color · pick_color · get_palette · manage_palette · set_symmetry · set_pose_guide · set_selection |
| Layers & Adjustments | add_layer · set_layer · select_layer · list_layers · get_layer · move_layer · duplicate_layer · copy_layer · transform_layer · merge_layers · delete_layer · layer_effect · adjust_layer · get_pixel · undo · redo |
| Inspect & Feedback | view_canvas · get_feedback · resolve_feedback |
| Export | save_canvas · save_svg · save_frames · save_animation · save_video · save_timelapse |
📖 Full 49-tool reference
| Tool | What it does |
|---|---|
new_canvas / load_image | Create an empty RGBA canvas (defaults to 512×512) / load an existing PNG as a canvas or layer |
transform_canvas | Canvas actions: flip horizontal/vertical, rotate 90/180/270°, crop, or resize (scale artwork or canvas bounds) |
new_animation | Frame-by-frame mode: e.g. 24 or 30 frames at 12–30 fps, each frame its own layered canvas |
select_frame / next_frame | Switch to a frame (copyFrom, clearLayers, per-frame durationMs hold timing) / advance to the next frame carrying unchanged layers forward |
tween_frames | Interpolate a layer across startFrame..endFrame with expressive easings (ease_out_quart, ease_out_expo, ease_out_back, ease_out_bounce, bump, ping_pong, sine), optional fading motion trail afterimages, and deterministic camera shake (seamless, wrap) |
batch | Run many drawing, layer or frame steps in one call to cut round-trips |
get_palette / manage_palette | Inspect brushes/state; save custom named swatches, mix colors, generate painter color harmonies (shading, hue_shifted, complementary, …), and load curated shading & lighting color ramps (fire, sunset, ice, sakura, twilight, skin_warm, …) |
select_brush / select_color / pick_color | Choose default brush/color, or eyedropper-sample (x, y) (with optional radius average) from the canvas or a layer |
set_symmetry | Symmetry guide (vertical, horizontal, quadrant, radial + kaleidoscope mirror) |
set_pose_guide | 3D-to-2D articulated character mannequin & proportion guide (realistic, anime, chibi, 10 poses, yaw, lean, crouch, 2-bone IK hand/foot targets); returns projected 2D joint coordinates, overlays in view_canvas({ guides: true }), or stamps onto a draft layer |
set_selection | Selection mask (shape, fromLayer, magicWand, feather, add/subtract/intersect, invert, clear) |
stroke | Drag a brush through [x, y] or pressure-sensitive [x, y, pressure] points (smooth splines with sharp corners where a point is given twice, closed loops, quadratic/cubic Beziers, multi-stroke batches), or once around a shape (ellipse, rectangle, rounded rectangle, arc); outline inks the stroke and join merges it into paint already there |
draw_gradient | Multi-stop smooth linear or radial gradient, or one flat color, across the canvas or clipped inside a shape (smooth polygons keep a sharp corner where a vertex is given twice) |
draw_light | Luminous painterly lighting (pool, beam, ring, sparkle, flare) with add/screen/normal blending, symmetry, and selection support |
draw_texture | Deterministic FBM procedural organic textures (clouds, watercolor, grain, wood, marble, foliage, ripples) with optional tileable seamless wrapping and shape clipping |
draw_scatter | Deterministic seeded organic scatter & branching (petals, leaves, snow, rain, sparks, bubbles, stars, bokeh, dust, branch lightning/twigs/cracks, cloud one-call anime cumulus with lit crown and shaded base, as a dome or filling the shape outline you give it) |
draw_text | Global Unicode typography — renders any language & script (Latin, CJK, Arabic/RTL, Indic, Thai, Cyrillic, Greek, Emoji) with sans, round, bold, serif, mono, pixel, custom fontFamily, alignment, wrapping, rotation, and sticker outlineColor |
fill | Paint bucket with tolerance, referenceLayer / sampleAll lineart coloring, expand anti-alias gap fill, closeGaps for outlines whose lines do not quite meet, and a warning when the paint spills to the canvas edges |
erase | Erase a path (smooth/curve/pressure), a shape, or a whole layer in one call; the selected brush and color stay |
layer_effect / adjust_layer | Euclidean sticker outline, drop shadow, and outer glow (allFrames: true, replace to redraw a line layer after the part changed); adjustments (hue, saturation, lightness, brightness, contrast, temperature, Gaussian blur, noise, grayscale, invert, posterize, smooth gradientMap, allFrames) |
get_pixel | Read one RGBA pixel of the picture or of one layer |
add_layer / set_layer | Add or update layers: visibility, opacity, rename, 17 blendModes (normal, multiply, screen, overlay, add, darken, lighten, color_dodge, color_burn, soft_light, hard_light, difference, exclusion, hue, saturation, color, luminosity), alphaLock, clipToBelow |
move_layer / duplicate_layer | Reorder layers (up, down, top, bottom, above, below, index) / duplicate a layer with pixels, vector ops, and flags |
select_layer / list_layers / get_layer | Pick active layer / list stack / inspect held strokes and bounds |
copy_layer / transform_layer | Copy layers across frames / shift, scale, flipX/flipY, rotate or edge-wrap held strokes without blur |
merge_layers / delete_layer | Merge down (all: true to flatten) / drop a layer |
undo / redo | Step backward or forward (up to 30 levels, layer & canvas actions included) |
view_canvas | View picture or one layer as PNG, with crop zoom, coordinate grid, symmetry/selection/pose guides, animation onionSkin, multi-frame sheet, or side-by-side compare with a reference (same crop and grid on both halves; referenceOnly shows just the reference) |
save_canvas / save_svg | Write flattened PNG (or .svg automatically) / export scalable layered vector SVG (`mode: auto |
save_frames / save_animation | Write numbered RGBA PNGs / animated WebP (.webp), looping APNG (.png), or animated GIF (.gif) |
save_video | Write the animation as an H.264 MP4 for Shorts, Reels and TikTok (loops, scale, background, optional audio muxing; needs ffmpeg) |
save_timelapse | Write the whole process, blank canvas to last stroke, as an animated GIF |
get_feedback | Read the user's preview comments with their coordinates, plus the canvas with each spot outlined |
resolve_feedback | Mark comments handled, with an optional reply; the page shows a before/after crop and a Reopen button that asks for a reason |
Benchmark: watch an agent paint
Compare AI models head to head on the same drawing prompts — every stroke is recorded into per-query timelapse GIFs, stats, and a side-by-side HTML report.
node bench/run.js --agent claude --query "a red apple on a wooden table"
node bench/run.js --agent codex --queries bench/queries.json --parallel 4
node bench/run.js --agent "gemini --mcp-config {mcp_config} -p {prompt}" # any CLI
node bench/run.js --agent claude --agent codex --judge claude # score and compare
node bench/run.js --rejudge bench/results/<run> --judge codex # rescore, no redraw
- Each query produces
timelapse.gif,final.png,calls.jsonl(every tool call), andstats.json(time, tool calls, steps, % painted, colors, errors, cost), aggregated intoindex.html. --agent scriptedpaints a deterministic scene without an LLM to validate the pipeline.--judge claude|codex|"cmd {image} {query}"runs a vision judge (1–10 + one-line reason) intoresults.jsonandindex.html;--rejudgerescores existingfinal.pngoutputs without redrawing and computes inter-judge agreement.
Develop & Contributing
npm test
Logs go to stderr; stdout carries only JSON-RPC. See CONTRIBUTING.md for architecture notes and PR guidelines.
License
Released under the MIT License © 2026 gogoymh.



























