The Image Generation MCP Server enables high-quality image generation using the Flux.1 Schnell model via Together AI. With this server, you can:
Generate images from text prompts
Customize dimensions (width and height)
Control the number of images (up to 4 per request)
Adjust inference steps
Choose response format (base64-encoded JSON or URL)
Optionally save generated images to disk in PNG format
Benefit from error handling for prompt validation and API issues
Easily integrate with MCP-compatible clients
Uses the Flux.1 Schnell model via Together AI to generate high-quality images based on text prompts
Image Generation MCP Server
A Model Context Protocol (MCP) server that enables seamless generation of high-quality images using the Flux.1 Schnell model via Together AI. This server provides a standardized interface to specify image generation parameters.
Features
High-quality image generation powered by the Flux.1 Schnell model
Support for customizable dimensions (width and height)
Clear error handling for prompt validation and API issues
Easy integration with MCP-compatible clients
Optional image saving to disk in PNG format
Related MCP server: Image Generation MCP Server
Installation
Or run directly:
Configuration
Add to your MCP server configuration:
Usage
The server provides one tool: generate_image
Using generate_image
This tool has only one required parameter - the prompt. All other parameters are optional and use sensible defaults if not provided.
Parameters
Minimal Request Example
Only the prompt is required:
Full Request Example with Image Saving
Override any defaults and specify a path to save the image:
Response Format
The response will be a JSON object containing:
If image_path was provided and the save was successful, the response will include confirmation of the save location.
Default Values
If not specified in the request, these defaults are used:
model: "black-forest-labs/FLUX.1-schnell-Free"
width: 1024
height: 768
steps: 1
n: 1
response_format: "b64_json"
Important Notes
Only the
promptparameter is requiredAll optional parameters use defaults if not provided
When provided, parameters must meet their constraints (e.g., width/height ranges)
Base64 responses can be large - use URL format for larger images
When saving images, ensure the specified directory exists and is writable
Prerequisites
Node.js >= 16
Together AI API key
Sign in at api.together.xyz
Navigate to API Keys settings
Click "Create" to generate a new API key
Copy the generated key for use in your MCP configuration
Dependencies
Development
Clone and build the project:
Available Scripts
npm run build- Build the TypeScript projectnpm run watch- Watch for changes and rebuildnpm run inspector- Run MCP inspector
Contributing
Contributions are welcome! Please follow these steps:
Fork the repository
Create a new branch (
feature/my-new-feature)Commit your changes
Push the branch to your fork
Open a Pull Request
Feature requests and bug reports can be submitted via GitHub Issues. Please check existing issues before creating a new one.
For significant changes, please open an issue first to discuss your proposed changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.