Exposes a drawing canvas as an MCP server enabling an LLM to paint on a pygame window via tool calls.
Configuration
View docs{
"mcpServers": {
"joeyballentine-paint-mcp": {
"command": "python",
"args": [
"server.py"
]
}
}
}Paint MCP exposes a drawing canvas as an MCP server. An LLM can connect over stdio to issue painting commands that render on a pygame window, enabling dynamic, AI-assisted art creation through a structured set of tools.
To use the Paint MCP server, start the local MCP process and connect using any MCP-compatible client. The server runs a pygame-based canvas and listens for drawing commands sent by the client. The workflow typically looks like this: start the server, connect your MCP client, and begin issuing tool calls to paint, draw shapes, or apply oil painting effects.
Prerequisites: you need Python and an internet connection to install dependencies.
pip install -r requirements.txtThe server provides a suite of drawing tools that you can invoke from your MCP client. It includes basic drawing primitives, color and brush controls, and an oil painting mode for painterly effects. The server uses a pygame canvas of 800 by 600 pixels and supports an undo stack and canvas saving.
python server.pyWhen oil paint mode is enabled, color mixing, paint depletion, soft edges, and brush shape variations create a realistic painting workflow. Rectangles, ellipses, and flood fill are blocked in oil paint mode, so you focus on points, lines, and paths for painting.
Regular mode and oil paint mode provide different artistic capabilities. Use batch strokes to efficiently send many small actions with per-stroke attributes.
Key components include the entry point that runs the pygame loop, a tool definition module that queues commands, and a drawing engine that renders strokes and manages the undo stack.
Retrieve current canvas dimensions, active color, brush size, and active drawing mode.
Set the active drawing color using RGB components (0-255 range).
Adjust the brush size in pixels (range 1-50).
Choose the brush shape from round, flat, filbert, fan, or palette_knife to influence stroke texture.
Draw a single pixel or point at a specified coordinate.
Render a straight line between two coordinates.
Draw a rectangle outline or filled shape; note that it may be blocked in oil paint mode.
Draw an ellipse shape; note that it may be blocked in oil paint mode.
Stroke a freehand path defined by sequential coordinate pairs.
Execute multiple strokes in a single call, with per-stroke overrides for color, size, and shape.
Smudge or blend colors along a path to create soft transitions.
Bucket-fill an area with the current color; may be blocked in oil paint mode.
Reset the canvas to a white background.
Rollback the most recent operation to restore previous canvas state.
Read raw pixel data from a specified region of the canvas.
Save the current canvas to a temporary PNG file and return its path for quick inspection.
Persist the current canvas as a PNG file on disk.
Toggle oil paint simulation on or off to enable painterly effects.
Provide a technique guide for achieving realistic oil painting results.