MCP Hub
Back to servers

Paint MCP

Exposes a Pygame-based drawing canvas as an MCP server, allowing LLMs to create digital art using standard shapes and freehand paths. It features a specialized oil paint mode that simulates realistic color mixing, paint depletion, and textured brush strokes.

Updated
Feb 22, 2026

Paint MCP

A drawing canvas exposed as an MCP server. An LLM connects over stdio and paints on a pygame window using tool calls.

Setup

pip install -r requirements.txt

Usage

python server.py

This opens an 800x600 pygame canvas and starts the MCP server on stdio. Connect any MCP-compatible client (e.g. Claude Desktop) to the process.

MCP Tools

ToolDescription
get_canvas_infoGet canvas dimensions, current color, brush size, and mode
set_colorSet drawing color (RGB 0-255)
set_brush_sizeSet brush size (1-50 px)
draw_pointDraw a single dot
draw_lineDraw a line between two points
draw_rectDraw a rectangle (blocked in oil paint mode)
draw_ellipseDraw an ellipse (blocked in oil paint mode)
draw_pathDraw a freehand path through coordinate pairs
batch_strokesExecute many strokes in one call with per-stroke color/size overrides
blend_pathSmudge/blend existing colors along a path
flood_fillBucket fill an area (blocked in oil paint mode)
clear_canvasClear to white
undoUndo last operation
get_canvas_pixelsRead pixel data from a region
save_canvasSave canvas to a PNG file

Oil Paint Mode

ToolDescription
set_oil_paint_modeToggle oil paint simulation on/off
get_oil_painting_guideGet a technique guide for realistic oil painting

When oil paint mode is enabled:

  • Color mixing — the brush picks up existing canvas color as it moves, so overlapping strokes blend naturally.
  • Paint depletion — strokes start opaque and gradually thin out as the brush runs dry. Each new stroke reloads the brush.
  • Soft edges — dabs use concentric rings with cubic falloff for painterly texture.
  • Shapes disabled — rectangles, ellipses, and flood fill are blocked. Only points, lines, and paths are available.
  • batch_strokes is the recommended way to paint — send many short strokes per call, each with its own color and brush size.

Examples

Regular mode

Starry NightMeme
Starry NightMeme preview

Oil paint mode

SunsetAlien Sunset
Sunset paintingAlien sunset Van Gogh

Architecture

  • server.py — Entry point. Runs the pygame main loop and drains commands from a thread-safe queue.
  • tools.py — MCP tool definitions. Pushes drawing commands onto the queue.
  • canvas.py — Drawing engine. Wraps a pygame surface with draw ops, oil paint simulation, and an undo stack.

Reviews

No reviews yet

Sign in to write a review