Skip to content

`mcp-nanobanana-go` MCP Server

This server provides an MCP interface to Google’s NanoBanana (Gemini Image) models, allowing for multimodal content generation.

Generates content (text and/or images) based on a multimodal prompt.

Parameters:

  • prompt (string, required): The text prompt for content generation.
  • model (string, optional): The specific NanoBanana (Gemini Image) model to use. Defaults to gemini-3.1-flash-image-preview.
  • images (string array, optional): A list of local file paths or GCS URIs for input images.
  • output_directory (string, optional): Local directory to save any generated image(s) to.
  • gcs_bucket_uri (string, optional): GCS URI prefix to store any generated images.

The tool utilizes the following environment variables:

  • GOOGLE_CLOUD_PROJECT (string): Required. Your Google Cloud Project ID.
    • Override: You can override this globally for this specific server by setting NANOBANANA_PROJECT_ID.
  • GOOGLE_CLOUD_LOCATION (string): The preferred Google Cloud location/region for Vertex AI services.
    • Default: "us-central1"
    • Fallback: LOCATION is also supported as a fallback for GOOGLE_CLOUD_LOCATION.
    • Override: You can override this globally for this specific server by setting NANOBANANA_LOCATION.
  • ALLOW_UNSAFE_MODELS (boolean): Optional (true/false). Allows users to bypass strict local model constraint validation, enabling them to test experimental or pre-release model strings that are not yet hardcoded in the registry.
    • Default: false
  • ENABLE_OPTIONAL_HEADER_CAPTURE (boolean): Optional (true/false). Intended for internal debugging. When set to true, the server intercepts API requests and injects the raw ADC Bearer token to capture and surface the x-goog-sherlog-link header in the tool output. This feature is supported for NanoBanana.
    • Default: false
Terminal window
export GOOGLE_CLOUD_PROJECT=your-gcp-project
mcptools call nanobanana_image_generation \
--params '{"prompt": "a picture of a cat sitting on a table", "output_directory": "./output"}' \
mcp-nanobanana-go