nano-banana-mcp
Provides tools for generating, editing, and composing images using Google's Gemini 2.5 Flash Image model.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nano-banana-mcpgenerate a watercolor image of a cat astronaut"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nano-banana-mcp
Servidor MCP (Model Context Protocol) en TypeScript que expone Nano Banana —el modelo de imagen Gemini 2.5 Flash Image de Google— a Claude. Permite generar, editar y componer imágenes desde Claude Desktop, Claude Code o cualquier cliente MCP.
Capacidades (tools)
Tool | Descripción | Entradas |
| Texto → imagen |
|
| Imagen + texto → imagen (inpainting, estilo, retoques) |
|
| N imágenes + texto → imagen (fusión, composición, transferencia de estilo) |
|
Las imágenes de entrada (image / images) aceptan: ruta a archivo local,
data URL (data:image/png;base64,...) o base64 crudo.
Las imágenes de salida se devuelven inline en base64 en la respuesta del tool.
Related MCP server: NanoBanana MCP
Requisitos
Node.js >= 18
Una API key de Google AI Studio: https://aistudio.google.com/apikey
Instalación
npm install
npm run buildCopia .env.example a .env y coloca tu key:
cp .env.example .env
# edita .env -> GEMINI_API_KEY=...El
.enves solo para desarrollo local. Al conectarlo a un cliente MCP, la key se pasa por la variable de entorno del propio cliente (ver abajo).
Conectar a Claude
Claude Code (CLI)
claude mcp add nano-banana \
-e GEMINI_API_KEY=tu_api_key \
-- node /ruta/absoluta/nano-banana-mcp/dist/index.jsClaude Desktop
Edita claude_desktop_config.json:
{
"mcpServers": {
"nano-banana": {
"command": "node",
"args": ["/ruta/absoluta/nano-banana-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "tu_api_key"
}
}
}
}Reinicia el cliente y pídele, por ejemplo: "genera una imagen de un gato astronauta en acuarela".
Desarrollo
npm run dev # ejecuta con tsx (sin compilar)
npm run typecheck # verifica tipos
npm run build # compila a dist/Prueba rápida del protocolo (sin key, solo lista tools):
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0.0.0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| node dist/index.jsConfiguración
Variable | Requerida | Por defecto | Descripción |
| Sí | — | API key de Google AI Studio |
| No |
| Modelo de imagen a usar |
Ambientes
La configuración por ambiente (local / integración / QA / producción) está
documentada en docs/environments/. Las decisiones de
arquitectura en docs/architecture/.
Notas
En un servidor stdio,
stdoutestá reservado para el protocolo MCP; los logs de diagnóstico van astderr.Nunca comitees tu
.envni la API key (ya está en.gitignore).
Available Tools
3 toolscompose_imagesComponer imágenes (Nano Banana)A
Combina varias imágenes en una sola según un prompt (composición, fusión, transferencia de estilo, consistencia de personaje). Cada imagen puede ser ruta local, data URL o base64.
| Name | Required | Description | Default |
|---|---|---|---|
| images | Yes | Lista de 2 o más imágenes de entrada (rutas, data URLs o base64). | |
| prompt | Yes | Instrucción de cómo combinar las imágenes. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the operation and acceptable input formats (local paths, data URLs, base64), but it does not disclose output format, limitations, or potential failure modes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the main action and then provides supporting details about input formats. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has moderate complexity with two parameters and no output schema. The description explains the operation and use cases, but it doesn't explicitly state the return value or constraints such as maximum image count or size, leaving some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides descriptions for both parameters with 100% coverage. The description adds no new parameter semantics beyond repeating the input format information already present in the schema, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific verb 'Combina' (combines) and the resource 'varias imágenes en una sola' (multiple images into one), distinguishing it from sibling tools generate_image and edit_image which handle single-image operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool (multi-image composition) and enumerates specific use cases (composition, fusion, style transfer, character consistency). However, it does not explicitly mention alternatives or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
edit_imageEditar imagen (Nano Banana)A
Edita una imagen existente según un prompt (inpainting, cambio de estilo, retoques). La imagen puede ser una ruta a un archivo local, un data URL o base64 crudo.
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Imagen de entrada: ruta a archivo local, data URL o base64. | |
| prompt | Yes | Instrucción de edición a aplicar sobre la imagen. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden. It does not disclose whether the original image is modified in place, what the return value is, or any side effects. It only lists edit types and image input formats, which is more about purpose and parameters than behavioral transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action ('Edita una imagen existente según un prompt') and immediately followed by concrete examples. Every sentence earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers what the tool does and input formats, but omits what the tool returns (presumably the edited image) and any behavioral caveats. Given the tool's moderate complexity and lack of output schema, this is a notable gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already covers both parameters fully (100% coverage). The description adds value by providing examples of edit types ('inpainting, cambio de estilo, retoques'), which clarifies the expected prompt semantics beyond the schema's generic 'Instrucción de edición.'
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool edits an existing image based on a prompt, listing specific use cases (inpainting, style change, retouching). It distinguishes from siblings: generate_image creates new images, compose_images combines images, while edit_image modifies an existing one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool: when you have an existing image and want to modify it via a prompt. However, it does not explicitly mention alternatives or exclusions, though the context is clear enough for an agent to decide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageGenerar imagen (Nano Banana)A
Genera una imagen a partir de un prompt de texto usando Gemini 2.5 Flash Image (Nano Banana). Devuelve la imagen en base64.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Descripción detallada de la imagen a generar. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It transparently states that the output is a base64-encoded image and specifies the model used. However, it does not disclose potential non-determinism, API costs, or any failure behavior. While the generation action is inherently non-destructive, the description is adequate but not rich in details, meriting a 3.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is exceptionally concise, containing just two sentences. It front-loads the primary action ('Genera una imagen') and immediately provides the model and output format. Every word earns its place; no superfluous information, making it highly efficient for an agent to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with a single parameter, no output schema, and no nested objects, the description is complete. It explains what the tool does, the input, the model, and the return format ('Devuelve la imagen en base64'). There is no ambiguity for this simple tool, and the description fully covers its context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 100% coverage for the single parameter (prompt), so the baseline is 3. The description adds no additional parameter semantics beyond what the schema already provides; it simply restates that the image is generated from a text prompt. No extra clarification about prompt formatting or constraints is offered.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates an image from a text prompt, with a specific verb (genera), resource (imagen), and input (prompt de texto). It also identifies the underlying model (Gemini 2.5 Flash Image) and mentions the output format (base64), which distinguishes it from sibling tools like edit_image and compose_images that likely modify or compose existing images.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when to use the tool: when you need to generate an image from a text prompt. It does not explicitly mention alternatives or exclusions, but the sibling tool names (edit_image, compose_images) imply different use cases. Since it lacks explicit 'when not to use' guidance, it falls short of a 5 but meets the 'clear context' criterion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
compose_images - First observed
edit_image - First observed
generate_image
TDQS
Scored across 3 tools
Each tool serves a distinct purpose: generate creates from scratch, edit modifies a single existing image, and compose blends multiple images. No overlap or ambiguity in their scopes.
All tool names follow a consistent verb_noun pattern: generate_image, edit_image, compose_images. The pattern is uniform and predictable.
Three tools is a well-scoped set for an image generation server focused on create, edit, and compose operations. Each tool is essential and none are redundant.
The surface covers the core image workflows (generation, editing, composition). Minor gaps like image analysis or format conversion exist, but these are not critical for the primary purpose.
Maintenance
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Qwen Image 3 AI image generation
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for Flux AI image generation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides image generation using Google's Nano Banana Gemini models, with additional tools for background removal, upscaling, and format conversion via deterministic post-processing.1MIT
- AlicenseAqualityCmaintenanceMCP server that brings Gemini's image generation and editing capabilities to Claude Desktop, Claude Code, and Cursor. Supports Nano Banana 2 (Flash) and Nano Banana Pro models.7764 npm32MIT
- FlicenseNot gradedqualityDmaintenanceA remote MCP server that gives Claude the ability to generate and edit images with Google's nano banana (Gemini 2.5 Flash Image) model.-
- AlicenseNot gradedqualityDmaintenanceMCP server for Google's Nano Banana image generation models (Gemini). Generate and edit images via natural language.7 npm1MIT