Image Generation MCP Server
The Image Generation MCP Server enables text-to-image generation and image upscaling via Stable Diffusion WebUI API.
Generate Images: Create images from text prompts with customizable parameters (sampling steps, dimensions, CFG scale, seed, sampler, batch size, etc.)
Upscale Images: Enhance image resolution using various upscaling models and modes (multiplier or dimensions)
Manage Models: List and switch between available Stable Diffusion models
Access Upscalers: Get available upscaler models for image enhancement
Advanced Controls: Adjust face restoration, tiling, negative prompts, and other image generation features
Provides text-to-image generation capabilities by connecting to a Stable Diffusion WebUI instance, allowing image generation, model selection, and image upscaling through the API.
Click on "Deploy 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., "@Image Generation MCP Server generate a fantasy landscape with mountains and a waterfall"
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.
image-gen MCP Server
A MCP server that provides text-to-image generation capabilities using Stable Diffusion WebUI API (ForgeUI/AUTOMATIC-1111).
Installation
Prerequisites
Node.js
Access to a Stable Diffusion WebUI instance with API enabled
The WebUI must have
--apiflag enabled when starting
Setup
Clone the repository:
git clone https://github.com/Ichigo3766/image-gen-mcp.git
cd image-gen-mcpInstall dependencies:
npm installBuild the server:
npm run buildAdd the server configuration to your environment:
{
"mcpServers": {
"image-gen": {
"command": "node",
"args": [
"/path/to/image-gen-mcp/build/index.js"
],
"env": {
"SD_WEBUI_URL": "http://your-sd-webui-url:7860",
"SD_AUTH_USER": "your-username", // Optional: if authentication is enabled
"SD_AUTH_PASS": "your-password", // Optional: if authentication is enabled
"SD_OUTPUT_DIR": "/path/to/output/directory",
"SD_RESIZE_MODE": "0", // Optional: upscaling mode (0=multiplier, 1=dimensions)
"SD_UPSCALE_MULTIPLIER": "4", // Optional: default upscale multiplier
"SD_UPSCALE_WIDTH": "512", // Optional: default upscale width
"SD_UPSCALE_HEIGHT": "512", // Optional: default upscale height
"SD_UPSCALER_1": "R-ESRGAN 4x+", // Optional: default primary upscaler
"SD_UPSCALER_2": "None" // Optional: default secondary upscaler
}
}
}
}Replace the environment variables with your values:
SD_WEBUI_URL: URL of your Stable Diffusion WebUI instanceSD_AUTH_USER: Username for basic auth (if enabled)SD_AUTH_PASS: Password for basic auth (if enabled)SD_OUTPUT_DIR: Directory where generated images will be savedSD_RESIZE_MODE: Default upscaling mode (0 for multiplier, 1 for dimensions)SD_UPSCALE_MULTIPLIER: Default upscale multiplier when resize_mode is 0SD_UPSCALE_WIDTH: Default target width when resize_mode is 1SD_UPSCALE_HEIGHT: Default target height when resize_mode is 1SD_UPSCALER_1: Default primary upscaler modelSD_UPSCALER_2: Default secondary upscaler model
Related MCP server: Image Generator MCP Server
Features
Tools
generate_image- Generate images using Stable DiffusionParameters:
prompt(required): Text description of the desired imagenegative_prompt: Things to exclude from the imagesteps: Number of sampling steps (default: 4, range: 1-150)width: Image width (default: 1024, range: 512-2048)height: Image height (default: 1024, range: 512-2048)cfg_scale: CFG scale (default: 1, range: 1-30)sampler_name: Sampling algorithm (default: "Euler")scheduler_name: Scheduler algorithm (default: "Simple")seed: Random seed (-1 for random)batch_size: Number of images to generate (default: 1, max: 4)restore_faces: Enable face restorationtiling: Generate tileable imagesoutput_path: Custom output path for the generated image
get_sd_models- Get list of available Stable Diffusion modelsNo parameters required
Returns an array of model names
set_sd_model- Set the active Stable Diffusion modelParameters:
model_name(required): Name of the model to set as active
get_sd_upscalers- Get list of available upscaler modelsNo parameters required
Returns an array of upscaler names
upscale_images- Upscale one or more images using Stable DiffusionParameters:
images(required): Array of image file paths to upscaleresize_mode: 0 for multiplier mode, 1 for dimension mode (default: from env)upscaling_resize: Upscale multiplier when resize_mode=0 (default: from env)upscaling_resize_w: Target width in pixels when resize_mode=1 (default: from env)upscaling_resize_h: Target height in pixels when resize_mode=1 (default: from env)upscaler_1: Primary upscaler model (default: from env)upscaler_2: Secondary upscaler model (default: from env)output_path: Custom output directory for upscaled images
Development
For development with auto-rebuild:
npm run watchError Handling
Common issues and solutions:
Make sure your Stable Diffusion WebUI is running with the
--apiflagCheck if the WebUI URL is accessible from where you're running the MCP server
If using authentication, ensure credentials are correct
Verify the output directory exists and has write permissions
When upscaling, ensure the input image files exist and are readable
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Available Tools
5 toolsgenerate_imageC
Generate an image using Stable Diffusion
Inputs: prompt (required), batch_size, cfg_scale, distilled_cfg_scale, +10 more.
get_sd_modelsB
Get list of available Stable Diffusion models
Inputs: no named parameters.
get_sd_upscalersB
Get list of available upscaler models
Inputs: no named parameters.
set_sd_modelB
Set the active Stable Diffusion model
Inputs: model_name (required).
upscale_imagesC
Upscale one or more images using Stable Diffusion
Inputs: images (required), output_path, resize_mode, upscaler_1, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose with no overlap: generate_image creates images, get_sd_models and get_sd_upscalers retrieve lists, set_sd_model configures the active model, and upscale_images enhances existing images. The descriptions make it impossible to confuse these tools.
All tools follow a consistent verb_noun pattern with snake_case (e.g., generate_image, get_sd_models, set_sd_model). The naming is predictable and readable throughout the set.
With 5 tools, this is well-scoped for an image generation server, covering core workflows like generation, model management, and upscaling. Each tool earns its place without bloat or thin coverage.
The toolset covers key operations for image generation and enhancement, including model selection and upscaling. A minor gap exists in lacking tools for deleting or managing generated images, but agents can work around this for most use cases.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
An MCP server that integrates with Discord to provide AI-powered features.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP Server that integrates with Stability AI's API to provide high-quality image generation, editing, and manipulation capabilities including background removal, outpainting, search-and-replace, and upscaling.66 npm84MIT
- AlicenseBqualityDmaintenanceAn MCP server that allows users to generate images using Replicate's Stable Diffusion model and save them to the local filesystem.3MIT
- AlicenseBqualityDmaintenanceA server that integrates ComfyUI with MCP, allowing users to generate images and download them through natural language interactions.422Apache 2.0
- FlicenseAqualityDmaintenanceAn MCP server that provides a standardized interface for accessing WaveSpeed AI's image and video generation capabilities, including text-to-image, image-to-image, inpainting, and dynamic video generation.3-