jgkme/kilo-image-gen-mcp
Allows interaction with OpenAI's image generation and editing APIs, enabling AI agents to generate, edit, and manipulate images through OpenAI's models.
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., "@jgkme/kilo-image-gen-mcpgenerate an image of a futuristic city at night"
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.
JGKME kilo-image-gen-mcp
MCP server for image generation through Kilo Gateway and compatible providers.
Install
npm install -g @jgkme/kilo-image-gen-mcpRelated MCP server: Nano-Banana MCP Server
Configuration
Set the default provider with IMAGE_MCP_DEFAULT_PROVIDER.
Set the default model with IMAGE_MCP_DEFAULT_MODEL.
Set a project-specific image output root with IMAGE_MCP_PROJECT_OUTPUT_DIR.
For MCP clients, use whatever field name the client expects for process environment variables. In Kilo, the working key is env for local MCP servers. Some other clients use environment or similar, but the server itself only reads standard process environment variables.
Provider environment variables:
Provider | Variable |
Kilo |
|
OpenRouter |
|
OpenAI |
|
Gemini |
|
Default model notes:
If
IMAGE_MCP_DEFAULT_MODELis set, the server uses that model whenmodelis omitted.Otherwise, the default follows the selected provider.
Kilo Gateway can route to other compatible models if your account has access to them.
Tools
kilo_generate_image
Input | Type | Notes |
| string | Required |
| string |
|
| string | Optional. Defaults from |
| string | Example |
| number | Overrides |
| string |
|
| number | Optional |
| string | Path, base64, or URL |
| string | Optional output file |
generate_image
OpenRouter-first image generation tool with broader request options and response normalization.
Input | Type | Notes |
| string | Required |
| string | Defaults to |
| string | Optional |
| string | Optional reference image |
| string[] | Optional reference image list for OpenRouter chat-image models |
| string[] | Optional override, defaults to |
| string | Optional OpenRouter image_config hint |
| string | Optional OpenRouter image_config hint |
| string | Optional OpenRouter image_config hint |
| string | Optional OpenRouter image_config hint |
| string | Optional output file path |
OpenRouter responses are normalized from choices[0].message.images, message.content, data.output, and other common image payload shapes. Multiple returned images are preserved.
Project output hint:
If
IMAGE_MCP_PROJECT_OUTPUT_DIRis set, the server writes generated images there.Otherwise, if the repo root contains
.image-mcp-output,.image-mcp-output.json, or.kilo-image-output, that value is used.This is intended for project-specific layouts like Laravel
public/storage/imageswithout hardcoding framework detection.
Example hint file contents:
public/storage/imagesOr JSON:
{ "outputDir": "public/storage/images" }list_image_models
Returns configured provider status, current defaults, and known model families.
get_provider_status
Returns configured providers and defaults.
edit_image
Same shape as kilo_generate_image, but requires input_image and routes the prompt as an edit instruction. Native edit routes are used for Kilo, OpenAI, and OpenRouter when available, with chat-based fallback for other providers.
background_remove
Locally removes a simple background and preserves transparency in a PNG output.
Input | Type | Notes |
| string | Required |
| string | Optional output file path |
resize_image
Locally resizes an image with aspect-ratio-preserving defaults.
Input | Type | Notes |
| string | Required |
| number | Optional target dimensions |
| string |
|
| string | Optional flatten background color |
| string | Optional output file path |
auto_crop
Locally crops to target dimensions or trims surrounding whitespace when no size is provided.
Input | Type | Notes |
| string | Required |
| number | Optional crop target |
| string | Optional crop gravity |
| string | Optional output file path |
Behavior
providerdefaults toIMAGE_MCP_DEFAULT_PROVIDERorkilomodeldefaults toIMAGE_MCP_DEFAULT_MODELwhen set, otherwise to the provider defaultaspectmaps to size when width and height are not providedinput_imagecan be a file path, base64 string, or URLoutput_pathwrites the generated PNG to diskgenerate_imagesupports OpenRouter response normalization and multiple image payloads when presentedit_imagetreatsinput_imageas the reference image and preserves subject/composition unless instructed otherwiseedit_imageuses native edit endpoints for Kilo, OpenAI, and OpenRouter when possiblebackground_remove,resize_image, andauto_cropare local deterministic tools that do not require provider API keys
Provider notes
kilouseshttps://api.kilo.ai/api/gateway/images/generationsopenroutersupports many image models, but not every model supports every modality combination. The server adapts the request shape per model and falls back to image-only when needed.openaiuses the Images API for generation and the Images API for editsgeminiuses the OpenAI-compatible Gemini endpoint for generation and chat-style image flows where supportedErrors return structured JSON text with
code,message,details, andretryableFor Kilo/OpenRouter, you can pick a different compatible model by setting
modelexplicitly or by changingIMAGE_MCP_DEFAULT_MODELIn live Kilo runtime tests, the MCP can receive a non-empty
KILO_API_KEY, but the Kilo image gateway still responds withPlease pass a valid API key/PAID_MODEL_AUTH_REQUIREDfor image generation requests. That indicates the backend is rejecting the token at the image endpoint, not that the MCP is dropping the key.
Kilo config
{
"mcp": {
"kilo-image-gen": {
"type": "local",
"command": ["npx", "-y", "@jgkme/kilo-image-gen-mcp"],
"env": {
"IMAGE_MCP_DEFAULT_PROVIDER": "kilo",
"IMAGE_MCP_DEFAULT_MODEL": "black-forest-labs/flux.2-pro",
"KILO_API_KEY": "your_kilo_api_key_here",
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENAI_API_KEY": "your_openai_api_key_here",
"GEMINI_API_KEY": "your_gemini_api_key_here"
},
"enabled": true
}
}
}If you are using another MCP client such as Cursor, continue using the same process environment variable names (KILO_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY), but match that client’s config schema for local server env injection. The key point is that the launched process must receive those variables in its runtime environment.
For a local install path, use:
{
"mcp": {
"kilo-image-gen": {
"type": "local",
"command": ["npx", "-y", "@jgkme/kilo-image-gen-mcp"],
"env": {
"IMAGE_MCP_DEFAULT_PROVIDER": "kilo",
"IMAGE_MCP_DEFAULT_MODEL": "black-forest-labs/flux.2-pro",
"KILO_API_KEY": "your_kilo_api_key_here",
"OPENROUTER_API_KEY": "your_openrouter_api_key_here",
"OPENAI_API_KEY": "your_openai_api_key_here",
"GEMINI_API_KEY": "your_gemini_api_key_here"
},
"enabled": true
}
}
}Troubleshooting
If generation fails, verify the provider API key and model name. If no output file is written, confirm output_path points to a writable location.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/jgkme/kilo-image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server