Skip to content

armgit / kokon

Public Imported from GitHub
0

Edit photos by describing the change, on your own GPU. A free, open-source alternative to Nano Banana and ChatGPT image editing: photos stay on your computer, no daily limit. One installer for Windows, Mac and Linux sets up the best open model (Qwen-Image 2.1). MCP server for AI agents.

14.5 KB
Raw Blame
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Free Local Image Generation MCP Server for Claude Code and Cursor (No API Key)</title>
<meta name="description" content="Let Claude Code, Cursor or any MCP client create and edit images on your own GPU with Qwen-Image 2.1. Free, offline, no API key. Setup for Windows, Mac and Linux, tools and example prompts.">
<meta name="author" content="Gabriele Lozupone">
<meta name="robots" content="index, follow, max-image-preview:large">
<meta name="theme-color" content="#0a0a0a">
<link rel="canonical" href="https://kokon.app/mcp-image-generation/">
<link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">
<link rel="icon" href="../assets/favicon.ico" sizes="any">
<link rel="apple-touch-icon" href="../assets/apple-touch-icon.png">
<meta property="og:site_name" content="Kokon">
<meta property="og:type" content="article">
<meta property="og:title" content="Free local image generation for Claude Code and MCP clients">
<meta property="og:description" content="An MCP server that creates and edits images on your GPU with Qwen-Image 2.1. No API key, no cloud, no cost.">
<meta property="og:url" content="https://kokon.app/mcp-image-generation/">
<meta property="og:image" content="https://kokon.app/assets/img/hero.webp">
<meta name="twitter:card" content="summary_large_image">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,[email protected],400..700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../assets/style.css?v=14">
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "TechArticle",
      "headline": "Free Local Image Generation MCP Server for Claude Code and Cursor (No API Key)",
      "description": "Set up Kokon's MCP server so AI agents can create and edit images on your own GPU with Qwen-Image 2.1.",
      "image": "https://kokon.app/assets/img/hero.webp",
      "datePublished": "2026-10-10",
      "dateModified": "2026-10-10",
      "author": { "@type": "Person", "name": "Gabriele Lozupone", "url": "https://gabrielelozupone.github.io/" },
      "about": [{ "@type": "Thing", "name": "Model Context Protocol" }, { "@type": "SoftwareApplication", "name": "Kokon", "url": "https://kokon.app/" }],
      "mainEntityOfPage": "https://kokon.app/mcp-image-generation/"
    },
    {
      "@type": "BreadcrumbList",
      "itemListElement": [
        { "@type": "ListItem", "position": 1, "name": "Kokon", "item": "https://kokon.app/" },
        { "@type": "ListItem", "position": 2, "name": "MCP image generation", "item": "https://kokon.app/mcp-image-generation/" }
      ]
    },
    {
      "@type": "FAQPage",
      "mainEntity": [
        { "@type": "Question", "name": "Can Claude Code generate images without an API key?", "acceptedAnswer": { "@type": "Answer", "text": "Yes, with a local MCP server such as Kokon's kokon-mcp: images are made by Qwen-Image 2.1 on your own GPU, so there is no API key and no per-image cost." } },
        { "@type": "Question", "name": "Does the Kokon app need to be open for the MCP server to work?", "acceptedAnswer": { "@type": "Answer", "text": "No. The MCP server starts the engine on demand. The first call takes about a minute while the model loads; without the desktop window open, the model is unloaded after 15 idle minutes." } },
        { "@type": "Question", "name": "Are my images sent to the AI model?", "acceptedAnswer": { "@type": "Answer", "text": "No. Results stay on disk and the tool returns their path. A small JPEG preview is included only if the agent asks for it with include_preview." } }
      ]
    }
  ]
}
</script>
</head>
<body>
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
  <defs>
    <symbol id="mark" viewBox="0 0 1024 1024"><path d="M0.00 242.81 C0.00 112.17 70.23 25.08 175.59 25.08 C280.94 25.08 351.17 112.17 351.17 242.81 L351.17 781.19 C351.17 911.83 280.94 998.92 175.59 998.92 C70.23 998.92 0.00 911.83 0.00 781.19 Z M389.53 548.95 C389.53 250.35 662.35 25.08 1024.00 25.08 C1024.00 323.68 751.18 548.95 389.53 548.95 Z M389.53 587.31 C389.53 821.93 618.71 998.92 922.49 998.92 C922.49 764.30 693.31 587.31 389.53 587.31 Z" fill="currentColor"/></symbol>
  </defs>
