MCP server for InvokeAI image generation
console applicationapt install mcp-server-invokeaiModel Context Protocol server that lets AI agents generate, transform and upscale images through a running InvokeAI instance.
A Model Context Protocol (MCP) server that integrates InvokeAI with Claude Code, enabling AI-powered image generation, transformation, and upscaling directly from your AI assistant.
This MCP server provides a seamless bridge between Claude Code and your local InvokeAI instance, enabling powerful image generation workflows without leaving your development environment. Perfect for creating logos, icons, illustrations, and other visual assets for your projects.
http://127.0.0.1:9090 (or custom URL)The easiest way to install the InvokeAI MCP server:
pip install invokeai-mcp-server
Then register with Claude Code:
# Linux/macOS/WSL
claude mcp add --scope user invokeai python -m invokeai_mcp_server
# Windows
claude mcp add --scope user invokeai python -m invokeai_mcp_server
Install using the Smithery CLI for automatic configuration:
npx @smithery/cli install invokeai --client claude
For development or customization:
# Clone the repository
git clone https://github.com/coinstax/invokeai-mcp-server.git
cd invokeai-mcp-server
# Run the automated setup script
./setup.sh
Or manually:
# Clone the repository
git clone https://github.com/coinstax/invokeai-mcp-server.git
cd invokeai-mcp-server
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
If you installed from source, register with Claude Code:
Linux/WSL/macOS:
claude mcp add --scope user invokeai \
~/invokeai-mcp-server/venv/bin/python \
~/invokeai-mcp-server/invokeai_mcp_server.py
Windows:
claude mcp add --scope user invokeai ^
C:\path\to\invokeai-mcp-server\venv\Scripts\python.exe ^
C:\path\to\invokeai-mcp-server\invokeai_mcp_server.py
claude mcp list
Expected output:
invokeai: ... - ✓ Connected
After registration, restart Claude Code or start a new conversation to access the tools.
generate_imageGenerate images from text prompts with optional LoRA support.
Parameters:
prompt (string, required): Description of the image to generatenegative_prompt (string, optional): Elements to avoid in the generationwidth (integer, optional, default: 512): Image width (64-2048px)height (integer, optional, default: 512): Image height (64-2048px)steps (integer, optional, default: 30): Denoising steps (1-150)cfg_scale (float, optional, default: 7.5): Guidance scale (1.0-20.0)scheduler (string, optional, default: "euler"): Sampling schedulerseed (integer, optional): Random seed for reproducibilitymodel_key (string, optional): Specific model identifierlora_key (string, optional): LoRA model identifier for fine-tuned style controllora_weight (float, optional, default: 1.0): LoRA strength (0.0-2.0)vae_key (string, optional): VAE model identifier to override model's built-in VAEExample:
Generate a minimalist tech logo with blue and white colors, geometric shapes, flat design
Example with LoRA:
Generate a professional logo using the logomkrdsxl LoRA with prompt: "tech startup logo, modern, clean"
img2imgTransform existing images using text guidance with optional LoRA support.
Parameters:
image_path (string, required): Path to source image or image_name from previous generationprompt (string, required): Description of desired transformationnegative_prompt (string, optional): Elements to avoidstrength (float, optional, default: 0.75): Transformation strength (0.0-1.0)steps (integer, optional, default: 30): Denoising steps (1-150)cfg_scale (float, optional, default: 7.5): Guidance scale (1.0-20.0)scheduler (string, optional, default: "euler"): Sampling schedulerseed (integer, optional): Random seed for reproducibilitymodel_key (string, optional): Specific model identifierlora_key (string, optional): LoRA model identifier for fine-tuned style controllora_weight (float, optional, default: 1.0): LoRA strength (0.0-2.0)vae_key (string, optional): VAE model identifier to override model's built-in VAEExample:
Refine this logo with strength 0.6: /path/to/sketch.png
Prompt: professional polished logo, clean lines, modern aesthetic
Example with LoRA:
Transform logo.png with logomkrdsxl LoRA at strength 0.6 to make it more professional
upscale_imageEnhance image resolution using AI upscaling.
Parameters:
image_path (string, required): Path to image or image_name from previous generationmodel_key (string, optional): Specific upscaling model (auto-selects if omitted)Example:
Upscale this image to high resolution: generated_logo.png
list_modelsList available models in your InvokeAI instance.
Parameters:
model_type (string, optional, default: "main"): Model type (main, vae, lora, controlnet, embedding, spandrel_image_to_image)Example:
List all available SDXL models
get_queue_statusCheck InvokeAI processing queue status.
Parameters:
queue_id (string, optional, default: "default"): Queue identifier| Model Type | Minimum VRAM | Recommended VRAM | Notes |
|---|---|---|---|
| SD 1.5 | 4GB | 6-8GB | Faster generation, good for iteration |
| SDXL | 8GB | 12GB+ | Higher quality, slower generation |
| Upscaling (Spandrel) | 4GB | 6GB+ | Depends on source image resolution |
Stable Diffusion XL (SDXL)
Stable Diffusion 1.5
Model repositories:
Note: FLUX models use a different architecture and may have limited compatibility with InvokeAI's workflow system. For best results, use SD 1.5 or SDXL-based models.
1. Generate initial concept with LoRA (512x512, 25 steps, logomkrdsxl LoRA)
2. Refine with img2img + LoRA (strength 0.6-0.7)
3. Upscale to high resolution (4x)
4. Export final asset
1. List available LoRAs: list_models(model_type="lora")
2. Generate with LoRA: generate_image(prompt="...", lora_key="...", lora_weight=1.0)
3. Experiment with weights: Try 0.5 (subtle), 1.0 (standard), 1.5 (strong)
4. Combine with img2img for iterative refinement
1. Generate variations (SD 1.5 for speed)
2. Select best candidate
3. Upscale to production resolution
4. Apply final refinements with img2img
The server implements a graph-based workflow system that interfaces with InvokeAI's node architecture:
All workflows are automatically constructed and managed by the server based on the requested operation.
Symptoms: MCP server doesn't appear in Claude Code tools list
Solutions:
curl http://127.0.0.1:9090/api/v1/app/versionclaude mcp listpip install -r requirements.txt| Issue | Cause | Solution |
|---|---|---|
| Connection refused | InvokeAI not running | Start InvokeAI service |
| No models available | Models not installed | Install models via InvokeAI Model Manager |
| Import errors | Missing dependencies | Run pip install -r requirements.txt |
| Generation fails | Insufficient VRAM | Reduce image size or use SD 1.5 |
| Upscaling fails | No Spandrel models | Install upscaling models in InvokeAI |
| SDXL + LoRA issues | Model incompatibility | Ensure LoRA base type matches SDXL model |
| Black images (SDXL) | Corrupt/missing VAE | Use VAE override: vae_key: "sdxl.vae" or vae_key: "sdxl-vae-fp16-fix" |
If installed via PyPI:
pip uninstall invokeai-mcp-server
claude mcp remove invokeai
If installed via Smithery:
smithery uninstall invokeai --client claude
If installed from source:
claude mcp remove invokeai
Test the server directly:
python3 invokeai_mcp_server.py
The server will start in stdio mode, waiting for MCP protocol messages.
invokeai-mcp-server/
├── invokeai_mcp_server.py # Main server implementation
├── requirements.txt # Python dependencies
├── setup.sh # Automated setup script
├── README.md # Documentation
└── LICENSE # MIT License
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Tento balíček zatím možná není v naší databázi zaindexován. Zkuste to prosím později, nebo zkontrolujte přímo repozitář balíčků.