mcp-server-stability-ai
by: tadasant
MCP Server integrating MCP Clients with Stability AI-powered image manipulation functionalities: generate, edit, upscale, and more.
📌Overview
Purpose: The MCP Server integrates MCP Clients with Stability AI's advanced Stable Diffusion image manipulation capabilities, enabling users to generate, edit, and upscale images efficiently.
Overview: Built primarily for ease of use, the Stability AI MCP Server allows users to leverage Stability AI’s powerful image generation models through a streamlined interface, eliminating the need for technical expertise. It connects directly to Stability AI's hosted REST API, providing a practical solution for image manipulation tasks.
Key Features:
-
No Learning Curve: Designed with sensible defaults and a user-friendly experience, allowing anyone to easily generate and manipulate images without technical knowledge.
-
Chain Manipulations: Facilitates complex image manipulations in a single workflow, enabling users to generate, edit, and enhance images seamlessly within a single session.
-
Minimal Configuration: Users only need a Stability AI API key and can quickly set up their environment to start working with high-quality image models.
Stability AI MCP Server
Haven't heard about MCP yet? The easiest way to keep up-to-date is to read our weekly newsletter at PulseMCP.
This is an MCP (Model Context Protocol) Server integrating MCP Clients with Stability AI's latest Stable Diffusion image manipulation functionalities, including generation, editing, and upscaling.
You will need to sign up for an API Key from Stability AI to get started. They provide 25 credits for free, after which a reasonable pay-as-you-go pricing applies.
Note: This project is NOT officially affiliated with Stability AI.
Table of Contents
Highlights
- No learning curve: Designed with sensible defaults for easy use without technical skills.
- Chain manipulations: Allows for multiple actions in a single conversation.
- Minimal configuration: Just an API key and a directory path to get started.
- Leverage best-in-class models: Integrates Stability AI's leading image models.
Capabilities
This server is built and tested on macOS with Claude Desktop and should work with other MCP clients as well.
Tool Name | Description | Estimated Stability API Cost |
---|---|---|
generate-image | Generate a high quality image based on a prompt. | $0.03 |
remove-background | Remove the background from an image. | $0.02 |
outpaint | Extend an image in any direction while maintaining visual consistency. | $0.04 |
search-and-replace | Replace elements in an image by describing what to replace and its replacement. | $0.04 |
upscale-fast | Enhance image resolution by 4x. | $0.01 |
control-sketch | Translate hand-drawn sketches to production-grade images. | $0.03 |
control-style | Generate an image in the style of a reference image. | $0.04 |
Usage Tips
- All processed images are automatically saved and made available as resources.
- Do not copy/paste or upload image files to Claude; images must be saved to the designated directory.
- Use preloaded prompts instead of writing your own.
Examples
Generate an image:
- Generate a photorealistic image of a cat in a cyberpunk city.
- Generate an astronaut on Mars using the SD3.5 model.
Remove background:
- Remove the background from a generated image or product photo.
Outpaint (Uncrop):
- Extend vacation photos to include more scenery.
Search and Replace:
- Replace objects in images based on given descriptions.
Upscale:
- Upscale images for better resolution.
Setup
Cheatsheet
Environment Variable | Description | Required | Example |
---|---|---|---|
STABILITY_AI_API_KEY | Your Stability AI API key. | Yes | sk-1234567890 |
IMAGE_STORAGE_DIRECTORY | Directory where generated images will be saved. | No | /Users/admin/Downloads/images |
GCS_PROJECT_ID | Google Cloud Project ID for storing images. | No (Yes if SSE) | your-project-id |
Claude Desktop
To store images, create a folder on your machine and ensure you have an API key from Stability AI. Follow the official MCP setup instructions for integration.
Manual Setup
Node.js is required to run commands. Modify your claude_desktop_config.json
with the necessary configurations to integrate the MCP server.
SSE Mode
Run the server in SSE mode for third-party usage. Set additional environment variables for Google Cloud Storage.
Roadmap
Recently completed:
- ✅ Added support for the latest Stable Diffusion 3.5 models.
Planned features include more precise inpainting functionalities, base image manipulation tools, and a custom MCP client for image manipulation.
Contributing
External contributions are welcome! See 1 for more details.