Krita MCP Server logo

Krita MCP Server

Community
nanayax3

Let AI paint in Krita via the Model Context Protocol. Includes fix for the common export timeout issue.

Publishernanayax3
Repositorykrita-mcp
LanguagePython
Forks
20
Stars
49
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Krita MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    49 stars and 20 forks from the linked repository.

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:

  1. Krita Plugin (krita-plugin/) — A Python plugin that runs inside Krita, exposing an HTTP server on localhost:5678. It receives paint commands and executes them on Krita's main thread via a command queue.

  2. 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)  ←→  Krita

Setup

1. Install the Krita Plugin

Copy the plugin files to your Krita plugins directory:

OSPath
Windows%APPDATA%\krita\pykrita\
Linux~/.local/share/krita/pykrita/
macOS~/Library/Application Support/krita/pykrita/

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

bash
pip install fastmcp httpx

Or with a virtual environment:

bash
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements.txt

3. Configure Your MCP Client

Add to your MCP client config (e.g., Claude Desktop's claude_desktop_config.json):

json
{
  "mcpServers": {
    "krita": {
      "command": "python",
      "args": ["/path/to/server.py"]
    }
  }
}

If using a virtual environment:

json
{
  "mcpServers": {
    "krita": {
      "command": "/path/to/.venv/Scripts/python",
      "args": ["/path/to/server.py"]
    }
  }
}

Available Tools

ToolDescription
krita_healthCheck if Krita is running with the plugin active
krita_new_canvasCreate a new canvas (width, height, background color)
krita_set_colorSet foreground paint color (hex)
krita_set_brushSet brush preset, size, and opacity
krita_strokePaint a stroke through a list of [x, y] points
krita_fillFill a circular area at a point
krita_draw_shapeDraw rectangle, ellipse, or line
krita_get_canvasExport canvas to PNG (for AI to see progress)
krita_saveSave canvas to a specific file path
krita_undo / krita_redoUndo/redo actions
krita_clearClear canvas to a solid color
krita_get_color_atEyedropper — sample color at a pixel
krita_list_brushesList available brush presets
krita_open_fileOpen 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:

python
# 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:

python
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

SettingDefaultHow to Change
Plugin HTTP port5678Edit SERVER_PORT in plugin __init__.py
MCP server URLhttp://localhost:5678Set KRITA_URL env var
Canvas output dir~/krita-mcp-outputEdit CANVAS_OUTPUT_DIR in plugin __init__.py

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

Installation

TypingMind
{
  "mcpServers": {
    "krita-mcp": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}

Use Krita MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Krita MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Krita MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Krita MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "krita-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Krita MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Krita MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Krita MCP Server to help me with this task?
Krita MCP Server
Sure. I read it.
Here is what I found using Krita MCP Server.

Frequently asked questions

What is the Krita MCP Server MCP server used for?

Krita MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Krita MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Krita MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Krita MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Krita MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Krita MCP Server MCP to TypingMind?

Krita MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Krita MCP Server MCP provide in TypingMind?

Krita MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Krita MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Krita MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