Agent Paint
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HOST | No | Host to bind when using `--transport http`, passed as `--host`. The server binds to loopback only (default 127.0.0.1) and has no authentication. | 127.0.0.1 |
| PORT | No | Port to bind when using `--transport http`, passed as `--port` (default 8765). | 8765 |
| STATE_DIR | No | Directory where the server keeps its documents and state, passed as `--state-dir /path/to/agent-paint/.state`. Used in all registration examples (Claude Code, Codex and other MCP clients). | |
| TRANSPORT | No | Transport for the server, passed as `--transport`. `stdio` is the default and is what MCP clients use when they launch the server themselves; `http` serves the MCP endpoint at http://HOST:PORT/mcp. | stdio |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Agent Paint 0.5 is an independent desktop-free painting engine. All drawing coordinates are document pixels (strokes may opt into normalized 0..1). Pressure and opacity are 0..1. No window, foreground app, pointer, OCR, UI binding, calibration, duration or sleep is involved.
START: paint_document(action='create',width=...,height=...) returns document_id. Several agents may share one server: pass document_id on EVERY call. Different documents are painted in parallel; calls on one document run one at a time. Each document owns its brush and colour (paint_brush with document_id), so nobody else can change your brush; a new document starts from a copy of the active document's brush.
LAYERS: stable IDs, stack indices bottom-to-top. layer_id also accepts a unique layer NAME, so name layers ('sky', 'ink') and target them directly. paint_strokes, paint_shape, paint_fill, paint_pattern, paint_filter, paint_transform, paint_sample and paint_selection(from_layer/flood) take layer_id and paint there WITHOUT changing the active layer. paint_layer(create) inserts above the active layer by default; position='top'|'bottom' or index chooses the place; results report index and layer_count. stamp_visible adds a merged copy of everything visible (for whole-image grain, chromatic aberration, relief). duplicate goes above its source and becomes active (name= names the copy). Layer names are unique: an explicit name that exists is an error, automatic names get ' 2', ' 3'. merge_down keeps the lower layer's id; the upper layer may be clipped or use any blend (blended with the lower layer only). Raster layers take pixels, vector layers keep editable shapes/strokes, text layers keep editable text. Locked layers reject painting. alpha_lock keeps coverage; erasing or clear on an alpha-locked layer is an ERROR (unlock first). Blur on an alpha-locked layer softens colours inside a shape without spreading its edge.
BRUSH & STROKES: paint_brush(action='configure',settings={...},color='#RRGGBB'). Kinds: round, pencil, airbrush, watercolor, marker, eraser, smudge (own renderers, not CSP). Settings: size px, opacity, flow, hardness, spacing, min_size (width floor at zero pressure), taper_start/end, texture + seed, texture_space stroke|paper (paper = one document-fixed tooth for chalk, pastel, charcoal), edge_darkening (watercolor rim; works at any hardness), mixing, stabilization (a moving average over stabilization*50 px of arc; 0 keeps your geometry), blend. paint_strokes(strokes=[{points:[[x,y,p],...], brush:{...}, color, smooth, dash, dash_offset, closed}], brush={...}, color=..., smooth=..., dash=..., layer_id=...): call-level brush/color/smooth/ dash are defaults for all strokes; an empty strokes list paints nothing. Values meant to be 0..1 (pressure, opacity...) that overshoot by up to 0.01 are clamped instead of failing a batch. smooth=true draws a Catmull-Rom curve THROUGH the points (pressure too): 5-10 points make a clean curve, tapers stay pointed, no polyline corners. Without smooth a stroke is a polyline. dash=[on,off,...] px makes dashed lines; dash=[0,gap] makes round dots of the brush size every gap px (stitches, dotted guides, bead rows). Press-and-lift leaves: pressure 0.15 -> 1 -> 0 with smooth=true.
SHAPES & SELECTIONS: paint_shape renders only inside its bounds (thousands are cheap). Draw fill and outline in ONE call to keep lines on edges. smooth=true turns polygon/line vertices into a smooth curve (organic silhouettes from few points). bleed=0.5..1 hides hairline seams between adjacent antialiased facets (low-poly, mosaic, stained glass). antialias=false gives exact pixels: box shapes and polygons both cover [x0,x1) (pixel-centre rule), so adjacent hard shapes tile without overlap. Points are pairs [[x,y],...], never a flat list. Box corners may come in either order; zero-size boxes and polygons with <3 distinct points are skipped (result 'skipped'), not errors. paint_selection: polygon (smooth too), rectangle, ellipse, flood, from_layer (threshold= 1..255 makes it hard), add/subtract/intersect, feather, grow/shrink (round: circles stay circles); None = unrestricted, empty = nothing writable; rectangles/ellipses may extend past the canvas.
FILLS, PATTERNS, FILTERS: paint_fill solid/flood/linear/radial gradient, limited to the selection and to points (a polygon) when given; a gradient paints the whole allowed area, so restrict it with points, a selection or alpha_lock. kind='clear' erases. paint_pattern draws document-anchored patterns inside points (polygon), rectangle or the selection: hatch (angle or angles=[45,-45] crosshatch, spacing, width, jitter for hand-made breaks and wobble, taper, dash), stipple (spacing, size, size_jitter, density), halftone (Ben-Day / print dots: angle, spacing, size), dither (ordered Bayer, cell = art-pixel size, e.g. 6 for pixel art). density 0..1 and gradient={type:linear|radial,start,end,from,to} modulate tone (hatch width, dot size, dot probability, dither level); texture adds paper grain. paint_filter: blur (premultiplied; glow = duplicate + blur + screen/add; soft shadows), channel_shift (misregistration), noise (seeded grain), relief (emboss lighting from luminance = brushwork/impasto, or alpha = cut paper, foil; angle 135 = light from upper left; depth 4..20 for gentle painted height maps), levels (black, white, gamma), threshold (level: photocopy/stencil black and white), invert, hue_saturation (hue degrees, saturation factor, lightness -1..1). paint_transform(resample='nearest') keeps pixel art crisp.
TEXT: paint_text creates editable text; style: font, font_size, color, outline_width/color, align left|center|right|justify, letter_spacing (px tracking), line_height (absolute baseline distance; line_spacing is the extra gap), scale_x/y, rotation, anchor l/m/r + t/m/b/s ('mm' centres on x,y, 'ls' puts the first BASELINE on y: ruled paper, manuscripts). Without layer_id each call makes a new text layer (layer_name names it); pass a text layer's id to put several objects on one layer. Text never goes into raster layers. Returns bbox; missing_glyphs warns about tofu; paint_fonts( supports='text') finds covering fonts. Editable text has no grain: add texture to a rasterized/stamped copy if needed.
BATCHES & BIG PLANS: paint_batch(actions=[{tool,arguments,store?},...]) is atomic: one undo step, any failure rolls back scene and brush. Inline <=256 actions; actions_file='plan.jsonl' or .json runs up to 20000 actions from disk without sending coordinates through the chat (generate coordinates with a script, then let the engine draw them). An action with "store":"ink" makes its result referable later as {"$ref":"ink.layer_id"} (store inside arguments is accepted too). results='compact' (default) returns ids and union bboxes, per action only up to 64 actions; 'none' only a summary; 'full' everything. Warnings of any action (missing glyphs...) are always summarized. paint_layer list/state report object counts; paint_object(action='list') returns objects. Undo history stores only changed layers.
TIMELAPSE (optional, only when the user asks): paint_timelapse(action='start', path=folder) records every later change of the document; 'stop' (or closing it) ends the recording; 'render' replays it in a private engine into an MP4 (fps, seconds of build-up, hold). Recording is off by default and costs nothing then.
FILES: save an editable .apaint (paint_document save), then export PNG; export never saves the project: its project_saved=true only when the .apaint on disk is current, else it says what to do. Opening a project that is already open selects it (force=true reloads from disk); another copy of the same document opens under a new document_id. paint_document(action='inspect',path=...) verifies a saved project read-only (layers, objects, revision) without opening it. ORA/PSD rasterize text/vectors and bake masks/clipping; .apaint keeps everything editable. Existing paths need overwrite=true; ordinary Save uses the project's own path. Save the .apaint after each pass: an interrupted session can then reopen it.
LOOK: paint_snapshot returns actual pixels (regions stay valid across preview zoom; upscale=true for crisp small crops; path + overwrite=true reuses a file name; compare_to reports pixel change, never beauty). Check a copy about 500 px wide: the idea must read at that size. paint_compare shows a reference beside the painting and never imports it. Successful calls do not prove a good painting: inspect after each meaningful pass, judge composition, value masses, edges and material, and change the method when a second pass fails. Watch for mechanical regularity, mirror symmetry and empty corners; vary spacing, size and angle on purpose.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| paint_stateA | Inspect authoritative scene/layer/brush state, document IDs, capabilities and limits. No desktop access. |
| paint_documentA | Create/open/save .apaint; export full-resolution PNG/JPEG/WebP/TIFF or raster-layer ORA/PSD (scale 2..16 = nearest-neighbour enlargement for flat formats). Export never saves the project: project_saved tells whether the .apaint on disk is current. inspect verifies a saved .apaint read-only. Opening an already open project selects it (force=true reloads). document_id selects/closes, or targets info/save/export without changing the active document. Existing paths protected unless overwrite. Close dirty document requires force. |
| paint_layerA | Manage layers by id or unique name. Indices bottom-to-top. create inserts above the active layer unless position (top/bottom) or index is given; reorder takes index or position top/bottom. stamp_visible adds a merged copy of everything visible (default at the top). name names created, duplicated or stamped layers; names are unique (an existing explicit name is an error, automatic names get ' 2'). merge_down accepts a clipped or non-normal upper layer (blended with the lower one only). properties (on create or update): name, opacity(0..1), blend, visible, locked, alpha_lock, clipping. Results include index and layer_count; list reports object_count (paint_object lists objects). |
| paint_brushB | Configure the document's own brush (other agents' documents are unaffected) and shared presets. kind=round/pencil/airbrush/watercolor/marker/eraser/smudge; size px; opacity,hardness,flow,spacing,min_size,taper_start,taper_end,texture,stabilization,mixing 0..1 (spacing up to 2); pressure_size/pressure_opacity bool; seed integer; blend; texture_space stroke|paper (paper = grain fixed to the document); edge_darkening 0..1 (pigment pools at the mark edge). stabilization averages over stabilization*50 px of arc (0 keeps geometry). Color #RRGGBB[AA]. |
| paint_strokesB | Render an atomic stroke batch with real pressure, taper and antialiasing into layer_id (default active). brush/color/smooth/dash here are defaults for every stroke; per-stroke values override. smooth=true draws Catmull-Rom curves through the points; dash=[on,off] dashes, [0,gap] dots. An empty list paints nothing. Document pixels independent of preview. Failure rolls back the complete call. |
| paint_selectionA | Set an exact pixel selection mask immediately. rectangle=[left,top,right,bottom], document pixels, corners in any order; may extend past the canvas; zero size selects nothing. antialias=false gives hard 0/255 edges (polygons use the pixel-centre rule, [x0,x1)). smooth=true makes a polygon a smooth curve through its points. from_layer/flood read layer_id (default active); from_layer threshold 1..255 selects pixels at least that opaque, hard. feather/grow/shrink radius <=100; grow/shrink are round (Euclidean), so circles stay circles. Flood tolerance 0..255 (binary). Selection constrains subsequent raster operations. |
| paint_fillA | Fill a raster layer (layer_id or active) within the selection, and within the polygon points when given (smooth=true: a curve through them) - a gradient for one shape needs no separate selection. Gradient start/end or flood point in document pixels; a gradient covers the whole allowed area (end colours continue beyond start/end). Opacity 0..1. Flood samples the target layer or merged painting. kind=clear erases the selection/polygon (or whole layer) to transparency; opacity<1 erases partially; clearing an alpha-locked layer is an error. |
| paint_shapeA | Geometry rendered only within its own bounds (fast even on big canvases). Points are pairs [[x,y],...]. Box shapes use two corners in either order; cubic bezier four control points. Zero-size boxes and polygons with <3 distinct points are skipped (result 'skipped'), not errors. Fill+outline in one call keeps outlines on edges. smooth=true: polygon/line through its points as a smooth curve. bleed px widens the fill to hide seams between adjacent antialiased facets. antialias=false paints hard pixels (boxes and polygons cover [x0,x1)). Vector layer retains editable objects, raster layer paints pixels. Pixel selection applies only to raster. |
| paint_textA | Create editable Unicode text (a new text layer above the active layer named layer_name, or into the text layer layer_id - never a raster layer), or update object by IDs. Style: font(name/path),font_size,color,outline_width,outline_color,letter_spacing(px tracking, keeps kerning),line_height(absolute px baseline-to-baseline) or line_spacing(extra px gap),align(left/center/right/justify),scale_x,scale_y,rotation(clockwise degrees),anchor(lt default; l/m/r + t/m/b/s; mm centres on x,y; ls puts the first baseline on y). Returns bbox (ink bounds) and missing_glyphs if the font lacks characters. |
| paint_objectC | Edit retained text/vector objects by stable IDs. update changes geometry/style/brush or six-coefficient transform, then rerenders from retained source. |
| paint_transformA | Affine layer transform (document canvas fixed). matrix=[a,b,c,d,e,f], x'=ax+by+c,y'=dx+ey+f; or translate/scale/clockwise degrees about origin. resample='nearest' keeps pixel art crisp. Text/vector source remains editable. selection_only cuts/moves selected raster pixels. |
| paint_historyA | Undo/redo complete atomic scene operations. A batch is one step. Bounded in-memory history; .apaint stores current scene, not undo buffers. |
| paint_batchA | Atomic synchronous sequence, one undo step. Scene and brush changes roll back together on error. No filesystem actions or nested batches. Each action: {tool,arguments[,store]} (store inside arguments is accepted too); {"$ref":"name.key"} reuses a stored result (e.g. a new layer's id). Inline up to 256 actions, or actions_file = path to .json/.jsonl with up to 20000 actions (generate big plans with a script; coordinates never pass through the chat). results: compact (ids + union bbox; per-action results only up to 64 actions), full, none. Warnings of any action are always summarized. |
| paint_viewB | Set preview crop/zoom/rotation. Does not change any drawing coordinates or pixels. Empty arguments restore overview. Snapshot(use_view=true) displays this view. |
| paint_regionC | Named document region [left,top,right,bottom], stored in project. Use paint_snapshot(region=name) for stable detail comparisons across preview views. |
| paint_snapshotA | Return actual rendered canvas/layer/selection/mask pixels and persistent ID/hash. Matching prior crop reports pixel changes, never beauty. Preview max_side 64..8192; upscale=true enlarges small crops by an integer nearest-neighbour factor up to max_side (a note says when max_side is too small). path saves the preview (overwrite=true replaces an existing file). Use document export for full resolution. |
| paint_compareB | Show reference left/painting right, equal display height. Crops use pixel edges in their respective images. Analysis only; never imports reference pixels. |
| paint_sampleA | Read exact RGBA at document pixel points; merged canvas, or one layer (layer_id, or active with sample_merged=false). |
| paint_fontsA | List installed TrueType/OpenType font names and paths, optionally filtered by filename. supports= keeps only fonts with glyphs for all its characters (e.g. Cyrillic). |
| paint_filterA | Filter a raster layer within the selection, honouring alpha lock (with alpha_lock a blur stays inside the shape). blur: premultiplied Gaussian radius 0..250 (glow: duplicate layer, blur, blend screen/add; soft shadows). channel_shift: offsets {r:[dx,dy],g:[..],b:[..]} whole pixels (chromatic aberration, misregistration). noise: amount 0..1 seeded grain, monochrome or per-channel. relief: emboss lighting, amount 0..1 strength, radius softness, angle = light direction (135 = upper left), source luminance (brushwork, impasto) or alpha (cut paper, foil), depth 0.1..50 multiplies slopes (4..20 for gentle painted height maps). levels: black/white input points 0..255 and gamma (>1 lightens midtones). threshold: level 0..255, black-and-white by luminance (photocopy, stencil). invert: colour negative. hue_saturation: hue degrees, saturation factor 0..4, lightness -1..1. Colour filters keep alpha. For the whole picture use paint_layer(stamp_visible) first. |
| paint_patternA | Pattern fill drawn by the engine inside points (polygon; smooth=true for curves), rectangle, or the selection/whole layer. hatch: lines at angle (degrees, clockwise from +x) or angles=[45,-45] crosshatch, spacing/width px, jitter 0..1 (hand-made breaks, wobble, offsets), taper 0..1 dash ends, dash [on,off]. stipple: random dots, spacing = mean distance, size diameter, size_jitter, density = keep probability. halftone: dot grid at angle with pitch spacing, dot diameter size*sqrt(level) (Ben-Day, print screens). dither: ordered Bayer 8x8 with cell px art pixels (pixel-art gradients). density 0..1 (default hatch 1, others 0.5) and gradient {type: linear|radial, start:[x,y], end:[x,y], from, to} set the tone; texture 0..1 adds document-fixed paper grain. Patterns are anchored to the document, so adjacent fills continue seamlessly. |
| paint_timelapseA | Optional timelapse of a painting; recording is off by default - start it only when the user asks for a timelapse. start: record every later state-changing call of the document into folder path (default under the state dir; overwrite=true reuses a recording folder). stop: finish (closing the document also stops). status: whether the document is recorded. render: replay the recording folder path in a private engine (open documents are untouched) into an MP4 output (default /timelapse.mp4): seconds of build-up (default 5..20 from the amount of work), hold seconds of the finished picture, fps, max_side px. Needs ffmpeg (PATH or AGENT_PAINT_FFMPEG). The result reports verified=true when the replay ends on exactly the recorded picture. |
| paint_abortA | Signal rendering to stop without acquiring the drawing lock; active atomic operation rolls back. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| artist_guide |
TDQS
Scored across 23 tools
Most tools are clearly distinct: state/sample/snapshot form a reading family whose granularity levels are explained, and the fill/shape/pattern trio each announces its own rendering semantics. Some residual overlap exists between paint_shape (fills polygons), paint_fill, and paint_pattern, and between paint_text/paint_object for retained text, but the descriptions give decent decision guidance.
Every tool uses the same paint_<noun> snake_case pattern with no stylistic deviations, and the shared prefix makes the family immediately recognizable.
23 tools is on the heavy side, but the domain is a full painting engine (documents, layers, brushes, strokes, selection, filters, patterns, objects, timelapse), and each tool maps to a genuine capability rather than a redundant variant.
Coverage is broad: document lifecycle, layer creation/reorder/merge, drawing, selection, text/vector objects, filters, patterns, history, batch and timelapse. Minor gaps remain, notably no explicit layer delete operation and no canvas resize/crop, though agents can work around several of these via stamp_visible/merge and export scaling.