- Home
- MCP servers
- Flux Schnell
Flux Schnell
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"m-mcp-flux-schnell-server": {
"command": "mcp",
"args": [
"dev",
"main.py"
]
}
}
}Flux Schnell Server provides an MCP-compliant image generation API built on the Flux Schnell model. It enables you to generate images with customizable size and seeds, supports asynchronous streaming, and can interface with Hugging Face model services over HTTP for scalable image generation workflows.
How to use
You can run the Flux Schnell Server in development mode using the MCP tooling or an inspector to debug. To generate an image, call the image generation function from your MCP client by providing a prompt and optional parameters such as width, height, and seed. The server supports streaming responses so you can start receiving image data as it’s produced.
How to install
Prerequisites: Python 3.10 or newer. Ensure you have the following dependencies installed at runtime.
uv venv && source .venv/bin/activate # Unix/macOS
# 或
.venv\Scripts\activate # Windows
Install development dependencies in editable mode so you can work on the project and test changes quickly.
uv sync # 以可编辑模式安装项目
For debugging the server and exercising the image generation tool, enable the development environment and run the main entry point as shown.
mcp dev main.py
或者
npx -y @modelcontextprotocol/inspector uv run main.py
When using the image generation tool from your code, you can pass optional parameters for image width, height, and seed to reproduce results.
# 示例代码
async def test_main():
img_url = await image_generation(
prompt="your prompt here",
image_width=512, # 可选,默认512
image_height=512, # 可选,默认512
seed=3 # 可选,默认3
)
print(img_url)
Additional notes
API parameters include prompt (required), image_width and image_height (optional, defaults to 512), and seed (optional, defaults to 3). The server can generate images asynchronously and return a URL that you can use for display, sharing, or embedding in applications.
Security and troubleshooting
Ensure you are using a secure environment for generating and exposing image URLs. If you encounter issues starting the server, double-check that your Python version is 3.10 or newer and that dependencies are installed in the active virtual environment.
Available tools
image_generation
Generates an image from a text prompt with optional width, height, and seed; returns a URL to the generated image.
dev_server
Run the server in development mode for debugging and testing image generation workflows.
streaming_api
Supports asynchronous streaming responses to deliver image data as it is generated.
huggingface_http
HTTP interface to Hugging Face model services for scalable image generation.