kokon-mcp
MCP server for Kokon. It lets Claude Code, Cursor, Claude Desktop and other
MCP clients generate and edit images with Qwen-Image 2.1, running offline on your own GPU.
No API key, no cloud. Everything stays on 127.0.0.1.
Requires the Kokon desktop app (Windows with a 12 GB+ GPU: NVIDIA, or AMD/Intel in beta;
or an Apple Silicon Mac, beta, 16 GB+). Download it from kokon.app, open it once and
finish the setup so the model is downloaded. This package is only the bridge between your AI
agent and the app. The app doesn't need to be open: the server starts the engine on demand.
Setup
Claude Code:
Any client that takes the standard JSON config (.mcp.json, Claude Desktop, Cursor...):
Needs Node.js 22 or newer. The Kokon installer also ships the same server as a standalone
executable (kokon-mcp.exe / kokon-mcp inside the app), if you prefer not to use Node. See the
main README.
Then ask: "Generate a hero image for this README and save it in docs/" or "Remove the background
clutter from screenshot.png". The first call takes about a minute while the model loads.
Tools
Prompts are used exactly as your assistant writes them: Kokon's own prompt writer (Prompt+) does not
run for MCP, so the assistant writes the full description. The tool descriptions tell it how.
Behavior and safety
- Every result returns the absolute path of the saved file, its size, seed and metadata.
- Reads and writes are limited to the project folder (
CLAUDE_PROJECT_DIR or the working
directory), Kokon's output folder and folders listed in QLS_MCP_ALLOWED_DIRS (separated by
semicolons). Existing files are never overwritten.
- Images are not sent back to the model by default. Pass
include_preview: true for a small JPEG.
- Progress is reported through MCP progress notifications.
License
AGPL-3.0-only. The Qwen-Image 2.1 model weights the app downloads are under the Qwen Research
License (non-commercial). Source: github.com/GabrieleLozupone/kokon.