Krita MCP Server
Controls a running Krita instance through a bridge plugin, enabling AI clients to create canvases, set foreground colors and brush size/opacity, paint soft pixel-level strokes through point lists, fill circular areas, rasterize rectangles/ellipses/lines, sample pixel colors, clear or undo/redo, list brush presets, open existing files, and export or save the artwork as PNG/.kra.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Krita MCP Server
Let AI paint in Krita via the Model Context Protocol.
This bridge allows Claude (or any MCP client) to create canvases, paint strokes, draw shapes, export images, and more — all inside a running Krita instance.
How It Works
Two components:
Krita Plugin (
krita-plugin/) — A Python plugin that runs inside Krita, exposing an HTTP server onlocalhost:5678. It receives paint commands and executes them on Krita's main thread via a command queue.MCP Server (
server.py) — A FastMCP server that exposes painting tools to any MCP client. It translates MCP tool calls into HTTP requests to the Krita plugin.
MCP Client (Claude, etc.) ←→ MCP Server (server.py) ←→ Krita Plugin (HTTP on :5678) ←→ KritaRelated MCP server: Krita MCP Server
Setup
1. Install the Krita Plugin
Copy the plugin files to your Krita plugins directory:
OS | Path |
Windows |
|
Linux |
|
macOS |
|
Copy both:
krita-plugin/kritamcp/(the folder with__init__.py)krita-plugin/kritamcp.desktop
Then in Krita: Settings → Configure Krita → Python Plugin Manager → Enable "Krita MCP Bridge" and restart Krita.
2. Install the MCP Server
pip install fastmcp httpxOr with a virtual environment:
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txt3. Configure Your MCP Client
Add to your MCP client config (e.g., Claude Desktop's claude_desktop_config.json):
{
"mcpServers": {
"krita": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
}If using a virtual environment:
{
"mcpServers": {
"krita": {
"command": "/path/to/.venv/Scripts/python",
"args": ["/path/to/server.py"]
}
}
}Available Tools
Tool | Description |
| Check if Krita is running with the plugin active |
| Create a new canvas (width, height, background color) |
| Set foreground paint color (hex) |
| Set brush preset, size, and opacity |
| Paint a stroke through a list of [x, y] points |
| Fill a circular area at a point |
| Draw rectangle, ellipse, or line |
| Export canvas to PNG (for AI to see progress) |
| Save canvas to a specific file path |
| Undo/redo actions |
| Clear canvas to a solid color |
| Eyedropper — sample color at a pixel |
| List available brush presets |
| Open an existing .kra, .png, .jpg, etc. |
The Export Timeout Fix
This is the main reason this repo exists.
By default, HTTP requests and command queue operations time out after ~30 seconds. Canvas export (get_canvas) and file save (save) operations can easily exceed this on larger canvases, causing silent failures or timeout errors.
The fix is applied in two places:
MCP Server (server.py) — Extended timeout for export/save commands:
# In krita_get_canvas and krita_save:
result = send_command("get_canvas", {"filename": filename}, timeout=120.0)
result = send_command("save", {"path": path}, timeout=120.0)Krita Plugin (__init__.py) — Matching timeout in the command queue:
def get_result(self, command_id, timeout=120):
"""Wait for result with timeout."""
for _ in range(int(timeout * 10)): # Check every 100ms
...Both sides must match. If only the MCP server timeout is increased, the plugin's command queue will still time out at 30s. If only the plugin timeout is increased, the HTTP request from the MCP server will time out first.
Configuration
Setting | Default | How to Change |
Plugin HTTP port |
| Edit |
MCP server URL |
| Set |
Canvas output dir |
| Edit |
Painting Approach
The plugin paints using direct pixel manipulation (not Krita's native brush engine for strokes). This means:
Strokes use a custom soft-circle renderer with configurable hardness
Alpha blending is done manually in BGRA pixel format
Shapes (rectangle, ellipse, line) are rasterized directly
This approach is reliable and doesn't depend on Krita's internal brush state
The set_brush tool does set Krita's brush preset (for potential future use), but stroke currently uses its own pixel-level rendering.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
The Canva MCP server connects AI assistants (like Claude, ChatGPT, and Cursor) to Canva's API, enabling them to create and manage designs directly within chat conversations. Key capabilities include generating new designs from prompts, autofilling templates, searching and resizing existing designs, importing files from URLs, exporting designs as PDFs or images, and managing folders and comments without switching between tools.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Remote MCP server for anime art, OCs, style pickers, inpainting, upscaling & anime video.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI models to directly control a local Krita instance by inspecting real canvas previews, managing documents and layers, importing and masking generated images, inpainting, painting with the brush engine, checkpointing, and exporting KRA/PNG files.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI clients to control a running Krita instance, allowing them to create canvases, paint strokes, draw shapes, export images, and perform other painting tasks.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to create, paint, edit, inspect, and export images in a running GIMP 3.2 instance via MCP.139 PyPIGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables LLM-driven painting agents to control Krita through MCP tools, iteratively reconstructing a target image by observing canvas snapshots, diff heatmaps, and session state. It exposes observation, drawing, brush, color, layer, selection, vector, filter, document I/O, and session tools for closed-loop artwork generation.1MIT