</svg>

<header class="nav scrolled" id="nav">
  <div class="wrap">
    <a class="logo" href="../" aria-label="Kokon home"><svg><use href="#mark"/></svg>Kokon</a>
    <nav class="nav-links" id="nav-links" aria-label="Site">
      <ul>
        <li class="dd"><button type="button" aria-expanded="false" aria-controls="dd-product">Product<svg class="caret" viewBox="0 0 12 12" aria-hidden="true"><path d="M3 4.5 6 7.5 9 4.5"/></svg></button>
          <div class="dd-panel" id="dd-product"><ul>
            <li><a href="/#examples"><b>Examples</b><span>Real edits, before and after</span></a></li>
            <li><a href="/#features"><b>Features</b><span>Edit, paint, combine, expand, upscale</span></a></li>
            <li><a href="/#layers"><b>Layers lab <span class="new">New</span></b><span>Split an image, move the pieces</span></a></li>
            <li><a href="/#devices"><b>On your phone</b><span>Use your GPU from any device</span></a></li>
            <li><a href="/mcp-image-generation/"><b>For AI agents</b><span>MCP server and HTTP API</span></a></li>
            <li><a href="/#requirements"><b>Requirements</b><span>GPUs, Macs and disk space</span></a></li>
          </ul></div></li>
        <li class="dd"><button type="button" aria-expanded="false" aria-controls="dd-guides">Guides<svg class="caret" viewBox="0 0 12 12" aria-hidden="true"><path d="M3 4.5 6 7.5 9 4.5"/></svg></button>
          <div class="dd-panel" id="dd-guides"><ul>
            <li><a href="/qwen-image-2-1-local/"><b>Setup guide</b><span>Install and run Qwen-Image 2.1</span></a></li>
            <li><a href="/self-hosted/"><b>Phone and server</b><span>Other devices, Linux, Docker, Tailscale</span></a></li>
            <li><a href="/prompt-guide/"><b>Prompt guide</b><span>Write prompts that work</span></a></li>
            <li><a href="/remove-objects-from-photos-offline/"><b>Remove objects</b><span>Step by step, offline</span></a></li>
            <li><a href="/image-to-layers/"><b>Image to layers <span class="new">New</span></b><span>Split a photo, export a PSD</span></a></li>
            <li><a href="/uninstall/"><b>Uninstall</b><span>Remove Kokon and its models</span></a></li>
          </ul></div></li>
        <li class="dd"><button type="button" aria-expanded="false" aria-controls="dd-compare">Compare<svg class="caret" viewBox="0 0 12 12" aria-hidden="true"><path d="M3 4.5 6 7.5 9 4.5"/></svg></button>
          <div class="dd-panel" id="dd-compare"><ul>
            <li><a href="/local-ai-photo-editor/"><b>Local AI photo editor</b><span>Why edit on your own computer</span></a></li>
            <li><a href="/offline-alternative-to-nano-banana/"><b>vs Nano Banana</b><span>Offline alternative to cloud editing</span></a></li>
            <li><a href="/comfyui-alternative/"><b>vs ComfyUI</b><span>Simpler, no nodes, no Python</span></a></li>
            <li><a href="/ai-image-editing-from-your-phone/"><b>From your phone</b><span>Kokon vs ComfyUI with --listen</span></a></li>
          </ul></div></li>
        <li><a class="top" href="/#faq">FAQ</a></li>
      </ul>
      <p class="nav-more"><a href="https://github.com/GabrieleLozupone/kokon" rel="noopener">GitHub</a><a href="/press/">Press kit</a></p>
      <a class="btn kofi-btn" href="https://ko-fi.com/gabrielelozupone" target="_blank" rel="noopener"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20.5s-7.3-4.4-9.3-8.9C1.2 8.3 3.2 4.5 6.8 4.5c2.1 0 3.5 1.1 4.3 2.5h1.8c.8-1.4 2.2-2.5 4.3-2.5 3.6 0 5.6 3.8 4.1 7.1-2 4.5-9.3 8.9-9.3 8.9z"/></svg>Support Kokon on Ko-fi</a>
    </nav>
    <span class="spacer"></span>
    <a class="gh" href="https://github.com/GabrieleLozupone/kokon" rel="noopener"><svg width="18" height="18" fill="currentColor"><use href="#github"/></svg>GitHub</a>
    <a class="kofi" href="https://ko-fi.com/gabrielelozupone" target="_blank" rel="noopener"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 20.5s-7.3-4.4-9.3-8.9C1.2 8.3 3.2 4.5 6.8 4.5c2.1 0 3.5 1.1 4.3 2.5h1.8c.8-1.4 2.2-2.5 4.3-2.5 3.6 0 5.6 3.8 4.1 7.1-2 4.5-9.3 8.9-9.3 8.9z"/></svg>Support</a>
    <a class="btn primary small" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener" data-dl-auto>Download</a>
    <button class="burger" type="button" aria-expanded="false" aria-controls="nav-links" aria-label="Open menu"><span class="bars"><span></span><span></span></span><span class="lbl">Menu</span></button>
  </div>
