AI Image Generation Server with MCP Interface
@aymec
About AI Image Generation Server with MCP Interface
This project provides an HTTP server for image generation using Stable Diffusion, along with a Model Context Protocol (MCP) server that enables AI agents to request image generation.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"image_gen_with_mcp": {
"command": "python",
"args": [
"generate_image.py"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is AI Image Generation Server with MCP Interface?
This project is an MCP (Model Context Protocol) server with integrated Stable Diffusion image generation capabilities. It enables AI agents to request and receive generated images via a standardized MCP interface. It is based on Block's Goose Custom Extension tutorial.
How to use AI Image Generation Server with MCP Interface?
Set up a virtual environment (mandatorily named .venv), install the MCP package (pip install -e .), then run the combined service with image-gen-mcp after setting the IMAGE_GEN_DIR environment variable. Alternatively, use development mode with the FastMCP Inspector for testing and debugging. Integrate with Goose as a StandardIO extension by providing the executable path and the IMAGE_GEN_DIR variable.
Key features of AI Image Generation Server with MCP Interface
- Combined MCP server and image generation service
- Uses Stable Diffusion for text-to-image generation
- Provides a direct HTTP API for image generation
- Returns image URL, dimensions, format, and metadata
- Runs on port 5000 by default (customizable)
- Supports integration with Goose and the FastMCP Inspector
Use cases of AI Image Generation Server with MCP Interface
- AI agents generating images based on user prompts
- Testing and debugging image generation with FastMCP Inspector
- Integrating image generation into custom AI workflows via MCP
- Running local image generation with Ollama (tested with mistral-small3.1)
- Serving generated images via HTTP for direct access
FAQ from AI Image Generation Server with MCP Interface
What runtime does it require?
It requires Python 3 and a virtual environment. The project uses the mcp package and Stable Diffusion dependencies installed via pip install -e ..
How do I set the output folder for images?
Set the environment variable IMAGE_GEN_DIR to the absolute path of the target folder before starting the service.
Can I change the port for the image generation service?
Yes, use the --port flag when running image-gen-mcp (e.g., image-gen-mcp --port 5001).
Does it work with local models like Ollama?
Yes, it can run locally with Ollama. The only model tested successfully is mistral-small3.1, though it is slower than using OpenAI GPT-4o.
How do I stop the service?
Press Ctrl+C to stop both the MCP server and the image generation service, as they run within the same process.
Frequently asked questions
What runtime does it require?
It requires Python 3 and a virtual environment. The project uses the `mcp` package and Stable Diffusion dependencies installed via `pip install -e .`.
How do I set the output folder for images?
Set the environment variable `IMAGE_GEN_DIR` to the absolute path of the target folder before starting the service.
Can I change the port for the image generation service?
Yes, use the `--port` flag when running `image-gen-mcp` (e.g., `image-gen-mcp --port 5001`).
Does it work with local models like Ollama?
Yes, it can run locally with Ollama. The only model tested successfully is mistral-small3.1, though it is slower than using OpenAI GPT-4o.
How do I stop the service?
Press Ctrl+C to stop both the MCP server and the image generation service, as they run within the same process.
Basic information
More Media & Design MCP servers
Framelink Figma MCP Server
GLipsMCP server to provide Figma layout information to AI coding agents like Cursor
Melrōse - programming of music melodies
emickleiinteractive programming of melodies, producing MIDI
KiCAD MCP: AI-Assisted PCB Design
mixelpixxKiCAD MCP is a Model Context Protocol (MCP) implementation that enables Large Language Models (LLMs) like Claude to directly interact with KiCAD for printed circuit board design.
RustChain MCP
ScottcjnMCP server for RustChain blockchain and BoTTube video platform — AI agent tools for earning RTC tokens. Built on createkr's RustChain SDK.
Image-Gen-Server
fengin一个能与Cursor集成的图片生成mcp server工具,实现调用即梦逆向接口
Comments