drawing-mcp

Studio vẽ lấy cảm hứng từ Procreate dành cho các tác nhân AI qua MCP, với 25 cọ vẽ, các lớp RGBA, lực nhấn, đối xứng, xem trước trực tiếp trên trình duyệt, xuất SVG nhiều lớp, hoạt ảnh và kiểu chữ toàn cục (không có phụ thuộc).

Tài liệu

🎨 drawing-mcp

Give your agents a canvas and a brush.

Nine 1024x1024 illustrations painted stroke by stroke by an AI agent

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.

License: MIT Node.js >= 18 Zero Dependencies MCP Tools Brushes

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 & Pressure25 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 FeedbackEvery 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 TextExport 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 GuidesPaint 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 VideoBuild 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 DependenciesPlain ES modules on Node ≥ 18 with pure-JS PNG, APNG, GIF & SVG encoders. Only optional ffmpeg (MP4) and img2webp (WebP).
🔌 Works With Any MCP ClientPlug 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 draw prompt guides the agent through layers, lighting, self-critique with view_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)
Symmetrical golden luna moth over a blooming lotus under a crescent moon, exported as pure vector SVG
768×768 · 17 layers · 245 vector paths · 36 gradients · 0 raster
vector-studio.svg · png
Aurora poster with an index of Latin, Korean, Japanese, Chinese, Arabic RTL, Hindi, Thai, Cyrillic, Greek and Emoji text
960×540 · 11 layers · live <text> in Latin, CJK, Arabic RTL, Hindi, Thai, Cyrillic, Greek & Emoji · 0 raster
global-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."
Hand-drawn watercolor and ink Red Fox cub cheering with both arms up among stars and confetti
webp · apng
Hand-drawn watercolor and ink Red Fox cub hugging a pulsing heart
webp · apng
Hand-drawn watercolor and ink Red Fox cub asleep on a leaf with a sleep bubble and floating Zzz
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."

Paper sky lanterns and fireflies rising over a moonlit mountain lake with a rocking wooden boat

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 with DRAWING_MCP_RECORD.

Gemini 4 Neon · AntigravityClaude Fable 5.2 · Claude Code
Timelapse of an anime girl in a sailor uniform with wind-blown hair at sunset, painted stroke by strokeTimelapse of an anime girl in a sailor uniform before a summer cumulus cloud and the sea, painted stroke by stroke
768×1024 · 351 steps · 15 tool calls · gif · png1280×720 · 212 steps · 29 tool calls · gif · png

5. 256×256 Quick Gallery