</header>

<main class="article">
  <div class="wrap narrow">
    <nav class="crumbs" aria-label="Breadcrumb"><a href="../">Kokon</a> <span>/</span> MCP</nav>
    <h1>Free local image generation for Claude Code and MCP clients</h1>
    <p class="lede-left">Most image MCP servers forward your prompt to a paid cloud API. Kokon's runs Qwen-Image 2.1 on your own GPU: no API key, no cost per image, nothing uploaded.</p>

    <div class="term" aria-label="Claude Code calling Kokon">
      <div class="term-head"><i></i><i></i><i></i><span style="margin-left:8px">my-website</span></div>
      <div class="term-body">
        <div class="w"><span class="c">&gt;</span> Make a hero image for my landing page: a blue morpho butterfly on a silk cocoon, 16:9</div>
        <div style="margin-top:10px"><span class="w">● kokon</span> <span class="d">· generate_image</span></div>
        <div class="d" style="padding-left:20px">aspect_ratio: "16:9" · quality: "quality"</div>
        <div style="padding-left:20px"><span class="c">⎿</span> Saved public/hero.png · 2752×1536 · 39 s</div>
        <img src="../assets/img/hero.webp" width="1800" height="1005" alt="A blue morpho butterfly on a silk cocoon, generated locally by Kokon for an AI agent">
      </div>
    </div>

    <h2>What your agent can do</h2>
    <div class="table-wrap">
      <table class="cmp-table">
        <thead><tr><th>Tool</th><th class="us">What it does</th></tr></thead>
        <tbody>
          <tr><td><code>generate_image</code></td><td class="us">Create an image from a prompt; aspect ratio from the prompt ("16:9 hero") or explicit</td></tr>
          <tr><td><code>edit_image</code></td><td class="us">Edit a photo with an instruction, keeping its size</td></tr>
          <tr><td><code>edit_images</code></td><td class="us">Combine several images ("put the product from image 1 on the table in image 2")</td></tr>
          <tr><td><code>inpaint_image</code></td><td class="us">Change only a masked area: edit, remove, replace or add</td></tr>
          <tr><td><code>outpaint_image</code></td><td class="us">Extend an image beyond its borders, in pixels or percent</td></tr>
          <tr><td><code>upscale_image</code></td><td class="us">Enlarge up to 8192 px</td></tr>
          <tr><td><code>get_image_info</code></td><td class="us">Size, format and the generation metadata of an image</td></tr>
          <tr><td><code>get_generator_status</code></td><td class="us">GPU, VRAM, whether the model is loaded, the queue</td></tr>
        </tbody>
      </table>
    </div>

    <h2>Set it up</h2>
    <p>Install <a href="../">Kokon</a> and run its first-time setup once (it downloads the model). Then register the MCP server.</p>
    <h3>Claude Code on Windows</h3>
    <pre><code>claude mcp add --scope user kokon -- "$env:LOCALAPPDATA\Kokon\kokon-mcp.exe"</code></pre>
    <h3>Claude Code on Mac</h3>
    <pre><code>claude mcp add --scope user kokon -- /Applications/Kokon.app/Contents/MacOS/kokon-mcp</code></pre>
    <h3>Cursor and other MCP hosts</h3>
    <p>Any host that takes the standard JSON config (on a Mac the command is <code>/Applications/Kokon.app/Contents/MacOS/kokon-mcp</code>):</p>
    <pre><code>{
  "mcpServers": {
    "kokon": {
      "type": "stdio",
      "command": "C:\\Users\\&lt;you&gt;\\AppData\\Local\\Kokon\\kokon-mcp.exe",
      "args": []
    }
  }
}</code></pre>
    <p>The desktop app does not need to be open: the server starts the engine on demand. The first call takes about a minute while the model loads.</p>

    <h2>Prompts to try</h2>
    <ul>
      <li>"Generate a 16:9 hero image for this README and save it in docs/"</li>
      <li>"Remove the background clutter from screenshot.png"</li>
      <li>"Make three product shots of assets/mug.png: marble counter, wooden desk, outdoor café"</li>
      <li>"Extend banner.png to 21:9, continuing the sky"</li>
      <li>"Create an app icon, a flat orange fox on a dark background, 1:1"</li>
    </ul>

    <h2>Safe by default</h2>
    <ul>
      <li>Reads and writes are limited to the project folder, Kokon's output folder and folders you allow with <code>QLS_MCP_ALLOWED_DIRS</code>. Existing files are never overwritten.</li>
      <li>Images stay on disk; the tool returns their path, size, seed and metadata. A small preview goes back to the model only when it asks for one (<code>include_preview</code>).</li>
      <li>Everything runs on <code>127.0.0.1</code>. No account, no telemetry, no prompts in the logs.</li>
    </ul>

    <h2>Requirements</h2>
    <p>A Windows PC with a 12 GB NVIDIA, AMD or Intel Arc GPU, or an Apple Silicon Mac (32 GB recommended). On an RTX 5070 Ti a new image at native 2K takes about 36 s and an edit at 1.5K about 24 s. Details in the <a href="../qwen-image-2-1-local/">setup guide</a>.</p>

    <div class="cta-box">
      <h2>Give your agent a GPU</h2>
      <p>Kokon is free and open source.</p>
      <div class="ctas" style="justify-content:flex-start">
        <a class="btn primary" href="https://github.com/GabrieleLozupone/kokon/releases/latest" rel="noopener">Download Kokon</a>
        <a class="btn ghost" href="https://github.com/GabrieleLozupone/kokon#use-it-from-your-ai-agent" rel="noopener">MCP docs on GitHub</a>
      </div>
    </div>
  </div>
</main>

<footer>
  <div class="wrap">
    <a class="logo" href="../"><svg><use href="#mark"/></svg>Kokon</a>
    <span>Designed and built by <a class="me" href="https://gabrielelozupone.github.io/" rel="author">Gabriele Lozupone</a>, with the help of Claude Code.</span>
    <nav aria-label="Links">
      <a href="../">Home</a>
      <a href="../qwen-image-2-1-local/">Setup guide</a>
      <a href="https://github.com/GabrieleLozupone/kokon" rel="noopener">GitHub</a>
      <a href="../support/">Support Kokon</a>
    </nav>
  </div>
</footer>
<script src="/download.js" defer></script>
<script src="/nav.js" defer></script>
</body>
</html>