Replicate Flux MCP

Replicate Flux MCP

MCP-compatible server for high-quality image and SVG generation via Replicate models.

66
Stars
14
Forks
66
Watchers
1
Issues
Replicate Flux MCP is an advanced Model Context Protocol (MCP) server designed to enable AI assistants to generate high-quality raster images and vector graphics. It leverages Replicate's Flux Schnell model for image synthesis and Recraft V3 SVG model for vector output, supporting seamless integration with AI platforms like Cursor, Claude Desktop, Smithery, and Glama.ai. Users can generate images and SVGs by simply providing natural language prompts, with support for parameter customization, batch processing, and variant creation.

Key Features

MCP compatibility for standardized model context handling
Support for Flux Schnell (raster image) and Recraft V3 SVG (vector) models
Integration with popular AI tools including Cursor, Claude Desktop, Smithery, and Glama.ai
Natural language prompt-based image and SVG generation
Customizable parameters for output refinement
Batch image and variant generation capabilities
Easy setup using mcp.json configuration files
Environment variable support for secure API authentication
NPM distribution and simple npx command usage
Compatibility with both raster and vector generation tasks

Use Cases

Generating high-quality raster images for AI-driven applications
Creating SVG vector graphics using AI model prompts
Integrating with AI assistants for seamless image generation workflows
Enabling natural-language-based creativity tools for design and illustration
Batch processing of images or SVGs for content creation
Producing variants of generated images for iterative design
Rapid prototyping of visual assets in user interfaces and documentation
Enhancing conversation agents with on-demand image creation
Automating illustrative responses in chat or productivity software
Collaborative generation of graphics in design and developer tools

README

MseeP.ai Security Assessment Badge

Replicate Flux MCP

MCP Compatible License TypeScript Model Context Protocol smithery badge NPM Downloads Stars

Replicate Flux MCP is an advanced Model Context Protocol (MCP) server that empowers AI assistants to generate high-quality images and vector graphics. Leveraging Black Forest Labs' Flux Schnell model for raster images and Recraft's V3 SVG model for vector graphics via the Replicate API.

πŸ“‘ Table of Contents

πŸš€ Getting Started & Integration

Setup Process

  1. Obtain a Replicate API Token

    • Sign up at Replicate
    • Create an API token in your account settings
  2. Choose Your Integration Method

    • Follow one of the integration options below based on your preferred MCP client
  3. Ask Your AI Assistant to Generate an Image

    • Simply ask naturally: "Can you generate an image of a serene mountain landscape at sunset?"
    • Or be more specific: "Please create an image showing a peaceful mountain scene with a lake reflecting the sunset colors in the foreground"
  4. Explore Advanced Features

    • Try different parameter settings for customized results
    • Experiment with SVG generation using generate_svg
    • Use batch image generation or variant generation features

Cursor Integration

Method 1: Using mcp.json

  1. Create or edit the .cursor/mcp.json file in your project directory:
json
{
  "mcpServers": {
    "replicate-flux-mcp": {
      "command": "env REPLICATE_API_TOKEN=YOUR_TOKEN npx",
      "args": ["-y", "replicate-flux-mcp"]
    }
  }
}
  1. Replace YOUR_TOKEN with your actual Replicate API token
  2. Restart Cursor to apply the changes

Method 2: Manual Mode

  1. Open Cursor and go to Settings
  2. Navigate to the "MCP" or "Model Context Protocol" section
  3. Click "Add Server" or equivalent
  4. Enter the following command in the appropriate field:
env REPLICATE_API_TOKEN=YOUR_TOKEN npx -y replicate-flux-mcp
  1. Replace YOUR_TOKEN with your actual Replicate API token
  2. Save the settings and restart Cursor if necessary

Claude Desktop Integration

  1. Create or edit the mcp.json file in your configuration directory:
