mcp-flux-studio
by: jmanhype
A Model Context Protocol server for Flux image generation, providing tools for image generation, manipulation, and control
πOverview
Purpose: MCP Flux Studio aims to seamlessly integrate Flux's advanced image generation capabilities into AI coding assistants, enhancing the development workflow.
Overview: MCP Flux Studio serves as a powerful server that bridges AI coding tools with the Flux image generation API. It enables developers to incorporate advanced image creation and manipulation functionalities directly into IDEs like Cursor and Windsurf, thereby streamlining the development process.
Key Features:
-
Image Generation: Offers text-to-image capabilities with various models and customizable dimensions, providing users with control over their outputs.
-
Image Manipulation: Allows for transformations and enhancements including inpainting and resolution upscaling, making it easy to refine images.
-
Advanced Controls: Features methods like edge-based, depth-aware, and pose-guided generation to enhance creative options for developers.
-
IDE Integration: Fully compatible with Cursor and Windsurf/Codeium, enabling straightforward invocation of tools via AI assistants and improving productivity.
MCP Flux Studio
MCP Flux Studio is a powerful Model Context Protocol (MCP) server that integrates Flux's advanced image generation capabilities into AI coding assistants like Cursor and Windsurf (Codeium).
Overview
MCP Flux Studio enhances the development workflow by bridging AI coding assistants with Flux's image generation API, allowing for seamless integration of image generation capabilities.
Features
-
Image Generation
- Text-to-image generation
- Support for multiple models
- Customizable aspect ratios and dimensions
-
Image Manipulation
- Image-to-image transformation
- Inpainting with masks
- Resolution upscaling
-
Advanced Controls
- Edge-based and depth-aware generation
- Pose-guided generation
-
IDE Integration
- Support for Cursor and Windsurf/Codeium
Quick Start
Prerequisites
- Node.js 18+
- Python 3.12+
- Flux API key
- Compatible IDE (Cursor or Windsurf)
Installation
Installing via Smithery
npx -y @smithery/cli install @jmanhype/mcp-flux-studio --client claude
Manual Installation
git clone https://github.com/jmanhype/mcp-flux-studio.git
cd mcp-flux-studio
npm install
npm run build
Basic Configuration
BFL_API_KEY=your_flux_api_key
FLUX_PATH=/path/to/flux/installation
For detailed setup instructions, see our 1.
Documentation
- 1
- 1
- 1
- 1
IDE Integration
Cursor (v0.45.7+)
- Configuration: Configure via Settings > Features > MCP
- Usage: Tools available to Cursor's AI assistant require user approval for invocation.
Windsurf/Codeium (Wave 3+)
- Configuration: Edit
~/.codeium/windsurf/mcp_config.json
- Usage: Access tools through Cascade's MCP toolbar.
For detailed IDE-specific setup instructions, see the 1.
Usage
Generate
Generate an image from a text prompt.
{
"prompt": "A photorealistic cat",
"model": "flux.1.1-pro",
"aspect_ratio": "1:1",
"output": "generated.jpg"
}
Img2Img
Generate an image using another image as reference.
{
"image": "input.jpg",
"prompt": "Convert to oil painting",
"model": "flux.1.1-pro",
"strength": 0.85,
"output": "output.jpg"
}
Inpaint
Inpaint using a mask.
{
"image": "input.jpg",
"prompt": "Add flowers",
"mask_shape": "circle",
"position": "center",
"output": "inpainted.jpg"
}
Control
Generate an image using structural control.
{
"type": "canny",
"image": "control.jpg",
"prompt": "A realistic photo",
"output": "controlled.jpg"
}
Development
Project Structure
flux-mcp-server/
βββ src/
β βββ index.ts # Main server implementation
β βββ types.ts # TypeScript type definitions
βββ tests/
β βββ server.test.ts # Server tests
βββ docs/
β βββ API.md # API documentation
β βββ CONTRIBUTING.md # Contribution guidelines
βββ examples/
β βββ generate.json # Example tool usage
β βββ config.json # Example configuration
βββ package.json
βββ tsconfig.json
βββ README.md
Running Tests
npm test
Building
npm run build
Contributing
Please read 1 for details on contributing.
License
This project is licensed under the MIT License.