# Kokon

Generates and edits images offline via Qwen-Image 2.1 right from your coding assistant. Keeps all graphics rendering on your local GPU without cloud subscriptions.

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

## What it does

This package serves as a bridge between MCP clients and the Kokon desktop application to process graphics locally via Qwen-Image 2.1. Available tools cover text-to-image synthesis, masked inpainting, canvas expansion, and upscaling up to 8192 px. Every request stays on `127.0.0.1`. No data leaves your machine.

Execution requires Node.js 22 or higher. Without the desktop Kokon software installed and configured, this server cannot operate. You must complete the initial desktop setup to fetch the neural network weights. Hardware demands at least 12 GB VRAM on Windows or 16 GB on Apple Silicon. Initial model initialization takes around one minute.

File operations never overwrite existing files. Read and write permissions remain confined to the active project folder or paths defined in `QLS_MCP_ALLOWED_DIRS`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `QLS_MCP_ALLOWED_DIRS` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env QLS_MCP_ALLOWED_DIRS=<QLS_MCP_ALLOWED_DIRS> --transport stdio mcp -- npx -y kokon-mcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp --env QLS_MCP_ALLOWED_DIRS=<QLS_MCP_ALLOWED_DIRS> -- npx -y kokon-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp": {
            "command": "npx",
            "args": [
                "-y",
                "kokon-mcp"
            ],
            "env": {
                "QLS_MCP_ALLOWED_DIRS": "<QLS_MCP_ALLOWED_DIRS>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "kokon-mcp"
            ],
            "env": {
                "QLS_MCP_ALLOWED_DIRS": "<QLS_MCP_ALLOWED_DIRS>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e QLS_MCP_ALLOWED_DIRS=<QLS_MCP_ALLOWED_DIRS> mcp npx -y kokon-mcp
```
Replace <…> with your own values

## When to use it
- render graphics from prompts and references directly into the repository
- modify masked regions or extend borders on local image assets
- upscale illustrations up to 8192 px without sending data to external APIs
- inspect current GPU memory allocation and active task queues

## Example prompts
- Generate a hero banner for this `README.md` and save the result into `docs/`
- Clean up the background details in `screenshot.png` using `inpaint_image`
- Double the resolution of `logo.png` with `upscale_image`

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107423
- [Agent Skills Search Server](https://affpapa.org/en/nevibecode/mcp/agent-skills-search-server.md) — MCP server · ★ 26559
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [PraisonAI](https://affpapa.org/en/nevibecode/mcp/praisonai.md) — MCP server · ★ 9289

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