NK

nanayax3/krita-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

56 stars 22 forks Качество 68 Тренд 1MIT

nanayax3/krita-mcp - кандидат на сервер MCP, импортированный из https://github.com/nanayax3/krita-mcp.

Обзор

nanayax3/krita-mcp - кандидат на сервер MCP, импортированный из https://github.com/nanayax3/krita-mcp.

Обзор (машинный перевод)

Пусть ИИ рисует в Крите с помощью протокола Model Context.

Этот мост позволяет Клоду (или любому клиенту MCP) создавать полотна, рисовать штрихи, рисовать фигуры, экспортировать изображения и многое другое — все это находится в запущенном экземпляре Krita.

Как это работает

Два компонента:

  1. Krita Plugin ([T0]) — плагин Python, который работает внутри Krita, выставляя HTTP-сервер на localhost:5678. Он получает команды краски и выполняет их на главной нити Криты через командную очередь.

  2. MCP Server (server.py) — сервер FastMCP, который предоставляет инструменты рисования любому клиенту MCP. Он переводит вызовы инструментов MCP в HTTP-запросы к плагину Krita.

Настройка

###1 Установите плагин Krita

Скопируйте файлы плагинов в каталог плагинов Krita:

ОС | Путь [скрыто] [скрыто] [скрыто] Windows %APPDATA%\krita\pykrita\ Linux ~/.local/share/krita/pykrita/ macOS | ~/Library/Application Support/krita/pykrita/

Копируйте оба: [[Т6]] (папка с [[Т7]])]

  • [[Т8]]

Затем в Krita: Настройки → Настройка Krita → Менеджер плагинов Python → Включить «Krita MCP Bridge» и перезапустить Krita.

###2 Установите MCP-сервер

В виртуальной среде:

###3.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

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:

OS Path
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

pip install fastmcp httpx

Or with a virtual environment:

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):

{
  "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
krita_health Check if Krita is running with the plugin active
krita_new_canvas Create a new canvas (width, height, background color)
krita_set_color Set foreground paint color (hex)
krita_set_brush Set brush preset, size, and opacity
krita_stroke Paint a stroke through a list of [x, y] points
krita_fill Fill a circular area at a point
krita_draw_shape Draw rectangle, ellipse, or line
krita_get_canvas Export canvas to PNG (for AI to see progress)
krita_save Save canvas to a specific file path
krita_undo / krita_redo Undo/redo actions
krita_clear Clear canvas to a solid color
krita_get_color_at Eyedropper — sample color at a pixel
krita_list_brushes List available brush presets
krita_open_file Open an existing .kra, .png, .jpg, etc.

The Export Timeout Fix

This is the main reason this repo exists.

Открыть полный README на GitHub

Установка

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

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

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