Data · MODEL CONTEXT PROTOCOL
qhdrl12 mcp server gemini image generator
MCP server for AI image generation and editing using Google's Gemini Flash models. Create images from text prompts with intelligent filename generation and strict text exclusion. Supports text-to-image generation with future expansion to image editing capabilities.
WHAT IT CONNECTS
qhdrl12 mcp server gemini image generator 为 AI Agent 提供什么
- Text-to-image generation using Gemini 2.0 Flash
- Image-to-image transformation based on text prompts
- Support for both file-based and base64-encoded images
- Automatic intelligent filename generation based on prompts
- Automatic translation of non-English prompts
- Local image storage with configurable output path
- Strict text exclusion from generated images
- High-resolution image output
- Direct access to both image data and file path
- `prompt`: Text description of the image you want to generate
- A tuple containing:
- Raw image data (bytes)
- Path to the saved image file (str)
- "Generate an image of a sunset over mountains"
- "Create a photorealistic flying pig in a sci-fi city"
- **Performance Issues**: Using `transform_image_from_encoded` may take significantly longer to process compared to other methods. This is due to the overhead of transferring large base64-encoded image data through the MCP protocol.
- **Path Resolution Problems**: There may be issues with correctly resolving image paths when using Claude Desktop Host. The host application might not properly interpret the returned file paths, making it difficult to access the generated images.
- `encoded_image`: Base64 encoded image data with format header (must be in format: "data:image/[format];base64,[data]")
- `prompt`: Text description of how you want to transform the image
- A tuple containing:
- Raw transformed image data (bytes)
- Path to the saved transformed image file (str)
- "Add snow to this landscape"
- "Change the background to a beach"
- `image_file_path`: Path to the image file to be transformed
- `prompt`: Text description of how you want to transform the image
- A tuple containing:
- Raw transformed image data (bytes)
- Path to the saved transformed image file (str)
- "Add a llama next to the person in this image"
- "Make this daytime scene look like night time"
- Python 3.11+
- Google AI API key (Gemini)
- MCP host application (Claude Desktop App, Cursor, or other MCP-compatible clients)
- Visit [Google AI Studio API Keys page](https://aistudio.google.com/apikey)
- Sign in with your Google account
- Click "Create API Key"
- Copy your new API key for use in the configuration
- Note: The API key provides a certain quota of free usage per month. You can check your usage in the Google AI Studio
- Clone the repository:
- Create a virtual environment and install dependencies:
- Copy the example environment file and add your API key:
- Edit the `.env` file to include your Google Gemini API key and preferred output path:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- "Generate an image of a sunset over mountains"
- "Create an illustration of a futuristic cityscape"
- "Make a picture of a cat wearing sunglasses"
- "Transform this image by adding snow to the scene"
- "Edit this photo to make it look like it was taken at night"
- "Add a dragon flying in the background of this picture"
SECURITY
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。