Provides tools for generating images from text prompts and editing existing images using Google Gemini's image generation APIs, with support for both official Gemini API and Gemini-compatible third-party gateways.
Supports uploading generated and edited images to MinIO object storage, returning accessible URLs for the stored images.
Click on "Install 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., "@NanoBananaProgenerate an image of a futuristic city with flying cars at sunset"
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.
GenAI MCP Server
This project implements a Model Context Protocol (MCP) server for image generation and image editing using Google Gemini, Tongyi Wanxiang, plus optional automatic upload of generated images to S3‑compatible object storage (AWS S3, Aliyun OSS, etc.).
The server exposes a streamable HTTP MCP endpoint and provides tools for Gemini, Wan, and APIMart.
Provider matrix
Provider | Supported Models | Config | Notes |
· · |
| Official Gemini | |
dmxapi | · · |
| Gemini‑compatible gateway |
aliyun | · · |
| Tongyi Wanxiang |
apimart | · |
| APIMart Gemini wrapper (cost‑effective) |
1. Prerequisites
Go 1.21+ (recommended)
A valid Gemini (or provider) API key
Optional: S3 / OSS bucket for storing images
2. Configuration (.env)
Copy env.example to .env, then fill in real values.
GenAI configuration
HTTP server
MCP endpoint:
OSS / S3 configuration (optional, required when
When GENAI_IMAGE_FORMAT=url:
For Aliyun OSS: ensure
OSS_ENDPOINTlikeoss-cn-beijing.aliyuncs.comand bucket policy allows expected read access.
3. Running the MCP Server
You can run the MCP server in two ways:
Clone & build from source
Clone this repo and enter the project root
Copy
env.exampleto.envand fill in your configurationRun:
go build . ./genai-mcp
Download release binary
Download the appropriate binary from the Releases page
Place it in a directory of your choice
Copy
env.example(from repo or release asset) to.envand update configurationRun (binary name may vary by platform):
./genai-mcp
Default MCP HTTP endpoint:
Connect from any MCP‑compatible client supporting streamable HTTP transport.
4. MCP Tools
Gemini tools (internal/tools/gemini.go)
gemini_generate_imageInput:
prompt(string, required)Output: base64 data URI or URL (optional OSS upload)
gemini_edit_imageInput:
prompt(required),image_urls(required, JSON array)Output: base64 data URI or URL
When GENAI_IMAGE_FORMAT=url, images are downloaded/decoded then uploaded to OSS/S3 under images/yyyy-MM-dd/{uuid_timestamp_random}.ext.
Wan tools (internal/tools/wan.go)
wan_create_generate_image_taskwan_query_generate_image_taskwan_create_edit_image_taskwan_query_edit_image_task
Wan is async; create a task then poll for completion.
APIMart tools (internal/tools/apimart.go)
apimart_create_generate_image_taskapimart_query_generate_image_taskapimart_create_edit_image_taskapimart_query_edit_image_task
APIMart is async; tools return the final image (URL or base64) once the task is completed.
5. Contact
WeChat: Scan the QR code below to add as a friend

Discord: Join the community