Local Windows MCP server for FLUX image generation with a persistent Goose-ready service, a small monitoring dashboard, and multiple model modes including a GGUF-backed fast path.
- Persistent MCP service over
streamable-httpfor Goose - One-command Windows launchers for
fast,low, andhighmodes - Local dashboard for health, status, logs, and request activity
- VRAM-aware defaults for smaller GPUs
- Optional GGUF-backed
fastmode using a local FLUX.2 Klein transformer file
Dashboard in dark mode:
Sample output generated through the service:
Additional curated screenshots can continue to live in docs/screenshots/.
This project centers on mcp_flux_server.py, which exposes:
generate_imageflux_status
It supports two transports:
stdiofor one-off local/manual usestreamable-httpfor persistent service mode
Persistent service mode also exposes:
/dashboard/health/status/mcpMCP endpoint
| Mode | Model | Intended use | Typical defaults on 12 GB GPU |
|---|---|---|---|
fast |
FLUX.2-klein-4B with local GGUF transformer |
quickest practical workflow | 640x640, 4 steps, 1.0 guidance |
low |
FLUX.2-klein-base-4B |
better quality than fast, slower | 704x704, 16 steps, 1.5 guidance |
high |
FLUX.2-dev |
highest quality, slowest | 768x768, 40 steps, 3.5 guidance |
fast mode expects this local GGUF by default:
B:\Models\unsloth\FLUX.2-klein-4B-GGUF\flux-2-klein-4b-BF16.gguf
You can override that path in either of these ways:
- create a local
.envfile from.env.example - use the dashboard settings panel to save a new
FLUX_FAST_GGUF_PATH
After changing the GGUF path, restart the service.
Notes:
- The GGUF file only covers the transformer weights.
- The rest of the pipeline still loads through Diffusers.
- On the current 12 GB RTX 4070 test machine,
fastmode still falls back to CPU offload, but it is materially lighter than the old base-model workflow.
py -3.12 -m venv flux-env312
.\flux-env312\Scripts\Activate.ps1python -m pip install --upgrade pip
python -m pip install -r requirements.txtIf PyTorch ends up CPU-only, reinstall it using the CUDA wheel source from requirements.txt.
If your GGUF file is not at the default path, copy .env.example to .env and set:
FLUX_FAST_GGUF_PATH=C:\Your\Models\flux-2-klein-4b-BF16.ggufRecommended:
.\start_flux_fast.batOther options:
.\start_flux_low.bat
.\start_flux_high.bat
.\start_flux_menu.batPowerShell equivalents:
.\start_flux_service.ps1 -Mode fast
.\start_flux_service.ps1 -Mode low
.\start_flux_service.ps1 -Mode high- Dashboard:
http://127.0.0.1:8765/ - Health:
http://127.0.0.1:8765/health - Status JSON:
http://127.0.0.1:8765/status - MCP endpoint for Goose:
http://127.0.0.1:8765/mcp
The dashboard also includes a settings panel for updating the fast mode GGUF path. Changes are written to your local .env file and apply after restart.
Use a remote MCP extension instead of the old stdio flow.
- Run
goose configure - Choose
Add Extension - Choose
Remote Extension (Streamable HTTP) - Name it something like
flux-fast - Set endpoint to
http://127.0.0.1:8765/mcp - Set timeout to
3600 - Disable any older local
stdioFLUX extension
Important:
- Goose can still override width and height explicitly.
- The server defaults only apply when Goose does not send those values.
Start:
.\start_flux_service.ps1 -Mode fastStop:
.\stop_flux_service.ps1 -Port 8765Status:
.\status_flux_service.ps1 -Port 8765Live log tail:
.\monitor_flux_service.ps1 -Port 8765The service scripts:
- prevent duplicate healthy instances on the same port
- refuse to start if the port is already occupied by something else
- write per-port metadata and logs under
.flux-service/ - wait until the model is loaded before reporting success
Defaults:
HF_HOME=B:\Pond\hf_cacheHF_HUB_DISABLE_XET=1FLUX_LOAD_STRATEGY=auto
Low-mode overrides:
FLUX_LOW_MODEL_IDFLUX_LOW_WIDTHFLUX_LOW_HEIGHTFLUX_LOW_STEPSFLUX_LOW_GUIDANCE_SCALE
Fast-mode overrides:
FLUX_FAST_MODEL_IDFLUX_FAST_GGUF_PATHFLUX_FAST_GGUF_CONFIG_REPOFLUX_FAST_WIDTHFLUX_FAST_HEIGHTFLUX_FAST_STEPSFLUX_FAST_GUIDANCE_SCALE
Manual foreground stdio launchers are kept for debugging only:
start_flux_low_stdio_legacy.batstart_flux_high_stdio_legacy.bat
Do not run them alongside the persistent Goose service.
| Path | Purpose |
|---|---|
mcp_flux_server.py |
main MCP server |
.env.example |
local config template for per-machine settings |
start_flux_service.ps1 |
persistent service launcher |
status_flux_service.ps1 |
service status summary |
monitor_flux_service.ps1 |
live log tail |
example_mcp_config.json |
example MCP configuration |
MEMORY.md |
running project memory / operating notes |
fastmode is lighter, but it still does not fully avoid offload on the current 12 GB RTX 4070 test machine.highmode is much slower and may require a large first-time download.- In the currently installed Diffusers build,
negative_promptis not exposed inhighmode.
- CUDA is required for intended performance.
- Output images are written to
flux_output/. - Output filenames are sanitized for Windows.
- Requests are serialized so the shared pipeline is not used concurrently.
- Logging goes to
stderrso MCP stdio clients are not corrupted.

