vLLM Image MCP Server
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., "@vLLM Image MCP Server generate a 16:9 hero banner and save it to ./assets/images as webp"
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.
vLLM Image MCP Server
An MCP (Model Context Protocol) server that provides AI-powered image generation tools via any vLLM-Omni compatible endpoint. The server is model-aware, GPU-aware, and supports both single and batch image generation with automatic parameter tuning based on the loaded model.
Features
10 MCP tools for image generation, batch processing, progress monitoring, and system status
Model-aware defaults — auto-detects the loaded model and applies optimal parameters
5 built-in model profiles: FLUX.2-klein 4B/9B, Qwen-Image variants, Z-Image-Turbo
Multi-format output — save as PNG (lossless), JPG (quality=95), or WebP (smallest, ideal for web)
Up to 4K resolution — FLUX Klein models support resolutions up to 3840x2160
Flexible output paths — the AI model chooses where to save images per-call (e.g. directly into your project's
assets/folder)Batch generation with automatic concurrency control based on estimated VRAM
Batch progress monitoring — poll running batches to track completion and prevent timeouts
Resolution validation — snaps to valid multiples, clamps to megapixel limits
Aspect ratio presets — use shortcuts like
16:9,16:9_2k,16:9_4kinstead of raw pixels
Related MCP server: ImageGen MCP
Tools
Tool | Description |
| Generate a single image from a text prompt |
| Generate multiple images concurrently (max 20) |
| Get current model info and recommended parameters |
| List aspect ratio presets for the current model |
| Estimate time and resource usage before generating |
| Check GPU/VRAM availability for capacity planning |
| Check vLLM server connectivity and status |
| Cancel a running batch generation |
| Check progress of a running batch generation |
| List all currently running batch jobs |
Dynamic Output Directory
Both generate_image and batch_generate require an output_dir parameter. The AI model decides where to save images based on your project context — no hardcoded paths needed:
generate_image(prompt="A hero banner", output_dir="./src/assets/images")
batch_generate(prompts=["cat", "dog"], output_dir="./public/img")This means images land exactly where your project needs them.
Output Formats
Both generate_image and batch_generate support a format parameter:
Format | Use Case | Quality | File Size |
| Lossless quality, transparency support | Lossless | Largest |
| General use, photographs | 95% quality | ~70% smaller |
| Web projects, optimized delivery | 90% quality | ~80% smaller |
generate_image(prompt="A hero banner", output_dir="./assets", format="webp")
batch_generate(prompts=["cat", "dog"], output_dir="./public", format="jpg")The AI model chooses the format based on context (e.g. webp for web projects, png for graphic design).
Batch Progress Monitoring
For long-running batch generations, use check_batch_progress to poll every ~50 seconds:
# Start batch
batch_generate(prompts=[...], output_dir="./output") # returns batch_id
# Poll progress
check_batch_progress(batch_id="batch_abc123def456")
# Discover running batches
list_active_batches()Prerequisites
Python 3.11+
A running vLLM-Omni server with an image generation model loaded
piporuvfor package installation
Installation
From source
git clone https://github.com/sumitchatterjee13/vllm-image-mcp-server.git
cd vllm-image-mcp-server
pip install -e .Verify installation
vllm-image-mcp --helpOr run directly:
python -m vllm_image_mcp.server --helpUsage
Standalone
# Default: connects to http://localhost:6655
vllm-image-mcp
# Custom vLLM server URL
vllm-image-mcp --vllm-url http://192.168.1.100:6655
# With custom timeout
vllm-image-mcp --vllm-url http://localhost:6655 --timeout 600CLI Arguments
Argument | Default | Description |
|
| Base URL of the vLLM-Omni server |
| auto | Max concurrent generations for batch |
|
| Request timeout in seconds |
Note: There is no
--output-dirflag. The output path is provided by the AI model on everygenerate_image/batch_generatecall, so images are saved wherever the project needs them.
MCP Client Configuration
Claude Code
Option A — CLI command:
claude mcp add vllm-image -- python -m vllm_image_mcp.server --vllm-url http://localhost:6655Option B — Project config (.mcp.json in project root):
{
"mcpServers": {
"vllm-image": {
"command": "python",
"args": [
"-m", "vllm_image_mcp.server",
"--vllm-url", "http://localhost:6655"
]
}
}
}Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"vllm-image": {
"command": "python",
"args": [
"-m", "vllm_image_mcp.server",
"--vllm-url", "http://localhost:6655"
]
}
}
}Cursor
Create .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global):
{
"mcpServers": {
"vllm-image": {
"command": "python",
"args": [
"-m", "vllm_image_mcp.server",
"--vllm-url", "http://localhost:6655"
]
}
}
}Kilo Code
Create .kilocode/mcp.json in your project root:
{
"mcpServers": {
"vllm-image": {
"command": "python",
"args": [
"-m", "vllm_image_mcp.server",
"--vllm-url", "http://localhost:6655"
],
"alwaysAllow": [],
"disabled": false
}
}
}Windows Note
On native Windows (not WSL/Git Bash), if you get "Connection closed" errors, wrap the command with cmd:
{
"mcpServers": {
"vllm-image": {
"command": "cmd",
"args": [
"/c", "python", "-m", "vllm_image_mcp.server",
"--vllm-url", "http://localhost:6655"
]
}
}
}Remote vLLM Server
To connect to a vLLM server on another machine, change the --vllm-url argument:
"args": [
"-m", "vllm_image_mcp.server",
"--vllm-url", "http://192.168.1.100:6655"
]Supported Models
The server includes built-in profiles with optimal defaults for these models:
Model | Type | Steps | Guidance | Neg. Prompt | Est. VRAM | Max Resolution |
| Distilled | 4 | 1.0 | No | 13 GB | 4K (9.0 MP) |
| Distilled | 4 | 1.0 | No | 29 GB | 4K (9.0 MP) |
| Standard | 28 | 5.0 | Yes | 40 GB | 2K (4.0 MP) |
| Standard | 50 | 5.0 | Yes | 40 GB | 2K (4.0 MP) |
| Distilled | 8 | 1.0 | No | 16 GB | 2K (4.0 MP) |
Unknown models automatically use fallback defaults (steps=28, guidance=5.0, 1024x1024).
FLUX Klein Resolution Presets
FLUX Klein models support resolutions from standard to 4K:
Preset | Resolution | Megapixels | Use Case |
| 1024x1024 | 1.0 MP | Default, fast |
| 1024x576 | 0.6 MP | Widescreen, fast |
| 576x1024 | 0.6 MP | Portrait, fast |
| 2048x2048 | 4.2 MP | High detail square |
| 2560x1440 | 3.7 MP | 2K widescreen |
| 2048x1536 | 3.1 MP | 2K standard |
| 3840x2160 | 8.3 MP | 4K, maximum detail |
| 2160x3840 | 8.3 MP | 4K portrait |
4K resolutions take significantly longer and use more VRAM. Use only when the user needs high-resolution output (wallpapers, print-quality, posters).
Prompt Writing Guide
The server includes model-specific prompt guidance that is returned by the get_model_info tool. The AI model should call get_model_info before its first generation to learn the loaded model's prompting rules. Below is a summary.
General Rules (All Models)
Write prompts as natural language prose, never comma-separated tags
Put the subject first — the first 10-20 words carry the most weight
Always specify lighting — it has the single greatest impact on quality
Ideal length: 30-80 words
Do NOT use quality tags like
8k, masterpiece, best quality, ultra HD— they waste tokensDo NOT describe sequential actions — images are a single moment
Do NOT mix conflicting styles (e.g. "photorealistic oil painting")
For photorealism, reference real cameras:
Shot on Sony A7IV, 85mm lens at f/2.0For text in images, use quotation marks:
The sign reads "OPEN"
FLUX.2 Klein (Distilled Models)
Negative prompts are ignored at CFG 1.0 — do not send them
Be extra explicit and descriptive — no auto-enhancement available
Every word must contribute visual information; filler text hurts quality
Use emphasis phrases: "prominently featuring", "the focal point is"
Good prompt:
Professional studio product shot on polished concrete. A minimalist ceramic
coffee mug with matte black finish, steam rising from hot coffee, centered
in frame. Ultra-realistic commercial photography. Three-point softbox
lighting, diffused highlights, no harsh shadows. Shot with 85mm lens at f/5.6.Bad prompt:
coffee mug, black, steam, studio, professional, 8k, masterpiece, best quality,
ultra detailed, sharp focusQwen-Image / Z-Image (Standard Models)
Use negative prompts — they improve results significantly
Good default negative:
blurry, low quality, distorted, watermark, oversaturated, artificialFor portraits add:
extra fingers, deformed hands, unnatural proportionsThe model interprets prompts very literally — be precise
For text-heavy images, raise
guidance_scaleto 7.0Wrap desired text in double quotes and specify font style
Use
photographinstead ofphotorealisticor3d render
Good prompt:
A futuristic sports car parked under neon city lights, photorealistic style.
Reflections shimmer on wet asphalt streets. Dramatic side lighting with deep
shadows and vibrant highlights. "Night Racer" in metallic chrome text on the hood.Negative prompt:
blurry, low quality, distorted, watermark, oversaturatedRunning Tests
pip install pytest pytest-asyncio
pytest tests/ -vLicense
MIT
Available Tools
10 toolsbatch_generateA
Start a batch image generation (returns immediately, does NOT block).
Returns a batch_id immediately. Images generate in the background.
IMPORTANT WORKFLOW:
Call batch_generate → returns batch_id
WAIT 50 SECONDS before calling check_batch_progress (images need time to generate)
Call check_batch_progress(batch_id) — if still in_progress, WAIT another 50 seconds and repeat
When status is "completed", the response contains all results and file paths
Do NOT call check_batch_progress immediately — always wait 50 seconds between calls.
Each prompt should follow the same rules as generate_image: natural language prose, subject first, explicit lighting, 30-80 words each, no quality tags.
Args: prompts: List of natural language text prompts (max 20). Each prompt should be descriptive prose, not comma-separated tags. output_dir: Directory to save all images. Provide a path appropriate for the user's project. width: Width for all images in pixels. height: Height for all images in pixels. aspect_ratio: Aspect ratio shortcut for all images. FLUX Klein supports up to 4K (e.g. "16:9_4k"). num_inference_steps: Steps for all images. guidance_scale: CFG scale for all images. seeds: List of seeds (must match prompts length if provided). max_concurrent: Override concurrent limit (auto-detected if omitted). format: Output image format for all images. Options: "png" (default), "jpg", "webp". Choose based on context.
Inputs: prompts (required), output_dir (required), seeds, width, +6 more. Returns: result
cancel_batchBDestructive
Cancel a running batch generation.
Args: batch_id: The batch ID returned by batch_generate.
Inputs: batch_id (required). Returns: result
check_batch_progressARead-only
Check progress of a batch generation.
TIMING: Wait 50 seconds after batch_generate before calling this. If status is still "in_progress", wait another 50 seconds before calling again.
While in progress: returns completion counts and per-image statuses. When finished: returns full results with all file paths, then cleans up the batch.
Args: batch_id: The batch ID returned by batch_generate.
Inputs: batch_id (required). Returns: result
estimate_generationBRead-only
Estimate generation time and resource usage without actually generating.
Args: num_images: Number of images to estimate for. width: Image width in pixels. height: Image height in pixels. num_inference_steps: Steps per image.
Inputs: width, height, num_images, num_inference_steps. Returns: result
generate_imageAIdempotent
Generate a single image from a text prompt.
PROMPT WRITING RULES (call get_model_info first for model-specific guidance):
Write as natural language prose, NOT comma-separated tags.
Put the subject first (first 10-20 words carry the most weight).
Always describe lighting explicitly.
30-80 words ideal. Do NOT use quality tags like '8k, masterpiece'.
For photorealism: reference real cameras/lenses ('Shot on Sony A7IV, 85mm f/2.0').
For text in images: use quotation marks ('The sign reads "OPEN"').
Args: prompt: Natural language description of the image. Describe the subject first, then environment, style, and lighting. Be specific and descriptive. output_dir: Directory to save the image. Provide a path appropriate for the user's project (e.g. "./assets/images", "./public/img", "./output"). negative_prompt: What to avoid (only works with Qwen-Image models, ignored by FLUX). For Qwen, good defaults: 'blurry, low quality, distorted, watermark, oversaturated'. width: Image width in pixels (must be multiple of 16). height: Image height in pixels (must be multiple of 16). aspect_ratio: Shortcut for resolution, e.g. "16:9", "1:1", "9:16", "16:9_2k", "16:9_4k" (overrides width/height). FLUX Klein supports up to 4K. num_inference_steps: Number of diffusion steps (fewer = faster, more = higher quality). guidance_scale: CFG scale. For Qwen-Image: raise to 7.0 for text-heavy images. seed: Random seed for reproducibility. filename: Output filename (auto-generated if omitted). format: Output image format. Options: "png" (lossless, default), "jpg" (lossy, quality=95, good for general use), "webp" (lossy, quality=90, smallest files, ideal for web projects). Choose based on context.
Inputs: prompt (required), output_dir (required), seed, width, +7 more. Returns: result
get_model_infoARead-only
Get information about the currently loaded model, its recommended parameters, and prompt writing guidance.
IMPORTANT: Call this before your first image generation to get model-specific prompt_guidance. Different models (FLUX vs Qwen) require very different prompting strategies.
Returns the model name, type, default parameters, supported aspect ratios, VRAM estimate, and detailed prompt_guidance with rules and examples.
Inputs: no named parameters. Returns: result
gpu_statusARead-only
Check GPU memory usage and availability for generation capacity planning.
Returns estimated VRAM usage, free memory, and recommended max concurrent generations.
Inputs: no named parameters. Returns: result
list_active_batchesARead-only
List all currently running batch generations and their IDs.
Use this to find batch IDs for progress monitoring with check_batch_progress.
Inputs: no named parameters. Returns: result
list_presetsARead-only
List available resolution presets and aspect ratios for the current model.
Returns all supported aspect ratios with their pixel dimensions, resolution constraints, and max megapixels.
Inputs: no named parameters. Returns: result
server_healthARead-only
Check if the vLLM-Omni server is running, ready, and responsive.
Returns server status, loaded model, response latency, and version.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct roles: single vs batch generation, and the batch lifecycle (start/progress/cancel/list) is well-separated. A few pairs overlap mildly — get_model_info vs list_presets both surface aspect ratios/parameters, and gpu_status vs server_health both report readiness — but descriptions and arg differences make the intended pick clear.
The dominant pattern is verb_noun (generate_image, get_model_info, list_presets, estimate_generation, cancel_batch, check_batch_progress, list_active_batches), but there are deviations: batch_generate reverses to noun_verb, and gpu_status/server_health are bare noun phrases with no verb. Still readable, but not a single predictable convention.
Ten tools is well within a comfortable range and each one earns its place: generation, batch lifecycle, introspection (model info, presets, GPU, health) and estimation all serve real pre/post-generation needs. Nothing looks redundant or like padding.
The surface covers the full basic lifecycle: inspect model/health/VRAM, estimate, generate single or batch, poll progress, cancel, and discover active batches. Gaps exist for image-to-image/editing/upscaling and for listing previously generated outputs, but core text-to-image workflows have no dead ends.
Maintenance
Related MCP Connectors
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Generate AI images, videos and music from your AI client.
Generate images, videos and music with model discovery, cost estimates and asynchronous results.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to generate images from text prompts, list available models, and view generation history through stdio, SSE, or Streamable HTTP transports.-
- AlicenseNot gradedqualityCmaintenanceEnables text-to-image generation and image-to-image editing through the built-in relay or any OpenAI-compatible endpoint, with fast and high-precision models, square and custom-dimension sizes up to true 4K, and quality controls. Generated or edited images are written to local directories and returned as absolute file paths.46 npmMIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to generate images from text prompts, list available models, and view past generation history via stdio, SSE, or Streamable HTTP transports.-
- AlicenseAqualityBmaintenanceEnables complete control of the OpenAI Images API for text-to-image generation, image editing, multi-image references, masks, streaming previews, and resumable jobs, with per-request model and parameter selection.8MIT