json
{
  "mcpServers": {
    "replicate-flux-mcp": {
      "command": "npx",
      "args": ["-y", "replicate-flux-mcp"],
      "env": {
        "REPLICATE_API_TOKEN": "YOUR TOKEN"
      }
    }
  }
}
  1. Replace YOUR_TOKEN with your actual Replicate API token
  2. Restart Claude Desktop to apply the changes

Smithery Integration

This MCP server is available as a hosted service on Smithery, allowing you to use it without setting up your own server.

  1. Visit Smithery and create an account if you don't have one
  2. Navigate to the Replicate Flux MCP server page
  3. Click "Add to Workspace" to add the server to your Smithery workspace
  4. Configure your MCP client (Cursor, Claude Desktop, etc.) to use your Smithery workspace URL

For more information on using Smithery with your MCP clients, visit the Smithery documentation.

Glama.ai Integration

This MCP server is also available as a hosted service on Glama.ai, providing another option to use it without local setup.

  1. Visit Glama.ai and create an account if you don't have one
  2. Go to the Replicate Flux MCP server page
  3. Click "Install Server" to add the server to your workspace
  4. Configure your MCP client to use your Glama.ai workspace

For more information, visit the Glama.ai MCP servers documentation.

🌟 Features

  • πŸ–ΌοΈ High-Quality Image Generation - Create stunning images using Flux Schnell, a state-of-the-art AI model
  • 🎨 Vector Graphics Support - Generate professional SVG vector graphics with Recraft V3 SVG model
  • πŸ€– AI Assistant Integration - Seamlessly enable AI assistants like Claude to generate visual content
  • πŸŽ›οΈ Advanced Customization - Fine-tune generation with controls for aspect ratio, quality, resolution, and more
  • πŸ”Œ Universal MCP Compatibility - Works with all MCP clients including Cursor, Claude Desktop, Cline, and Zed
  • πŸ”’ Secure Local Processing - All requests are processed locally for enhanced privacy and security
  • πŸ” Comprehensive History Management - Track, view, and retrieve your complete generation history
  • πŸ“Š Batch Processing - Generate multiple images from different prompts in a single request
  • πŸ”„ Variant Exploration - Create and compare multiple interpretations of the same concept
  • ✏️ Prompt Engineering - Fine-tune image variations with specialized prompt modifications

πŸ“š Documentation

Available Tools

generate_image

Generates an image based on a text prompt using the Flux Schnell model.

typescript
{
  prompt: string;                // Required: Text description of the image to generate
  seed?: number;                 // Optional: Random seed for reproducible generation
  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)
  megapixels?: "1" | "0.25";     // Optional: Image resolution (default: "1")
  num_outputs?: number;          // Optional: Number of images to generate (1-4) (default: 1)
  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
  output_format?: string;        // Optional: Output format ("webp", "jpg", "png") (default: "webp")
  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)
  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)
  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}

generate_multiple_images

Generates multiple images based on an array of prompts using the Flux Schnell model.

typescript
{
  prompts: string[];             // Required: Array of text descriptions for images to generate (1-10 prompts)
  seed?: number;                 // Optional: Random seed for reproducible generation
  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)
  megapixels?: "1" | "0.25";     // Optional: Image resolution (default: "1")
  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
  output_format?: string;        // Optional: Output format ("webp", "jpg", "png") (default: "webp")
  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)
  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)
  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}

generate_image_variants

Generates multiple variants of the same image from a single prompt.

typescript
{
  prompt: string;                // Required: Text description for the image to generate variants of
  num_variants: number;          // Required: Number of image variants to generate (2-10, default: 4)
  prompt_variations?: string[];  // Optional: List of prompt modifiers to apply to variants (e.g., ["in watercolor style", "in oil painting style"])
  variation_mode?: "append" | "replace"; // Optional: How to apply variations - 'append' adds to base prompt, 'replace' uses variations directly (default: "append")
  seed?: number;                 // Optional: Base random seed. Each variant will use seed+variant_index
  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)
  megapixels?: "1" | "0.25";     // Optional: Image resolution (default: "1")
  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., "16:9", "4:3") (default: "1:1")
  output_format?: string;        // Optional: Output format ("webp", "jpg", "png") (default: "webp")
  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)
  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)
  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)
}