Timelapse of 9 256x256 drawings, each painted stroke by stroke by an agent

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"]
  1. Set the stage. new_canvas never stops to ask: leave out the size and it opens a 512×512 canvas.
  2. Watch live. new_canvas returns a local browser URL (http://127.0.0.1:<port>/) showing every stroke over SSE, the layer stack, active brush, and live /canvas.svg.
  3. 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.
  4. Critique & refine. view_canvas returns a PNG (with optional crop, grid, guides, onionSkin, or sheet) so the agent inspects its own work and refines with erase, 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.
  5. 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 with resolve_feedback — complete with before/after crops and a Reopen flow.
  6. Export anywhere. save_canvas (PNG), save_svg (layered scalable SVG), save_animation (WebP / APNG / GIF), save_video (H.264 MP4), or save_timelapse (GIF).

Live preview & environment variables

VariableEffect
DRAWING_MCP_PREVIEW=0Disable the local live preview server
DRAWING_MCP_AUTO_VIEW=8Painting steps between forced full-resolution views (0 turns it off)
DRAWING_MCP_PREVIEW_PORT=4777Pin the preview port (default: automatic free port)
DRAWING_MCP_RECORD=/some/dirRecord every drawing step to /some/dir/frames/ as numbered PNGs
DRAWING_MCP_FFMPEG=/path/to/ffmpegCustom ffmpeg binary for save_video (default: ffmpeg on PATH)
DRAWING_MCP_IMG2WEBP=/path/to/img2webpCustom img2webp binary for .webp in save_animation (default: img2webp on PATH)
DRAWING_MCP_RSVG=/path/to/rsvg-convertOptional rsvg-convert (Pango/HarfBuzz) path for Unicode draw_text on Linux
DRAWING_MCP_TEXT_ENGINE=vectorForce 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

SampleBrushFeel
pencil brush samplepencilHard 1px line without anti-aliasing. Outlines and sketches.
pixel brush samplepixelSquare, aliased tip that fills whole pixels. Pixel art.
pen brush samplepenCrisp anti-aliased ink line.
ink brush sampleinkInk brush that swells in the middle and thins to points at both ends. Hair, leaves, expressive lines.
calligraphy brush samplecalligraphyFlat nib at an angle: thick and thin strokes by direction. Lettering, elegant lines.
dashed brush sampledashedDashed line. Seams, paths, cut lines, motion.
dotted brush sampledottedRow of round dots. Stitches, bead strings, trails.

Paint

SampleBrushFeel
marker brush samplemarkerWide translucent stroke. Overlap within one stroke does not darken.
highlighter brush samplehighlighterChisel tip, very translucent. Glazes and color washes.
brush brush samplebrushSoft-edged paint brush.
oil brush sampleoilThick paint with visible bristle streaks. Fur, wood, grass, painterly texture.
dry_brush brush sampledry_brushBristles that run out of paint and break up toward the end. Bark, rough stone, weathered surfaces.
watercolor brush samplewatercolorSoft wash with a darker drying rim. Layer it for depth.
crayon brush samplecrayonWaxy stroke that skips over paper grain.
charcoal brush samplecharcoalDark, smudgy, heavily textured. Shading and drama.

Effects

SampleBrushFeel
airbrush brush sampleairbrushSpeckled soft spray for shading and gradients.
splatter brush samplesplatterPaint droplets flung around the path. Splashes, dirt, rain, texture.
sparkle brush samplesparkleFour-pointed stars along the path. Glints, stars, magic.
neon brush sampleneonBright white-hot core with a colored glow around it. Lights, signs, lasers. Best on dark backgrounds.
rainbow brush samplerainbowSix color bands side by side, red to purple. Ignores the selected color.

Blend

SampleBrushFeel
smudge brush samplesmudgeDrags the paint already on the layer along the stroke. Soften edges, blend colors, smoke.
blur brush sampleblurBlurs the paint under the stroke. Soft shadows, depth of field, smooth gradients.

Erasers

SampleBrushFeel
eraser brush sampleeraserRemoves paint: transparent on upper layers, the background color on the background layer. With fill it clears an area.
soft_eraser brush samplesoft_eraserSoft, partial eraser that fades paint out. Lighten or feather edges.
pixel_eraser brush samplepixel_eraserSquare, 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.

CategoryTools
Canvas & Animationnew_canvas · load_image · transform_canvas · new_animation · select_frame · next_frame · tween_frames · batch
Brushes, Lighting, Atmosphere & Guidesstroke · 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 & Adjustmentsadd_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 & Feedbackview_canvas · get_feedback · resolve_feedback
Exportsave_canvas · save_svg · save_frames · save_animation · save_video · save_timelapse
📖 Full 49-tool reference
ToolWhat it does
new_canvas / load_imageCreate an empty RGBA canvas (defaults to 512×512) / load an existing PNG as a canvas or layer
transform_canvasCanvas actions: flip horizontal/vertical, rotate 90/180/270°, crop, or resize (scale artwork or canvas bounds)
new_animationFrame-by-frame mode: e.g. 24 or 30 frames at 12–30 fps, each frame its own layered canvas
select_frame / next_frameSwitch to a frame (copyFrom, clearLayers, per-frame durationMs hold timing) / advance to the next frame carrying unchanged layers forward
tween_framesInterpolate 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)
batchRun many drawing, layer or frame steps in one call to cut round-trips
get_palette / manage_paletteInspect 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_colorChoose default brush/color, or eyedropper-sample (x, y) (with optional radius average) from the canvas or a layer
set_symmetrySymmetry guide (vertical, horizontal, quadrant, radial + kaleidoscope mirror)
set_pose_guide3D-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_selectionSelection mask (shape, fromLayer, magicWand, feather, add/subtract/intersect, invert, clear)
strokeDrag 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_gradientMulti-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_lightLuminous painterly lighting (pool, beam, ring, sparkle, flare) with add/screen/normal blending, symmetry, and selection support
draw_textureDeterministic FBM procedural organic textures (clouds, watercolor, grain, wood, marble, foliage, ripples) with optional tileable seamless wrapping and shape clipping
draw_scatterDeterministic 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_textGlobal 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
fillPaint 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
eraseErase a path (smooth/curve/pressure), a shape, or a whole layer in one call; the selected brush and color stay
layer_effect / adjust_layerEuclidean 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_pixelRead one RGBA pixel of the picture or of one layer
add_layer / set_layerAdd 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_layerReorder layers (up, down, top, bottom, above, below, index) / duplicate a layer with pixels, vector ops, and flags
select_layer / list_layers / get_layerPick active layer / list stack / inspect held strokes and bounds
copy_layer / transform_layerCopy layers across frames / shift, scale, flipX/flipY, rotate or edge-wrap held strokes without blur
merge_layers / delete_layerMerge down (all: true to flatten) / drop a layer
undo / redoStep backward or forward (up to 30 levels, layer & canvas actions included)
view_canvasView 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_svgWrite flattened PNG (or .svg automatically) / export scalable layered vector SVG (`mode: auto
save_frames / save_animationWrite numbered RGBA PNGs / animated WebP (.webp), looping APNG (.png), or animated GIF (.gif)
save_videoWrite the animation as an H.264 MP4 for Shorts, Reels and TikTok (loops, scale, background, optional audio muxing; needs ffmpeg)
save_timelapseWrite the whole process, blank canvas to last stroke, as an animated GIF
get_feedbackRead the user's preview comments with their coordinates, plus the canvas with each spot outlined
resolve_feedbackMark 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), and stats.json (time, tool calls, steps, % painted, colors, errors, cost), aggregated into index.html.
  • --agent scripted paints 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) into results.json and index.html; --rejudge rescores existing final.png outputs 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.