Flux Image MCP is a Model Context Protocol (MCP) designed for image generation and modification using the Flux Schnell model on Replicate. With this tool, users can generate AI-powered images from text prompts and modify existing images through an interactive drag-and-drop interface.
✔️ Generate images using AI from a descriptive text prompt.
✔️ Modify images by applying AI transformations.
✔️ Drag and drop files into the terminal for easy modification.
✔️ Interactive CLI guides users step by step.
✔️ Automatically saves generated images in images-from-prompt/.
✔️ Automatically saves modified images in modified_images/.
Ensure you have the following installed:
- Node.js (latest LTS version recommended)
- TypeScript
- A Replicate API token
-
Clone the Repository
git clone <your-repo-url> cd flux-image-mcp
-
Install Dependencies
npm install
-
Set Up Environment Variables Create a
.envfile and add your Replicate API token:echo "REPLICATE_API_TOKEN=your-token-here" > .env
-
Run in Development Mode
npm run dev
- Run the MCP server:
node index.ts
- Enter a text prompt when prompted (e.g., "A futuristic cyberpunk city at night").
- The generated image will be saved in
images-from-prompt/.
- Run the MCP server:
node index.ts
- Drag and drop an image file when prompted or manually enter the file path.
- Enter a modification description (e.g., "Make it look like a watercolor painting").
- The modified image will be saved in
modified_images/.
flux-image-mcp/
│── images/ # Original images to modify
│── modified_images/ # AI-modified images
│── images-from-prompt/ # AI-generated images
│── src/ # Source code
│── index.ts # Main MCP implementation
│── package.json # Project dependencies
│── tsconfig.json # TypeScript config
│── README.md # Project documentationFor production, build and run the project using:
npm run build
npm startThis project is licensed under the MIT License. Feel free to modify and distribute it under the terms of the license.
We welcome contributions! Feel free to open issues or submit pull requests.
For questions or support, reach out via GitHub issues or email.
🚀 Happy coding! 🎨✨