Skip to content

Bug TypeError: fetch failed when using generate_image with gemini-3-pro-preview #33

@wunsir

Description

@wunsir

Description

I am encountering a persistent error when attempting to generate images using the Nano Banana MCP tool.
My Setup:

  • I have access to the gemini-3-pro-preview model.
  • I have installed the Nano Banana MCP tool.
  • Authentication: I normally log in to the Gemini CLI using OAuth, but for this extension, I have specifically configured a separate API KEY.
  • All necessary environment variables have been set up.
    The Issue:
    Despite the configuration looking correct, every time I run the image generation command, it fails with a fetch failed error.

Error Log

x  generate_image (nanobanana MCP Server) {"prompt": "a diagram"}                      
MCP tool 'generate_image' reported tool error for function call: {"name":"generate_image","args":{"prompt":"a diagram"}} with response:     
{"functionResponse":{"name":"generate_image","response":{"error":{"message":"MCP error -32603: An unexpected error occurred: exception      TypeError: fetch failed sending request","isError":true}}}}]   

I have asked gemini for help, but it does not work.
I would appreciate it if you could help me with this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions