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.
  • 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.
  • output_filename (string, optional): Base name for the output(s), e.g. hero.png. The extension is forced to the true image type and, when more than one image is generated, a _1..n suffix is inserted before the extension. Applied identically to local files and GCS objects. See Naming Outputs.
  • gcs_bucket_uri (string, optional): GCS URI prefix to store any generated images.

When images are uploaded to GCS, the tool appends one MCP resource_link content item per image (uri = the gs:// URI, plus name, mimeType, and a 1-based description); the text summary is unchanged. See Resource Links for GCS Outputs.

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 Google Cloud 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