generate_svg

Generates an SVG vector image based on a text prompt using the Recraft V3 SVG model.

typescript
{
  prompt: string;                // Required: Text description of the SVG to generate
  size?: string;                 // Optional: Size of the generated SVG (default: "1024x1024")
  style?: string;                // Optional: Style of the generated image (default: "any")
                                // Options: "any", "engraving", "line_art", "line_circuit", "linocut"
}

prediction_list

Retrieves a list of your recent predictions from Replicate.

typescript
{
  limit?: number;  // Optional: Maximum number of predictions to return (1-100) (default: 50)
}

get_prediction

Gets detailed information about a specific prediction.

typescript
{
  predictionId: string;  // Required: ID of the prediction to retrieve
}

Available Resources

imagelist

Browse your history of generated images created with the Flux Schnell model.

svglist

Browse your history of generated SVG images created with the Recraft V3 SVG model.

predictionlist

Browse all your Replicate predictions history.

πŸ’» Development

  1. Clone the repository:
bash
git clone https://github.com/awkoy/replicate-flux-mcp.git
cd replicate-flux-mcp
  1. Install dependencies:
bash
npm install
  1. Start development mode:
bash
npm run dev
  1. Build the project:
bash
npm run build
  1. Connect to Client:
json
{
  "mcpServers": {
    "image-generation-mcp": {
      "command": "npx",
      "args": [
        "/Users/{USERNAME}/{PATH_TO}/replicate-flux-mcp/build/index.js"
      ],
      "env": {
        "REPLICATE_API_TOKEN": "YOUR REPLICATE API TOKEN"
      }
    }
  }
}

βš™οΈ Technical Details

Stack

  • Model Context Protocol SDK - Core MCP functionality for tool and resource management
  • Replicate API - Provides access to state-of-the-art AI image generation models
  • TypeScript - Ensures type safety and leverages modern JavaScript features
  • Zod - Implements runtime type validation for robust API interactions

Configuration

The server can be configured by modifying the CONFIG object in src/config/index.ts:

javascript
const CONFIG = {
  serverName: "replicate-flux-mcp",
  serverVersion: "0.1.2",
  imageModelId: "black-forest-labs/flux-schnell",
  svgModelId: "recraft-ai/recraft-v3-svg",
  pollingAttempts: 25,
  pollingInterval: 2000, // ms
};

πŸ” 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

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

Timeout Error

  • For larger images or busy servers, you might need to increase pollingAttempts or pollingInterval in the configuration
  • Default settings should work for most use cases

🀝 Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

For feature requests or bug reports, please create a GitHub issue. If you like this project, consider starring the repository!

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”— Resources

🎨 Examples

Demo

Multiple Prompts Prompt Variants
Multiple prompts example: "A serene mountain lake at sunset", "A bustling city street at night", "A peaceful garden in spring" Variants example: Base prompt "A majestic castle" with modifiers "in watercolor style", "as an oil painting", "with gothic architecture"

Here are some examples of how to use the tools:

Batch Image Generation with generate_multiple_images

Create multiple distinct images at once with different prompts:

json
{
  "prompts": [
    "A red sports car on a mountain road", 
    "A blue sports car on a beach", 
    "A vintage sports car in a city street"
  ]
}

Image Variants with generate_image_variants

Create different interpretations of the same concept using seeds:

json
{
  "prompt": "A futuristic city skyline at night",
  "num_variants": 4,
  "seed": 42
}

Or explore style variations with prompt modifiers:

json
{
  "prompt": "A character portrait",
  "prompt_variations": [
    "in anime style", 
    "in watercolor style", 
    "in oil painting style", 
    "as a 3D render"
  ]
}

Made with ❀️ by Yaroslav Boiko

