MCP Image Generator (Uncensored)
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., "@MCP Image Generator (Uncensored)generate a photorealistic lighthouse on a rocky coast at sunset"
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.
MCP Image Generator (Uncensored)
A self-hosted Model Context Protocol server that creates and edits images with the uncensored Qwen-Image-2.1 model on your own computer. It runs in Docker, on an NVIDIA GPU or on the CPU, and any MCP client on your network can use it over Streamable HTTP.
The default model is an uncensored build of Qwen-Image-2.1 with no built-in content filter. To use the
standard model instead, set model.variant: base in config.yaml.
Text to image in any size or aspect ratio, up to about 4 megapixels (2048x2048)
Image editing: change, add or remove things, restyle, or combine up to 10 images
Transparent backgrounds (RGBA PNG) and background removal
Seamless tileable textures, including height and normal maps that stay seamless
360 panoramas with a built-in 360 viewer
Upscaling 2x or 4x, and watermark removal
Models download automatically on the first start
Examples
All images below were made by this server with the default quality settings. The prompts are listed under the gallery.
360 panorama, opened in the built-in 360 viewer from the link in the result
Seamless textures
Each texture below is one tile (top). Repeated 3x3 (bottom), it shows no seams.
Texture maps: a stone tile, then a height map and a normal map made from it with an edit. Each is shown repeated 2x2: they all stay seamless.
Upscaling 4x. Left: plain enlargement. Right: the upscaler.
Image | Tool and settings | Prompt |
Text to image |
| A lighthouse on a rocky coast at sunset, waves breaking on the rocks, warm golden light, a small fishing boat in the distance, dramatic clouds, photorealistic |
Edit |
| Make it a snowy winter night with the lighthouse beam switched on and snow on the rocks, keep everything else unchanged |
Text in images |
| A vintage travel poster, flat screen-print illustration of snowy mountains above a lake with a red train on a bridge, bold title text at the top that reads "SEE THE ALPS", smaller text at the bottom that reads "By rail, every season" |
Uncensored |
| Iron Man in his red and gold armor standing on a rooftop at night, city lights below, cinematic lighting, photorealistic |
Icon |
| A cute cartoon rocket ship, flat vector illustration, bold outlines, bright colors |
Transparent |
| A red fox sitting, full body, soft studio light |
360 panorama |
| A mountain meadow with wildflowers, a stone cabin, a wooden boardwalk and a lake |
Brick |
| Large red bricks with light grey mortar, close-up, photorealistic, even lighting |
Wood |
| Wide oak floor planks with visible wood grain and knots, top-down, natural light |
Ceramic |
| Blue and white ceramic tiles with a floral pattern |
Stone tile |
| A moss-covered stone floor, top-down |
Height map |
| Convert |
Normal map |
| Convert |
Watermark removal |
| - (no prompt needed) |
Upscaling |
| - |
Characters and brands shown belong to their owners.
Related MCP server: image-forge-mcp
Requirements
GPU mode | CPU mode | |
Docker | Docker Desktop (Windows, macOS) or Docker Engine with Compose (Linux) | same |
Hardware | NVIDIA GPU, RTX 20xx or newer, 12 GB VRAM or more (see GPU memory), 32 GB RAM recommended | Any modern 64-bit CPU, 24 GB RAM or more |
Driver | NVIDIA driver 570 or newer | - |
Disk | About 12 GB for models and 6 GB for the Docker image | About 12 GB and 1 GB |
GPU setup
Windows: install Docker Desktop with the WSL 2 backend and a current NVIDIA driver.
Linux: install the NVIDIA driver and the NVIDIA Container Toolkit.
Check that Docker can see your GPU:
docker run --rm --gpus all nvidia/cuda:12.8.2-base-ubuntu24.04 nvidia-smiGPU memory
Every feature, including 2048x2048 images, edits with 10 input images, 2880x1440 panoramas and upscaling to 8192 px, works on a single 12 GB card:
GPU memory | Settings | Notes |
24 GB or more | default | Everything stays on the GPU, the fastest setup. Peak use is about 18 GB |
12-16 GB | the settings below | Peak use is about 11 GB. The text encoder's weights stay in system RAM, so the server uses up to about 15 GB of RAM |
8-10 GB |
| Not tested. All weights stream from RAM: slower, and the largest sizes may not fit |
Settings for a 12 GB card, in config.yaml:
gpu:
max_vram_gb: {0: 10}
offload: {text_encoder: cpu}
generation:
prefix_cache_type: q8_0Quick start
git clone https://github.com/hypersniper05/MCP-Image-Generator-Uncensored.git
cd MCP-Image-Generator-Uncensored
./start.sh # Linux / macOS.\start.cmd # Windows (or double-click start.cmd)The first start builds the Docker image (10-30 minutes) and downloads about 12 GB of models. When it is ready, the script prints the address:
Ready. MCP endpoint (Streamable HTTP, no auth):
http://localhost:5005/mcpStop:
./stop.shorstop.cmd. Logs:docker compose logs -f.Web page: open
http://localhost:5005/to see the status, upload images and browse recent results.Settings: the first start creates
config.yamlfromconfig.example.yaml. To run on the CPU, setdevice: cpuinconfig.yamland run the start script again.Updates: after pulling new code, run
./start.sh --build(orstart.cmd -Build) to rebuild the image.
cp config.example.yaml config.yaml
cp .env.example .env # for CPU mode, set COMPOSE_PROFILES=cpu in .env
docker compose up -d --buildSecurity note. The server is open by design, so it is easy to connect to: it has no login, it listens on all network interfaces, and it accepts requests from any web page. Anyone who can reach port 5005 can make images and see every image on the server, and so can a web page open in a browser on your network. Run it on your own computer or a network you trust, use a VPN such as Tailscale for remote access, and never forward the port to the internet.
Connect an MCP client
The endpoint is http://<host>:5005/mcp (Streamable HTTP).
MCP Inspector (quick test in a browser): run npx @modelcontextprotocol/inspector, choose
Streamable HTTP, enter http://localhost:5005/mcp and click Connect.
VS Code (.vscode/mcp.json):
{ "servers": { "imagegen": { "type": "http", "url": "http://localhost:5005/mcp" } } }Cursor (~/.cursor/mcp.json) and most other clients:
{ "mcpServers": { "imagegen": { "url": "http://localhost:5005/mcp" } } }Clients that only support stdio can connect through mcp-remote:
{ "mcpServers": { "imagegen": { "command": "npx", "args": ["-y", "mcp-remote", "http://localhost:5005/mcp", "--allow-http"] } } }Large images take minutes. If an image is not ready within 25 seconds, the tool returns a job_id and the
client gets the image with get_job, so clients with short time limits still work. To wait longer per call, add
?max_wait=N to the endpoint URL (in seconds, at most 280; keep it under your client's tool time limit).
For the llama.cpp web UI (llama-server started with --ui-mcp-proxy), add the server in the web UI's MCP
settings, or for every browser through the file passed with --ui-config-file:
{
"mcpServers": "[{\"id\": \"imagegen\", \"name\": \"Image Gen\", \"url\": \"http://127.0.0.1:5005/mcp\", \"enabled\": true, \"useProxy\": true, \"headers\": \"{\\\"X-Imagegen-Max-Wait\\\": \\\"20\\\", \\\"X-Inline-Max-Bytes\\\": \\\"16000000\\\"}\"}]"
}Optional headers a client can send:
Header | Effect |
| How long a call waits before returning a |
| Send the full image inline instead of a preview (for clients without a message size limit) |
| Return images as data-URI text, for clients that drop MCP image content |
| Host name to use in returned links when the client connects through a proxy |
Tools
Tool | What it does |
| Text to image. Options: |
| Edit one image or combine up to 10 (refer to them as |
| 360 panorama (2:1). Optional |
| Cut out the subject into a transparent PNG |
| Enlarge 2x or 4x (up to 8192 px per side). Panoramas and tiles stay seamless |
| Remove watermarks, logos and overlaid text; the rest of the image is kept as it was |
| Get the result of, or cancel, a job that was still running |
| Recent results and uploads, and a way for the model to look at one |
| Model, GPU placement, download progress and running jobs |
Input images can be a data URL or base64, an http(s) URL, a file name or link of an image this server
made, or an image uploaded on the server's web page (http://<host>:5005/upload).
Results include the image (or a preview of a large one) and a link to the full file, which is saved in
./outputs. Panoramas also get a link to the 360 viewer.
Tips
For the best quality use
size: "xl". Leavestepsandcfg_scaleunset.Write full sentences: subject, setting, lighting, style. Put text that should appear in quotes:
a neon sign that says "OPEN 24/7".For edits, say what to change and add "keep everything else unchanged".
For tiles, describe a surface or pattern that fills the whole picture, e.g. "moss-covered cobblestones, top-down".
Configuration
All settings are in config.yaml (created from the commented config.example.yaml).
Restart after a change: docker compose restart. The most useful ones:
Setting | Default | What it does |
|
|
|
|
| Model size: |
| 40 | Quality vs. speed. 25 is a faster draft |
| 1024x1024 | Size when a request gives none |
| 2048x1024 | Default panorama size (2880x1440 at most) |
| 25 | How long a tool call (and each |
| 0 | Free the GPU memory after this many idle seconds (0 = keep loaded) |
| 7 | Delete old results after this many days (0 = never) |
| 5005 | Port of the server |
| empty | Address used in returned links, e.g. |
.env (created from .env.example) holds Docker settings such as PUBLIC_URL, HF_TOKEN
(only needed if Hugging Face rate-limits your downloads) and the build options.
config.yaml and .env are your local files and are not part of the repository.
Choosing GPUs
GPU numbers are the ones nvidia-smi shows. Everything runs on GPU 0 by default. The model has three parts,
and each can go on a different GPU:
gpu:
diffusion: [0] # the main model, runs every step: use the fastest GPU
text_encoder: 1 # reads the prompt once per request
vae: 0 # turns the result into pixelsOn a shared computer, only the GPUs you list are used. For cards with less memory, see GPU memory.
Troubleshooting
No GPU found: run the
nvidia-smicheck from Requirements. On Linux, install the NVIDIA Container Toolkit. Or usedevice: cpu.Out of GPU memory: use the 12 GB settings, a smaller size, or move the text encoder to another GPU.
The client times out: add
?max_wait=Nto the endpoint URL (or lowergeneration.wait_seconds) with N below the client's tool time limit.Other computers cannot connect: use this computer's IP address instead of
localhost, allow port 5005 in the firewall, and setserver.public_urlso image links work.CPU mode is very slow or crashes on Windows: Docker Desktop gives WSL only half your RAM. Raise it in
%UserProfile%\.wslconfig([wsl2]thenmemory=24GB), runwsl --shutdownand restart Docker Desktop.The server shows an error: read
docker compose logs --tail 100, fix the cause, and run the start script again.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[test]"
pytestpython -m imagegen_mcp --config config.yaml --check validates a config file without starting anything.
python scripts/smoke_test.py http://localhost:5005/mcp tests a running server.
Images are made by stable-diffusion.cpp, built inside the
Docker image from a pinned release with one small patch
(docker/patches/sdcpp-circular-json.patch) that turns on its
wrap-around mode per request for tileable images.
Credits and licenses
The code in this repository is MIT licensed (see LICENSE). It builds on the work of others; the model files are downloaded from their original sources and keep their own licenses:
Part | By | License |
Qwen-Image-2.1 image model | Qwen team, Alibaba | Qwen Research License (non-commercial) |
Uncensored Qwen-Image-2.1 GGUF (the default model files) | abenzerps | Qwen Research License (non-commercial) |
Texture-fix VAE (image decoder) | madebyollin | Qwen Research License (non-commercial) |
Qwen3-VL-8B-Instruct GGUF (prompt and image encoder) | Qwen team, Alibaba | Apache-2.0 |
Watermark removal LoRA (v1.0 for Qwen 2.1) | saladin | Civitai license: no commercial use |
Peng Zheng et al.; Daniel Gatis | MIT (the optional | |
4xNomos2_otf_esrgan upscaler (models) | Philip Hofmann | |
Real-ESRGAN ( | Xintao Wang | BSD-3-Clause |
PyMatting foreground estimation (ported, for clean transparent edges) | Thomas Germer et al. | MIT |
stable-diffusion.cpp and ggml (the inference engine) | leejet and contributors | MIT |
Pannellum (the 360 viewer) | Matthew Petroff | MIT |
The Qwen-Image-2.1 files allow non-commercial use only: read their license before using images commercially.
Only remove watermarks from images you have the rights to edit. The :gpu Docker image is based on NVIDIA's
CUDA image (license).
The uncensored model has no built-in content filter. You are responsible for how you use it and what you make with it.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Generate AI images and videos from any compatible MCP client.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceMCP server for generating, editing, and processing images via multiple providers including Kilo, OpenRouter, OpenAI, and Gemini, with local tools for background removal, resizing, and cropping.19 npm3MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server for AI-powered image processing (generate, edit, vary, analyze) supporting OpenAI, Gemini, Ideogram, and custom relay endpoints.-
- AlicenseAqualityCmaintenanceMCP server for generating and editing images and videos via DashScope/OpenAI-compatible APIs, with tools for text-to-image, image editing, text/video generation, and automatic local download.5MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to generate and edit images using local Stable Diffusion models in ComfyUI, with tools for text-to-image, img2img, ControlNet, UI frames, upscaling, and background removal—no cloud API or API key required.MIT