SK

sansasane/krita-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 5 forks 质量 83 趋势 22CC0-1.0

An MCP server that lets Claude drive Krita: layers, drawing, filters, export - and read the canvas back as a PNG so it can see what it painted.

概览

An MCP server that lets Claude drive Krita: create documents, build layer stacks, paint shapes and text, run filters, export files — and look at the canvas it just made. The banner above was painted by Claude through this bridge. So was the example poster. No hand-editing, no image libraries — just tool calls. Claude can't see what it's doing in most creative tools. Here it can: get_image renders the canvas and hands back a PNG, so Claude draws, looks at the result, notices the gradient banded or the reflection looks like a staircase, and fixes it. That loop is the whole point. It works on real Krita documents — your layers, your colour profiles, your .kra files — not a sandbox. - (developed and tested against 5.3.3) - on your PATH, for the MCP server - An MCP client — Claude Code, Claude Desktop, or anything else that speaks MCP The MCP server uses . There is nothing to pip install and no virtualenv to manage.

README

以下为原文 README 节选,完整内容请查看原文。

Krita MCP

An MCP server that lets Claude drive Krita: create documents, build layer stacks, paint shapes and text, run filters, export files — and look at the canvas it just made.

The banner above was painted by Claude through this bridge. So was the example poster. No hand-editing, no image libraries — just tool calls.


Why it’s useful

Claude can’t see what it’s doing in most creative tools. Here it can: get_image renders the canvas and hands back a PNG, so Claude draws, looks at the result, notices the gradient banded or the reflection looks like a staircase, and fixes it. That loop is the whole point.

It works on real Krita documents — your layers, your colour profiles, your .kra files — not a sandbox.

Requirements

  • Krita 5.2+ (developed and tested against 5.3.3)
  • Python 3.8+ on your PATH, for the MCP server
  • An MCP client — Claude Code, Claude Desktop, or anything else that speaks MCP

The MCP server uses only the Python standard library. There is nothing to pip install and no virtualenv to manage.

Install

1. Install the Krita plugin

Close Krita first — it rewrites its config on exit and would undo the enable flag.

Windows

powershell -ExecutionPolicy Bypass -File install.ps1

Linux / macOS

./install.sh

The script copies the plugin into Krita’s pykrita folder and sets enable_krita_mcp=true in kritarc.

Prefer to do it by hand? Copy pykrita/krita_mcp/ and pykrita/krita_mcp.desktop into Krita’s resource folder under pykrita/, then enable MCP Bridge in Settings → Configure Krita → Python Plugin Manager.

2. Start Krita and check it

python mcp_server.py --selftest
health: Krita 5.3.3, plugin 1.0.0, 31 operations
  [ok] krita_instance         5.3.3
  [ok] create_document        64x48
  [ok] pixel_channel_order    read back r=255 g=0 b=0 on a little-endian host
  [ok] pixel_roundtrip        read #0080ff
  [ok] draw                   pixel at 10,10 is #ff0000
  ...
9/9 checks passed

Inside Krita, Tools → Scripts now has Start/Stop MCP Bridge and MCP Bridge Status….

3. Connect your MCP client

Claude Code

claude mcp add krita -- python /absolute/path/to/mcp_server.py

Claude Desktop — add to claude_desktop_config.json (%APPDATA%\Claude\ on Windows, ~/Library/Application Support/Claude/ on macOS):

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

Restart the client. Krita must be running for the tools to do anything.

Try it

Make a 1200×800 poster in Krita: a sunset over mountains reflected in water, on separate layers. Show me the result when you’re done.

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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