Star History

Star History Chart

Repository Owner

awkoy
awkoy

User

Repository Details

Language TypeScript
Default Branch main
Size 119 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

TypeScript
96.71%
JavaScript
1.9%
Dockerfile
1.39%

Tags

Topics

ai-image-generation image-mcp replicate-mcp svg-generator svg-mcp

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • @nanana-ai/mcp-server-nano-banana

    @nanana-ai/mcp-server-nano-banana

    MCP server for Nanana AI image generation using Gemini's nano banana model.

    @nanana-ai/mcp-server-nano-banana serves as an MCP (Model Context Protocol) compatible server for facilitating image generation and transformation powered by the Gemini nano banana model. It enables clients like Claude Desktop to interact with Nanana AI, processing text prompts to generate images or transform existing images. The server can be easily configured with API tokens and integrated into desktop applications. Users can manage credentials, customize endpoints, and monitor credit usage seamlessly.

    • ⭐ 3
    • MCP
    • nanana-app/mcp-server-nano-banana
  • Typst MCP Server

    Typst MCP Server

    Facilitates AI-driven Typst interactions with LaTeX conversion, validation, and image generation tools.

    Typst MCP Server implements the Model Context Protocol, enabling AI models to interface seamlessly with Typst, a markup-based typesetting system. It provides tools for tasks such as converting LaTeX to Typst, validating Typst syntax, listing and retrieving Typst documentation chapters, and rendering Typst code as images. The server is compatible with MCP agent clients, such as Claude Desktop and VS Code’s agent mode. All functionalities are exposed as tools for ease of LLM integration.

    • ⭐ 79
    • MCP
    • johannesbrandenburger/typst-mcp
  • Klavis

    Klavis

    One MCP server for AI agents to handle thousands of tools.

    Klavis provides an MCP (Model Context Protocol) server with over 100 prebuilt integrations for AI agents, enabling seamless connectivity with various tools and services. It offers both cloud-hosted and self-hosted deployment options and includes out-of-the-box OAuth support for secure authentication. Klavis is designed to act as an intelligent connector, streamlining workflow automation and enhancing agent capability through standardized context management.

    • ⭐ 5,447
    • MCP
    • Klavis-AI/klavis
  • Data Visualization MCP Server

    Data Visualization MCP Server

    MCP server for data visualization using Vega-Lite.

    Data Visualization MCP Server enables large language models to visualize data through a standardized interface using Vega-Lite specifications. The server provides tools for saving data tables and generating visualizations as text or PNG images. Integration with platforms like Claude Desktop allows seamless addition of data visualization capabilities to LLM workflows.

    • ⭐ 92
    • MCP
    • isaacwasserman/mcp-vegalite-server
  • Notion MCP Server

    Notion MCP Server

    Enable LLMs to interact with Notion using the Model Context Protocol.

    Notion MCP Server allows large language models to interface with Notion workspaces through a Model Context Protocol server, supporting both data retrieval and editing capabilities. It includes experimental Markdown conversion to optimize token usage for more efficient communication with LLMs. The server can be configured with environment variables and controlled for specific tool access. Integration with applications like Claude Desktop is supported for seamless automation.

    • ⭐ 834
    • MCP
    • suekou/mcp-notion-server
  • MyMCP Server (All-in-One Model Context Protocol)

    MyMCP Server (All-in-One Model Context Protocol)

    Powerful and extensible Model Context Protocol server with developer and productivity integrations.

    MyMCP Server is a robust Model Context Protocol (MCP) server implementation that integrates with services like GitLab, Jira, Confluence, YouTube, Google Workspace, and more. It provides AI-powered search, contextual tool execution, and workflow automation for development and productivity tasks. The system supports extensive configuration and enables selective activation of grouped toolsets for various environments. Installation and deployment are streamlined, with both automated and manual setup options available.

    • ⭐ 93
    • MCP
    • nguyenvanduocit/all-in-one-model-context-protocol
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results