Spaces:
Paused
Paused
A newer version of the Gradio SDK is available:
6.5.1
metadata
title: ImageGenMCP
emoji: ๐จ
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false
license: mit
ImageGenMCP - Image Generation MCP Server
A Gradio-based image generation application using Google's Gemini 2.0 Flash Preview model, designed to work as an MCP (Model Context Protocol) server for Claude Code.
Features
- ๐จ High-quality image generation using Gemini 2.0 Flash Preview
- ๐ผ๏ธ Support for reference images to guide generation
- ๐ง MCP server integration for Claude Code
- ๐ Web interface powered by Gradio 5.31.0
- ๐ Detailed logging for debugging
Setup
Environment Variables
Set your Gemini API key:
export GEMINI_API_KEY="your-gemini-api-key"
Local Development
- Install dependencies:
pip install -r requirements.txt
- Run the application:
Web UI mode:
python app.py
MCP server mode:
python app.py --mcp
Usage with Claude Code
Add this configuration to your Claude Code settings:
{
"mcpServers": {
"image-gen": {
"command": "python",
"args": ["/path/to/app.py", "--mcp"],
"env": {
"GEMINI_API_KEY": "your-api-key"
}
}
}
}
API
MCP Tool: generate_image
Description: Generates images using Gemini 2.0 Flash Preview
Parameters:
prompt(string, required): Description of the image to generate
Returns:
success(boolean): Whether generation was successfulmessage(string): Status messageimage_url(string): URL to access the generated image (if successful)image_path(string): Local file path of the generated image (if successful)
Requirements
- Python 3.8+
- Gemini API key with access to
gemini-2.0-flash-preview-image-generationmodel - Dependencies listed in
requirements.txt
License
MIT