Content
# KritaMCP
MCP (Model Context Protocol) server for Krita. This is a plugin that allows you to control Krita from an AI assistant.
## Architecture
```
AI Client (Claude etc.)
│
│ MCP (SSE transport, port 8001)
▼
MCP Server (kritamcp-server)
│
│ HTTP/SSE Bridge (port 8000)
▼
Krita Plugin (krita-plugin/)
│
│ Krita Python API
▼
Krita
```
- **MCP Server**: FastMCP-based MCP server. Receives requests from the AI client and sends commands to the Krita plugin via HTTP/SSE.
- **Krita Plugin**: Krita's Python plugin. Receives commands from the MCP server via SSE and executes them using the Krita API.
## Available MCP Tools
| Tool | Description |
| :------------------- | :---------------------------------------- |
| `ping` | Check connection with Krita |
| `get_document_info` | Get information about the active document |
| `create_document` | Create a new document |
| `save_document` | Save the document |
| `get_layers` | Get layer hierarchy |
| `execute_python` | Execute code in Krita's built-in Python environment |
## Requirements
- Python 3.12+
- Krita (Python plugin support)
- [uv](https://docs.astral.sh/uv/) or [pipx](https://pipx.pypa.io/)
## Installation
### 1. Install MCP Server
**Method A: Run directly with uvx (no installation required)**
```bash
uvx kritamcp-server
```
Dependencies are automatically installed in a temporary environment and cleaned up after execution.
**Method B: Install as a tool**
```bash
# If using uv
uv tool install kritamcp
# If using pipx
pipx install kritamcp
```
After installation, the `kritamcp-server` command will be available.
### 2. Install Krita Plugin
Copy or symlink the `krita-plugin/kritamcp/` directory and `krita-plugin/kritamcp.desktop` to Krita's pykrita directory:
```bash
# Linux
ln -s /path/to/krita-plugin/kritamcp ~/.local/share/krita/pykrita/kritamcp
ln -s /path/to/krita-plugin/kritamcp.desktop ~/.local/share/krita/pykrita/kritamcp.desktop
# macOS
ln -s /path/to/krita-plugin/kritamcp ~/Library/Application\ Support/krita/pykrita/kritamcp
ln -s /path/to/krita-plugin/kritamcp.desktop ~/Library/Application\ Support/krita/pykrita/kritamcp.desktop
# Windows (PowerShell with administrator privileges)
New-Item -ItemType SymbolicLink -Path "$env:APPDATA\krita\pykrita\kritamcp" -Target "C:\path\to\krita-plugin\kritamcp"
New-Item -ItemType SymbolicLink -Path "$env:APPDATA\krita\pykrita\kritamcp.desktop" -Target "C:\path\to\krita-plugin\kritamcp.desktop"
```
### 3. Enable the plugin in Krita
1. Start Krita
2. Open **Settings > Configure Krita > Python Plugin Manager**
3. Check **KritaMCP** to enable it
4. Restart Krita
## Usage
### Start MCP Server
**Method A: Start from within Krita (recommended)**
1. In Krita, enable **Settings > Dockers > KritaMCP**
2. Click the **Start** button in the KritaMCP panel
The plugin will automatically start `kritamcp-server`.
**Method B: Start from the command line**
```bash
kritamcp-server
```
You can change the ports with environment variables:
```bash
MCP_SERVER_PORT=8001 MCP_BRIDGE_PORT=8000 kritamcp-server
```
### AI Client Configuration
Configure the following in the MCP client such as Claude Desktop:
```json
{
"mcpServers": {
"krita": {
"type": "sse",
"url": "http://localhost:8001/sse"
}
}
}
```
## Development
### Dev Container (Docker Environment)
This project includes a Dev Container configuration. The development environment is automatically built in VS Code or Claude Code.
```bash
# After starting the Dev Container
uv sync
```
The following services are started in the Dev Container:
- **dev**: Development container (Python 3.12, uv, Claude Code CLI)
- **krita**: Krita GUI container (accessible from the browser at `localhost:3001`)
### Local Development
```bash
# Editable install
uv tool install -e .
# Reinstall after changes
uv tool install --force -e .
```
### Directory Structure
```
krita-plugin/ # Krita Plugin
├── __init__.py # Entry point
├── kritamcp.desktop # Plugin metadata
└── kritamcp/
├── __init__.py # Extension/Docker widget registration
├── krita_actions.py # Implementation of Krita API operations
├── mcp_client.py # SSE communication client with MCP server
├── server_manager.py # MCP server process management
└── docker_widget.py # Krita UI widget
mcp_server/ # MCP Server
├── __init__.py
├── server.py # Server entry point
├── tools.py # MCP tool definitions
└── krita_bridge.py # Communication bridge with Krita plugin
.devcontainer/ # Dev Container configuration
```
## License
MIT
Connection Info
You Might Also Like
openwebui-extensions
A collection of enhancements, plugins, and prompts for OpenWebUI, developed...
nowledge-mem
Nowledge Mem is a privacy-first, graph-native context manager for AI insights.
awesome-mcp-enterprise
A curated list of MCP tools and services for enterprises to enhance LLM context.
go-utcp
go-utcp is a scalable protocol for tool interaction across various systems.
QMT-MCP
QMT-MCP Modular Quantitative Trading Assistant
sample-agentic-ai-demos
Examples of building Agentic AI with AWS, featuring MCP server integration.