# Krita Codex MCP

A local MCP server that lets your agent read a Krita document, paint with native brushes and export files. Useful when artwork is driven from code.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 10
- Author: cyyprezz
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cyyprezz/krita-codex-mcp
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/krita-codex-mcp

## What it does

The server runs a bridge between the agent and Krita. The MCP process speaks STDIO, while a Krita Python plugin listens on `127.0.0.1` only, checks a shared bearer token and pushes each Krita API call onto Qt's main thread. There is no tool for running arbitrary Python and no fallback that paints pixels directly — strokes, shapes, fills and correction filters all go through native Krita actions.

Tool count is small, each tool is broad. `krita_state` reports the active document, colour space and a layer tree with UUIDs; `krita_preview` returns a PNG of the whole canvas or a cropped area; `krita_draw` and `krita_paint_path` paint lines, paths and shapes with pressure. `krita_layers` edits the tree and reparents layers by UUID, `krita_history` handles undo and redo, `krita_asset` exports layer PNGs plus Unity-oriented packages, and `krita_save_export` writes KRA and PNG inside configured roots only.

Close Krita before installing, create the working directory and keep `uv`/`uvx` on `PATH` — without it the MCP process will not start. Krita needs Python scripting, and the **Krita Codex Bridge** plugin has to be enabled in the Python Plugin Manager and loaded after a restart. Windows is the original platform; Linux is experimental, so run the live compatibility check on other Krita builds first. When a build lacks a feature, `krita_state` and `krita_document(action="compatibility")` name the affected tools and the call returns a structured error.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add krita-codex-mcp -- uvx krita-codex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from krita-codex-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add krita-codex-mcp -- uvx krita-codex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from krita-codex-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "krita-codex-mcp": {
            "command": "uvx",
            "args": [
                "krita-codex-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from krita-codex-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "krita-codex-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "krita-codex-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from krita-codex-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add krita-codex-mcp uvx krita-codex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from krita-codex-mcp <command>

## When to use it
- read the layer tree and active document without touching Krita by hand
- get a PNG of the full canvas or a cropped region back in the agent reply
- paint a line or shape with the active brush preset and pressure
- reparent a layer by UUID and roll back extra steps with undo
- export layer PNGs and Unity packages from the project

## Example prompts
- Show the state of the open Krita document and its layer tree
- Render a canvas preview and crop it to the current selection
- Draw an ellipse with the current brush and save the KRA under the allowed root

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
