replicate-flux-mcp
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Enables image generation using Replicate's API with the Black Forest Labs' Flux Schnell model, allowing customization of aspect ratio, quality, and other parameters
Replicate Flux MCP
A powerful Model Context Protocol (MCP) server that provides AI assistants with the ability to generate images using Black Forest Labs' Flux Schnell model via Replicate's API.
Installation • Features • Usage • Documentation • Contributing
🌟 Features
- 🖼️ High-Quality Image Generation: Access to Flux Schnell, a state-of-the-art image generation model
- 🤖 Seamless AI Integration: Enable AI assistants like Claude to generate images directly
- 🎛️ Customizable Parameters: Control aspect ratio, quality, inference steps, and more
- 🔌 MCP Compatible: Works with any MCP client (Cursor, Claude Desktop, Cline, Zed, etc.)
- 🔒 Local Processing: All requests are processed locally and securely
- 🔍 Prediction Management: View and retrieve your generation history
📦 Installation
NPM Global Installation
Direct Usage with NPX
From Source
📚 Documentation
Available Tools
generate_image
Generates an image based on a text prompt using the Flux Schnell model.
prediction_list
Retrieves a list of your recent predictions from Replicate.
get_prediction
Gets detailed information about a specific prediction.
🔧 Usage
Cursor Integration
Method 1: Using mcp.json
- Create or edit the
.cursor/mcp.json
file in your project directory:
- Replace
YOUR_TOKEN
with your actual Replicate API token - Restart Cursor to apply the changes
Method 2: Using Cursor MCP Settings
- Open Cursor and go to Settings
- Navigate to the "MCP" or "Model Context Protocol" section
- Click "Add Server" or equivalent
- Enter the following command in the appropriate field:
- Replace
YOUR_TOKEN
with your actual Replicate API token - Save the settings and restart Cursor if necessary
Claude Desktop Integration
Smithery Integration
This MCP server is available as a hosted service on Smithery, allowing you to use it without setting up your own server.
- Visit Smithery and create an account if you don't have one
- Navigate to the Replicate Flux MCP server page
- Click "Add to Workspace" to add the server to your Smithery workspace
- Configure your MCP client (Cursor, Claude Desktop, etc.) to use your Smithery workspace URL
Benefits of using the Smithery-hosted version:
- No local setup required
- Always running the latest version
- Managed infrastructure and reliability
- Easy integration with other Smithery MCP servers
For more information on using Smithery with your MCP clients, visit the Smithery documentation.
💻 Local Development
- Clone the repository:
- Install dependencies:
- Start development mode:
- Build the project:
🛠 Technical Stack
- Model Context Protocol SDK - Core MCP functionality
- Replicate API - Image generation service
- TypeScript - Type safety and modern JavaScript features
- Zod - Runtime type validation
⚙️ Configuration
The server can be configured by modifying the CONFIG
object in src/index.ts
:
🔍 Troubleshooting
Common Issues
Authentication Error
- Ensure your
REPLICATE_API_TOKEN
is correctly set in the environment - Verify your token is valid by testing it with the Replicate API directly
Timeout Error
- The server polls for completion 5 times by default
- For larger images or busy servers, try increasing
pollingAttempts
orpollingInterval
Safety Filter Triggered
- The model has a built-in safety filter that may block certain prompts
- Try modifying your prompt to avoid potentially problematic content
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Resources
- Model Context Protocol Documentation
- Replicate API Documentation
- Flux Schnell Model
- MCP TypeScript SDK
- Smithery Documentation
Made with ❤️ by Yaroslav Boiko
This server cannot be installed
MCP for Replicate Flux Model. Generating images by prompts
- 🌟 Features
- 📦 Installation
- 📚 Documentation
- 🔧 Usage
- 💻 Local Development
- 🛠 Technical Stack
- ⚙️ Configuration
- 🔍 Troubleshooting
- 🤝 Contributing
- 📄 License
- 🔗 Resources