Nano Banana 2 Lite, Revisited: MCP 2.0, the New Interactions API, and Three Agent CLIs
This article provides a step by step update guide for a Python MCP server that drives Google Nano Banana 2 Lite ( gemini-3.1-flash-lite-image ) through the Gemini Interactions API. Two dependency lines moved underneath it since it was first published: the MCP Python SDK went to 2.x, and the Interactions API dropped the schema that google-genai 1.x speaks. The same server is then registered with…
This article offers a step-by-step guide for updating a Python MCP server that drives Google's Nano Banana 2 Lite model through the Gemini Interactions API. Two changes have occurred since the article was first published: the MCP Python SDK moved to 2.x and the Interactions API discontinued the schema supported by google-genai 1.x. The same server is then registered with Claude Code, Codex, and Antigravity CLI, and validated against the live API.
Nano Banana 2 Lite is the nickname for Google's Gemini 3.1 Flash-Lite Image, a low-latency image generation and editing model. The secret sauce of the model is the Interactions API, which stores every call server-side and returns an interaction ID. By passing that ID back as previous_interaction_id, the model can edit the previously generated image rather than starting from a fresh prompt.
However, the Interactions API underwent changes that broke compatibility with the previous version. The server's code and the underlying SDK did not change, but the API moved away from the old schema. When using google-genai 1.x, the server would receive a BadRequestError indicating that the legacy Interactions API schema is no longer supported. To fix this issue, the SDK must be upgraded to version 2.0.0.
The response from google-genai 2.x differs from the previous version. Instead of returning a single image, the model's output arrives as a list of steps. The SDK provides an easy way to access the generated image through the output_image property of an Interaction object. If your code was manually parsing the legacy output fields, this change will affect you. A unit test that builds a real steps-schema Interaction with the SDK's own model can help catch these changes.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.