keizerkarel1/stability-ai-mcp-server
If you are the rightful owner of stability-ai-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol server for Stability AI image generation, extending the original work with support for newer models.
A note
Everything below is AI and was vibecoded way too quickly because I found out noone had made it and I needed images now. It works for me, your mileage may vary. I may actually work on this someday. You can ask claude how this works after you install it if you want.
Stability AI MCP Server
A Model Context Protocol server for Stability AI image generation. This Python implementation extends the original work by @tadasant with support for the newer Core and Ultra models, plus automatic image preview via system viewer.
Credit
This project builds upon the excellent foundation laid by @tadasant's original MCP server for Stability AI. Please refer to the original repository for additional usage examples and patterns. This Python implementation adds:
- Support for the new
stable-image-coreandstable-image-ultraendpoints - Updated SD3.5 model support
- Automatic image preview - images open automatically in your system's default image viewer
- Organized file structure - metadata saved in separate
/metadatasubfolder - Python-based implementation for easier community contribution
- Enhanced error handling and validation
Supported Models
Core/Ultra Models (newer endpoints):
stable-image-core(default): Fast, affordable, natural language optimizedstable-image-ultra: Highest quality, state-of-the-art results
SD3.5 Family Models:
sd3.5-large: 8B parameter model with maximum detailsd3.5-large-turbo: Faster version of SD3.5 Largesd3.5-medium: 2B parameter model, efficientsd3.5-flash: Ultra-fast 4-step generation
Requirements
- Python 3.10+
- Stability AI API key from platform.stability.ai/account/keys
- Claude Desktop
Installation
Install directly from GitHub:
pip install --user git+https://github.com/keizerkarel1/stability-ai-mcp-server
Configuration
Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Windows Configuration:
{
"mcpServers": {
"stability-ai": {
"command": "C:\\Users\\yourusername\\AppData\\Roaming\\Python\\Python311\\Scripts\\stability-mcp-server.exe",
"env": {
"STABILITY_API_KEY": "your-stability-api-key-here",
"IMAGE_STORAGE_PATH": "C:\\Users\\yourusername\\Pictures\\StabilityAI"
}
}
}
}
macOS Configuration:
{
"mcpServers": {
"stability-ai": {
"command": "stability-mcp-server",
"env": {
"STABILITY_API_KEY": "your-stability-api-key-here",
"IMAGE_STORAGE_PATH": "/Users/yourusername/Pictures/StabilityAI"
}
}
}
}
Required:
STABILITY_API_KEY: Your Stability AI API key
Optional:
IMAGE_STORAGE_PATH: Directory for saving generated images (defaults to./images/)
Restart Claude Desktop after configuration.
Usage
Text-to-image:
Generate a mountain landscape at sunset
With specific model:
Generate a cityscape using sd3.5-large model
Image-to-image:
Transform this image: /path/to/image.jpg into a watercolor style
Images will automatically open in your system's default image viewer and be saved to your configured storage path.
Tools
generate_image
Parameters:
prompt(required): Text descriptionmodel: Model to use (default:stable-image-core)aspect_ratio: Image ratio (default:1:1)seed: Random seed (default:0)output_format:pngorjpeg(default:png)negative_prompt: What to avoid in the imageimage_path: Input image for image-to-imagestrength: Transformation strength 0.0-1.0 (default:0.7)
list_models
Returns available models and their capabilities.
get_storage_info
Returns storage directory information and statistics.
File Storage
Images are automatically saved with organized file structure:
/your/storage/path/
├── stability_20250106_143022_12345.png
└── metadata/
└── stability_20250106_143022_12345_metadata.json
Metadata files are saved in a separate metadata subfolder and include generation parameters, file info, and API response details.
Model Selection
stable-image-core (default): Fast, affordable, natural language optimized. Good for everyday use.
stable-image-ultra: Highest quality results. Better for important or detailed images.
sd3.5-large: Maximum control and detail. Good for technical artwork.
sd3.5-medium: Balanced performance and cost.
sd3.5-flash: Fastest generation. Good for quick previews and iteration.
Contributing
Contributions are welcome. Please submit issues or pull requests to improve the code, documentation, or add features.
License
Open source. See LICENSE file for details.
Acknowledgments
-
@tadasant for the original MCP server implementation
-
Stability AI for the image generation APIs
-
Anthropic for Claude Desktop