adk-rust-mcp-image
MCP server for image generation and upscaling. Part of the ADK Rust MCP toolkit.
Overview
Image generation server supporting text-to-image and image upscaling via the Vertex AI Imagen API. Supports multiple output formats including base64, local file, and cloud storage.
Currently implemented: Google Vertex AI (Imagen 3, Imagen 4)
Features
- Text-to-Image — Generate images from text prompts with Imagen 3/4
- Image Upscaling — Upscale images 2x or 4x with Imagen 4 Upscale
- Multiple Outputs — Generate up to 4 images per request
- Flexible Output — Return base64, save to local file, or upload to GCS
- Aspect Ratios — 1:1, 3:4, 4:3, 9:16, 16:9
- Model Aliases — Use friendly names like
imagen-3orimagen-3-fast - Dual API — Works with Gemini API key or Vertex AI ADC
Installation
Configuration
# Option 1: Gemini API (recommended for getting started)
# Option 2: Vertex AI (for production/enterprise)
# optional, for cloud storage output
Tools
image_generate
Generate images from text prompts.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt |
string | Yes | — | Text describing the image |
negative_prompt |
string | No | — | What to avoid |
model |
string | No | imagen-3.0-generate-002 |
Model ID or alias |
aspect_ratio |
string | No | 1:1 |
1:1, 3:4, 4:3, 9:16, 16:9 |
number_of_images |
int | No | 1 | Number of images (1-4) |
seed |
int | No | — | Random seed for reproducibility |
output_file |
string | No | — | Save to local file path |
output_uri |
string | No | — | Upload to GCS (e.g., gs://bucket/path) |
image_upscale
Upscale images to higher resolution.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
image |
string | Yes | — | Source image (base64, local path, or GCS URI) |
upscale_factor |
string | No | x2 |
x2 or x4 |
output_file |
string | No | — | Save to local file path |
output_uri |
string | No | — | Upload to GCS |
Usage Examples
Generate an image
# Stdio (default) — for Claude Desktop, Kiro
# HTTP — for web apps, ADK agents
# SSE — for streaming applications
Example prompts
prompt: "A cat sitting in the rain, watercolor style"
aspect_ratio: "16:9"
output_file: "cat_rain.png"
prompt: "Futuristic city skyline at sunset, cyberpunk aesthetic"
negative_prompt: "blurry, low quality"
number_of_images: 4
Upscale an image
image: "cat_rain.png"
upscale_factor: "x4"
output_file: "cat_rain_4x.png"
Supported Models
| Model | ID | Notes |
|---|---|---|
| Imagen 3 | imagen-3.0-generate-002 |
Default, high quality |
| Imagen 3 Fast | imagen-3.0-fast-generate-001 |
Faster, lower cost |
License
Apache-2.0