Labsco
MCP SERVER

Gemini Image Generator

by qhdrl12

Generate and edit images with Gemini from a chat — text to image, or an existing image transformed by a prompt, saved to a folder you choose.

Image GenerationVerified
Summary
Prefer the file-based transform; the README says why.

Transformation from base64 data moves the whole image through the protocol and is documented as noticeably slower, and on Claude Desktop the returned file paths may not resolve for the host. Pass a file path to `transform_image_from_file` where you can, and set `OUTPUT_IMAGE_PATH` to a directory you can open yourself so a path that the client cannot follow is still a file you can find.

What it is

An MCP server that puts Google's Gemini 2.0 Flash image generation behind three tools. It handles the parts around the model call: naming the file from the prompt, translating non-English prompts, saving to a configured directory, and returning both the raw image data and the saved path so a client can use whichever it can handle.

What you get
  • A new image from a text description, returned as raw bytes and as the path it was saved to — `generate_image_from_text`
  • An existing image on disk reworked according to a prompt — add something to the scene, change the time of day — `transform_image_from_file`
  • The same transformation from base64-encoded image data, for clients that hold the image in memory rather than on disk — `transform_image_from_encoded`
  • A filename generated from the prompt, so a folder of generated images stays readable, and non-English prompts translated before they reach the model
Requirements

A Google AI API key for Gemini, from AI Studio, in `GEMINI_API_KEY`; the key comes with a monthly free quota you can check in AI Studio. Set `OUTPUT_IMAGE_PATH` to an absolute directory — images are written there and the path is what gets returned. Python 3.11+, installed from a clone with `uv pip install -e .` and launched with `uv run`, or through the Smithery installer.

Setup effort

One command plus a key — npx -y @smithery/cli install @qhdrl12/mcp-server-gemini-image-gen --client claude, then supply credentials