Stability AI MCP server
Community MCP server for Stability AI: generate, edit, upscale, outpaint, and restyle images with Stable Diffusion from your agent.
mcp-server-stability-ai is a well-maintained community MCP server that puts Stability AI's image generation and editing API behind an agent's tool calls. It is not officially affiliated with Stability AI, but it covers the platform's core creative surface: generate images from a prompt (including the Stable Diffusion 3.5 models), remove backgrounds, outpaint to extend a canvas, search-and-replace objects by description, upscale fast (4x) or creatively (up to 4K), recolor objects, and relight a replaced background.
It also exposes Stability's structural and stylistic controls — control-sketch turns a rough drawing into a finished image, control-style transfers the look of a reference, and control-structure preserves a reference's composition — so an agent can do real production image work, not just one-shot generation. The server runs locally over stdio via npx (mcp-server-stability-ai) and authenticates with a STABILITY_AI_API_KEY; you also set IMAGE_STORAGE_DIRECTORY so generated images are written somewhere the agent and you can find them. It is MIT-licensed, published on npm, and a common pick for design-to-image agent workflows.
Quick install
Copy-paste configs are provided for all 8 supported clients. Pick your client below.
Available tools
| Tool | Description |
|---|---|
| generate-image | Generate a high quality image of anything based on a provided prompt and other optional parameters. |
| generate-image-sd35 | Generate an image using Stable Diffusion 3.5 models with advanced configuration options. |
| remove-background | Remove the background from an image. |
| outpaint | Extend an image in any direction while maintaining visual consistency. |
| search-and-replace | Replace objects or elements in an image by describing what to replace and what to replace it with. |
| upscale-fast | Enhance image resolution by 4x. |
| upscale-creative | Enhance image resolution up to 4K. |
| control-sketch | Translate a hand-drawn sketch into a production-grade image. |
| control-style | Generate an image in the style of a reference image. |
| control-structure | Generate an image while maintaining the structure of a reference image. |
| replace-background-and-relight | Replace the background of an image and relight it. |
| search-and-recolor | Search for and recolor objects in an image. |
Required configuration
- STABILITY_AI_API_KEYRequired
Stability AI API key from platform.stability.ai/account/keys. Required.
- IMAGE_STORAGE_DIRECTORYRequired
Filesystem path where generated and edited images are saved. Required.
What you can do with it
Edit an image without leaving the agent
Hand the agent an image and ask it to remove the background, replace an object, and upscale to 4K — it chains remove-background, search-and-replace, and upscale-creative, saving each result to your image directory.
Turn a sketch into a finished asset
Give the agent a rough drawing and a style reference, and it calls control-sketch and control-style to produce a polished, on-brand image ready to drop into a design.
FAQ
- Is it free?
- The MCP server is open source (MIT) and free to run, but it calls Stability AI's API against your STABILITY_AI_API_KEY, which is credit-based and paid (Stability provides a small number of free credits to start). You pay per generation or edit.
- Does it support remote/OAuth?
- No. It runs locally over stdio via npx and authenticates with a STABILITY_AI_API_KEY. It also requires IMAGE_STORAGE_DIRECTORY so generated images are written to disk.
- Is this an official Stability AI server?
- No. It is an independent, community-maintained server and is not officially affiliated with Stability AI, though it targets Stability's official image API.