MCP Replicate FLUX [](https://smithery.ai/server/@andylee20014/mcp-replicate-flux)
A Model Context Protocol (MCP) server that generates images using Replicate's FLUX model and stores them in Cloudflare R2.
Replicate FLUX Cloudflare R2 MCP
Features Generate images using Replicate's black-forest-labs/flux-schnell model Store generated images in Cloudflare R2 Return accessible image URLs Support for custom prompts and filenames Replicate black-forest-labs/flux-schnell Prerequisites Cloudflare R2 bucket and credentials Environment Variables Required environment variables in `.env` file:
`.env`
Local Installation Installing via Smithery To install MCP Replicate FLUX for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@andylee20014/mcp-replicate-flux):
Installing manually Follow these steps to set up the project locally:
Make sure your Cloudflare R2 bucket has appropriate CORS settings for public access to the uploaded images.
Running Locally To start the MCP server locally:
The server will start and listen for MCP protocol messages on standard input/output.
Usage The server provides a `generate-image` tool that accepts two parameters:
`prompt`: The text prompt for image generation `filename`: The desired filename for the generated image
`generate-image` Integration Example Here's an example of how to integrate with this MCP server using the MCP client library:
Example response
Testing A test script is provided to verify the image generation and upload functionality.
Running the test The test script will:
Generate an image with a sample prompt Upload the image to Cloudflare R2 Return the accessible URL Cloudflare R2 URL Example test output
You can modify the prompt in `test.js` to test different image generation scenarios.
Cursor MCP Configuration Cursor MCP There are two ways to configure the MCP server in Cursor:
Cursor MCP
Method 1: Complete Configuration Create a file at `~/.cursor/mcp.json` with all environment variables:
`~/.cursor/mcp.json`
Method 2: Minimal Configuration If you prefer to manage environment variables separately (using system environment variables or .env file), you can use a minimal configuration:
When using the minimal configuration, make sure your environment variables are properly set up either in:
System environment variables `.env` file in the project directory Cloud platform's environment variables (for deployed servers) Notes The `description` field is optional in both methods Environment variables in the configuration file take precedence over system environment variables After changing the configuration, restart Cursor to apply the changes Project Structure Troubleshooting Common Issues **Image generation fails**: Check your Replicate API token and quota **R2 upload fails**: Verify your R2 credentials and bucket permissions **Cannot access generated images**: Ensure your R2 bucket has proper CORS configuration ** ** Replicate API **R2 ** R2 ** ** R2 CORS MCP Protocol The Model Context Protocol (MCP) is a standard for AI model interaction that enables interoperability between different AI systems. This server implements an MCP tool that can be used with any MCP-compatible client.
For more information about MCP, visit: [https://mcp.freeaigen.com/](https://mcp.freeaigen.com/)
References [Model Context Protocol Documentation](https://mcp.freeaigen.com/) [Replicate API Documentation](https://replicate.com/docs) [Cloudflare R2 Documentation](https://developers.cloudflare.com/r2/) [Flux AI Model](https://replicate.com/black-forest-labs/flux-schnell) License MIT