@genoooool/mcp-image-generator
Allows generating images using Google's Gemini AI models with support for multiple providers, aspect ratios, and resolutions.
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., "@@genoooool/mcp-image-generatorGenerate a photorealistic image of a cat sitting on a windowsill."
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.
@genoooool/mcp-image-generator
This is an MCP (Model Context Protocol) server for AI image generation with multi-provider support.
Features
Multi-provider support: Switch between Yunwu, Gemini Official, and custom Gemini providers without changing code
Environment variable configuration: All provider settings controlled via environment variables
Flexible output: Save images to custom directories with custom filenames
Multiple aspect ratios: Support for 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9
Resolution control: 1K, 2K, 4K resolution options (default: 2K)
Error handling: Comprehensive error messages with HTTP status codes and response details
Timeout support: Configurable request timeout (default: 60s)
Related MCP server: Gemini Image MCP
Supported MCP Clients
This MCP server works with:
Claude Desktop
Claude Code CLI
OpenCode
Codex
Any MCP-compatible client
Installation
Option 1: NPX (Recommended - No installation required)
npx -y @genoooool/mcp-image-generatorOption 2: Global Install
npm install -g @genoooool/mcp-image-generatorOption 3: Local Install
# Clone or download the repository
cd /path/to/project
# Install dependencies
npm install
# Build the project
npm run buildConfiguration
Environment Variables
Variable | Required | Description | Default |
| Yes | Provider type: | - |
| Depends on provider | Override default base URL | Provider-specific |
| No | Auth type: | Provider-specific |
| Yes for bearer auth | Bearer token for authentication | - |
| Yes for apikey auth | API key for authentication | - |
| No | Default output directory for images |
|
| No | Request timeout in milliseconds |
|
How to Switch Provider
1. Using Yunwu Provider
Set the following environment variables:
export IMAGE_PROVIDER=yunwu
export IMAGE_TOKEN=your_yunwu_token
export IMAGE_BASE_URL=https://yunwu.ai # Optional, this is the default
export IMAGE_OUT_DIR=./images # Optional2. Using Gemini Official Provider
Set the following environment variables:
export IMAGE_PROVIDER=gemini_official
export IMAGE_API_KEY=your_gemini_api_key
export IMAGE_BASE_URL=https://generativelanguage.googleapis.com # Optional, this is the default
export IMAGE_OUT_DIR=./images # OptionalNote: Gemini Official API key authentication uses query parameter ?key= for REST API requests to generateContent endpoints.
3. Using Custom Gemini Provider
Set the following environment variables:
export IMAGE_PROVIDER=custom_gemini
export IMAGE_BASE_URL=https://your-custom-provider.com # Required
export IMAGE_API_KEY=your_api_key # Or use IMAGE_TOKEN with IMAGE_AUTH_TYPE=bearer
export IMAGE_AUTH_TYPE=apikey # Optional: 'bearer' or 'apikey'
export IMAGE_OUT_DIR=./images # OptionalMCP Client Configuration
Claude Desktop
Configuration File Location
Claude Desktop loads MCP configuration from:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Configuration Format
Add the MCP server to your configuration file:
{
"mcpServers": {
"image-generator-yunwu": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_yunwu_token",
"IMAGE_OUT_DIR": "./images"
}
},
"image-generator-gemini": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "gemini_official",
"IMAGE_API_KEY": "your_gemini_api_key",
"IMAGE_OUT_DIR": "./images"
}
},
"image-generator-custom": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "custom_gemini",
"IMAGE_BASE_URL": "https://your-custom-provider.com",
"IMAGE_API_KEY": "your_api_key",
"IMAGE_AUTH_TYPE": "apikey",
"IMAGE_OUT_DIR": "./images"
}
}
}
}Using Global Installation
If you installed globally:
{
"mcpServers": {
"image-generator": {
"command": "mcp-image-generator",
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}Using Local Installation
If you cloned the repository:
Windows:
{
"mcpServers": {
"image-generator": {
"command": "node",
"args": ["C:\\path\\to\\project\\dist\\index.js"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}macOS/Linux:
{
"mcpServers": {
"image-generator": {
"command": "node",
"args": ["/path/to/project/dist/index.js"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}Claude Code CLI
Configuration File Location
Claude Code CLI loads MCP configuration from:
Windows:
%USERPROFILE%\.claude\config.jsonmacOS/Linux:
~/.claude/config.json
Configuration Format
Add the MCP server to your configuration file:
{
"mcpServers": {
"image-generator-yunwu": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_yunwu_token",
"IMAGE_OUT_DIR": "./images"
}
},
"image-generator-gemini": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "gemini_official",
"IMAGE_API_KEY": "your_gemini_api_key",
"IMAGE_OUT_DIR": "./images"
}
},
"image-generator-custom": {
"command": "npx",
"args": ["-y", "@genoooool/mcp-image-generator"],
"env": {
"IMAGE_PROVIDER": "custom_gemini",
"IMAGE_BASE_URL": "https://your-custom-provider.com",
"IMAGE_API_KEY": "your_api_key",
"IMAGE_AUTH_TYPE": "apikey",
"IMAGE_OUT_DIR": "./images"
}
}
}
}Using Global Installation
If you installed globally:
{
"mcpServers": {
"image-generator": {
"command": "mcp-image-generator",
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}Using Local Installation
If you cloned the repository:
Windows:
{
"mcpServers": {
"image-generator": {
"command": "node",
"args": ["C:\\path\\to\\project\\dist\\index.js"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}macOS/Linux:
{
"mcpServers": {
"image-generator": {
"command": "node",
"args": ["/path/to/project/dist/index.js"],
"env": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_token"
}
}
}
}OpenCode
Configuration File Location
OpenCode loads MCP configuration from the following locations (in order of precedence):
Global config:
~/.config/opencode/opencode.jsonCustom config:
OPENCODE_CONFIGenvironment variableProject config:
opencode.jsonin project root
Configuration Format
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"image-generator-yunwu": {
"type": "local",
"command": ["npx", "-y", "@genoooool/mcp-image-generator"],
"enabled": true,
"environment": {
"IMAGE_PROVIDER": "yunwu",
"IMAGE_TOKEN": "your_yunwu_token",
"IMAGE_OUT_DIR": "./images"
}
},
"image-generator-gemini": {
"type": "local",
"command": ["npx", "-y", "@genoooool/mcp-image-generator"],
"enabled": true,
"environment": {
"IMAGE_PROVIDER": "gemini_official",
"IMAGE_API_KEY": "your_gemini_api_key",
"IMAGE_OUT_DIR": "./images"
}
}
}
}Codex
Configuration File Location
Codex loads MCP configuration from the following locations:
Global config:
~/.config/codex/config.tomlProject config:
codex.tomlin project root
Configuration Format
[mcp_servers.image_yunwu]
command = "npx"
args = ["-y", "@genoooool/mcp-image-generator"]
[mcp_servers.image_yunwu.env]
IMAGE_PROVIDER = "yunwu"
IMAGE_TOKEN = "your_token"
IMAGE_OUT_DIR = "./images"
[mcp_servers.image_gemini]
command = "npx"
args = ["-y", "@genoooool/mcp-image-generator"]
[mcp_servers.image_gemini.env]
IMAGE_PROVIDER = "gemini_official"
IMAGE_API_KEY = "your_gemini_api_key"
IMAGE_OUT_DIR = "./images"
[mcp_servers.image_custom]
command = "npx"
args = ["-y", "@genoooool/mcp-image-generator"]
[mcp_servers.image_custom.env]
IMAGE_PROVIDER = "custom_gemini"
IMAGE_BASE_URL = "https://your-custom-provider.com"
IMAGE_API_KEY = "your_api_key"
IMAGE_AUTH_TYPE = "apikey"
IMAGE_OUT_DIR = "./images"Tool Usage
generate_image
Generate an image using AI models.
Parameters
Parameter | Type | Required | Default | Description |
| string | No |
| Model to use for generation |
| string | Yes | - | The prompt for image generation |
| string | No |
| Aspect ratio: |
| string | No |
| Resolution: |
| string | No |
| Directory to save the image |
| string | No |
| Custom filename |
Return Value
{
"url": "string",
"file_path": "string | null",
"provider": "string"
}Note: For Yunwu provider, if the response does not include a URL field, only file_path will be returned and url will be empty.
Example Usage
Example 1: Generate a simple image
Input:
{
"prompt": "A beautiful sunset over the ocean",
"aspect_ratio": "16:9",
"image_size": "2K"
}Output:
{
"url": "",
"file_path": "./images/20260111_034500.png",
"provider": "yunwu"
}Example 2: Generate with custom filename
Input:
{
"prompt": "A futuristic cityscape at night",
"model": "gemini-3-pro-image-preview",
"aspect_ratio": "1:1",
"out_dir": "./my_images",
"filename": "cityscape.png"
}Output:
{
"url": "",
"file_path": "./my_images/cityscape.png",
"provider": "gemini_official"
}Example 3: Generate with direct URL (if supported)
Input:
{
"prompt": "A peaceful mountain landscape",
"aspect_ratio": "4:3",
"image_size": "1K"
}Output:
{
"url": "https://cdn.example.com/images/abc123.png",
"file_path": null,
"provider": "yunwu"
}Development
Build
npm run buildDevelopment Mode (with auto-reload)
npm run devManual Testing
You can test the server manually by running:
IMAGE_PROVIDER=yunwu \
IMAGE_TOKEN=your_token \
node dist/index.jsThen send JSON-RPC messages via stdin.
Provider Details
Yunwu Provider
Endpoint:
POST https://yunwu.ai/v1beta/models/{model}:generateContentAuthentication: Bearer token via
Authorization: Bearer {token}headerResponse Handling:
If response contains
fileData.uri, returns the URL inurlfieldIf response contains
inlineData.data, decodes base64 and saves to local fileIf no URL is available,
urlwill be empty and onlyfile_pathis guaranteed
Gemini Official Provider
Endpoint:
POST https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent?key={api_key}Authentication: API key via query parameter
?key=in the URLResponse Handling: Same as Yunwu provider
Custom Gemini Provider
Endpoint: Configurable via
IMAGE_BASE_URLAuthentication: Supports both bearer token and API key based on
IMAGE_AUTH_TYPEbearer:Authorization: Bearer {token}headerapikey:?key={api_key}query parameter
Error Handling
The server returns detailed error messages when issues occur:
HTTP errors: Includes HTTP status code and response body
Validation errors: Includes field names and validation messages
Configuration errors: Clearly indicates missing required environment variables
Example error response:
Yunwu API error (401): {"error": "Invalid token"}Troubleshooting
"IMAGE_PROVIDER environment variable is required"
Make sure you set the IMAGE_PROVIDER environment variable.
"IMAGE_TOKEN is required when IMAGE_AUTH_TYPE=bearer"
You're using bearer auth type but didn't provide a token. Either:
Set
IMAGE_TOKENenvironment variableChange to
apikeyauth type and setIMAGE_API_KEY
"Unable to extract image from response"
The API response format may have changed. Check the provider's API documentation.
Timeout errors
Increase the timeout by setting IMAGE_REQUEST_TIMEOUT:
export IMAGE_REQUEST_TIMEOUT=120000 # 120 secondsClaude Code doesn't show the MCP server
Make sure you've restarted Claude Code after editing the config file
Check that the configuration file path is correct for your OS
Verify the command works in your terminal (e.g., run
npx -y @genoooool/mcp-image-generator)Check Claude Code logs for error messages
License
MIT
Author
genoooool
Links
Available Tools
1 toolgenerate_imageB
Generate an image using AI models. Supports multiple providers (Yunwu, Gemini Official, Custom). Provider is configured via IMAGE_PROVIDER environment variable.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use for generation (default: gemini-3-pro-image-preview) | |
| prompt | Yes | The prompt for image generation | |
| out_dir | No | Directory to save the image (optional) | |
| filename | No | Custom filename (optional, default: timestamp.png) | |
| image_size | No | Resolution of the generated image (default: 2K) | |
| aspect_ratio | No | Aspect ratio of the generated image (default: 1:1) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations and no output schema, the description carries the full burden for behavioral disclosure. It reveals that the provider is set via an environment variable, but it does not describe the return format, whether the image is saved or returned, file side effects, or error/ failure behavior. This leaves an agent with significant uncertainty about post-call outcomes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences lead with the action and then convey the critical environment-variable provider configuration. No filler or redundant restatement of the tool name is present.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose and provider configuration, and the schema covers all parameters. However, with no output schema, it should clarify what the agent receives after generation (e.g., a file path, URL, or binary) and any important side effects such as persistent file writes. These gaps make it only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the high-coverage baseline applies. The description adds no parameter-level detail beyond what the schema already provides, meriting neither penalty nor bonus.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a clear verb and resource ('Generate an image using AI models') and mentions multiple providers. Since there are no sibling tools and no differentiation is needed, it does not reach the 5-level distinction criterion, but the core purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit alternatives or when/ when-not conditions are provided, but the description implies the tool is the image-generation entry point. The provider configuration note is useful context but does not explain when to select one provider over another.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.0.2- First observed
generate_image
TDQS
With only one tool, there is no possibility of confusion between tools. The single tool's purpose is clear and distinct.
The only tool uses a clear verb_noun pattern (generate_image), and since there are no other tools, the naming is internally consistent.
A single tool is borderline thin for a server even with a narrow purpose like image generation. While it covers the core action, agents might expect additional utilities such as provider listing or status checks.
The tool covers the primary domain action—generating an image—with support for multiple providers via configuration. Minor gaps exist, such as no way to query available models or provider details, but core generation is fully addressed.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Generate AI images and videos from any compatible MCP client.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
MCP server for Qwen Image 3 AI image generation
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables image generation using Gemini native models, supporting both single prompts and batch processing via a file-based queue. It allows for detailed configuration of aspect ratios and models using YAML frontmatter across various MCP-enabled clients.319MIT
- FlicenseBqualityDmaintenanceEnables image generation and multi-turn editing sessions using the Gemini API within MCP-compatible environments. Users can create, modify, and configure images through natural language commands, supporting features like aspect ratio adjustments and session-based image transformations.5-
- AlicenseAqualityCmaintenanceEnables AI image generation, editing, and upscaling via Google Gemini and Imagen models, supporting dynamic model switching and multiple MCP-compatible clients.12MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP-compatible clients like Claude or ChatGPT to generate images from text prompts using AI, with options for aspect ratio and quality.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/genoooool/mcp-image-generator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server