Teaching Claude Code to Paint: A Stateful Image-Editing Skill Built on Gemini's Interactions API and MCP A developer built a stateful image-editing skill for Claude Code by wrapping Google's gemini-3.1-flash-lite-image model in a FastMCP server. The tool, called nb2lite-skill-claude, uses Gemini's Interactions API to allow iterative edits without re-prompting the entire scene. The developer said, 'You type "generate an image of a cyberpunk kitchen" into Claude Code, and it just... does it. Then you say "add a neon RAMEN sign" and it edits the same image without re-prompting the whole scene.' TL;DR: nb2lite-skill-claude wraps Google's gemini-3.1-flash-lite-image model in a tiny FastMCP server and packages it as a Claude Code skill. You type "generate an image of a cyberpunk kitchen" into Claude Code, and it just... does it. Then you say "add a neon RAMEN sign" and it editsthe same imagewithout re-prompting the whole scene. Oh, and the cover image of this article? Generated by the thing the article is about — dogfooding all the way down. More on that at the end. Most image-generation workflows are stateless . You send a prompt, you get pixels back, and the model immediately forgets everything. Want to tweak the result? You re-describe the entire scene and pray the character, lighting, and composition survive the round trip. Narrator: they don't. Google's Nano Banana 2 Lite — the friendly nickname for gemini-3.1-flash-lite-image — takes a different approach. It's a high-efficiency image model with sub-2-second generations, solid text rendering in 25+ languages, and — the headline feature — support for the stateful Interactions API , which lets you iterate on an image across multiple turns while the model keeps the visual context server-side. This repo glues that capability into Claude Code , so your coding agent can generate and iteratively refine images as a natural part of a session. It ships as two things in one repo: nb2lite-agent , a single-file FastMCP app in server.py exposing exactly four tools. nb2lite-image that teaches Claude The Interactions API is Gemini's stateful endpoint. The core loop looks like this: client.interactions.create ... with a prompt and store=True . interaction id previous interaction id , and the model edits the So instead of this stateless suffering : "A watercolor fox in a forest at dawn, mist, soft light, wearing a red scarf, three birch trees on the left, and now alsoholding a lantern" ...you write this: "Add a lantern in its paw." That's it. The stored context holds the rest. A few practical details the server handles for you: 1:1 , 16:9 , 9:16 , 4:3 , 3:4 and low default, fast drafts or high complex rendering, accurate text layout, character composition . The generic API spec also lists minimal and medium , but the live API rejects them for this model with an HTTP 400 — the server saves you from discovering that the hard way.The Model Context Protocol is an open standard for connecting AI assistants to tools and data. Before it, giving a model access to some service meant writing a bespoke integration for each assistant — N assistants × M services, everyone reinventing the same plumbing. MCP collapses that: a tool author writes one MCP server that exposes typed tools, and any MCP-capable client Claude Code, Claude Desktop, and a growing list of others can discover and call them with no per-client glue code. An MCP server is usually a small local process that speaks JSON-RPC over stdio. The client launches it, asks "what tools do you have?", and from then on the model can call them like functions. The nb2lite-agent server exposes exactly four: | Tool | What it does | |---|---| generate image | Text → 1k image. Saves locally, returns the path + an interaction ID. | edit image | Stateful edit: takes the previous interaction ID + a description of only the change. | edit local image | Uploads any local image file inline base64 and applies an edit — your entry point for existing files. | get help | Reports live config: API key status, active model, output directory, full tool reference. | Images land on disk as gen