Back to MCP Servers

Replicate Flux

Provides the ability to generate images via Replicate's API.

other-tools-and-integrationsapi
By awkoy
10517Updated 3 weeks agoTypeScriptMIT

Installation

npx -y replicate-flux-mcp

Configuration

{
  "mcpServers": {
    "replicate-flux-mcp": {
      "command": "npx",
      "args": ["-y", "replicate-flux-mcp"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes

MseeP.ai Security Assessment Badge

Replicate Flux MCP

English | 中文

MCP Compatible License TypeScript Model Context Protocol

Trust Score smithery badge NPM Downloads Stars

<a href="https://glama.ai/mcp/servers/ss8n1knen8"> <img width="380" height="200" src="https://glama.ai/mcp/servers/ss8n1knen8/badge" /> </a>

Replicate Flux MCP is an advanced Model Context Protocol (MCP) server that empowers AI assistants to generate high-quality images and vector graphics. By default it uses black-forest-labs/flux-schnell for raster images and recraft-ai/recraft-v3-svg for SVG output. You can override the curated image/SVG models through environment variables, and image tools also accept a per-call model_id override from the built-in allowlist.

📑 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:
{
  "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:
{
  "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.

Codex Integration

Add the server to ~/.codex/config.toml:

[mcp_servers.replicate]
command = "npx"
args = ["-y", "replicate-flux-mcp"]
env = { REPLICATE_API_TOKEN = "your-replicate-api-token", REPLICATE_IMAGE_MODEL_ID = "your-image-model-id", REPLICATE_SVG_MODEL_ID = "your-svg-model-id" }
startup_timeout_sec = 30_000

Replace the env values as needed. If you omit REPLICATE_IMAGE_MODEL_ID / REPLICATE_SVG_MODEL_ID, the server uses black-forest-labs/flux-schnell for images and recraft-ai/recraft-v3-svg for SVGs.

Curated tools validate model overrides against built-in allowlists:

  • Image generation: black-forest-labs/flux-schnell, google/imagen-4, black-forest-labs/flux-kontext-pro, ideogram-ai/ideogram-v3-turbo, black-forest-labs/flux-1.1-pro, black-forest-labs/flux-dev
  • SVG generation: recraft-ai/recraft-v3-svg
  • Legacy run_model extras: minimax/video-01, luma/reframe-video, topazlabs/video-upscale, topazlabs/image-upscale, szcho/codeformer, tencentarc/gfpgan

🌟 Features

  • 🖼️ High-Quality Image Generation — Flux Schnell raster images by default, with environment-variable and per-tool image model overrides.
  • 🎨 Vector Graphics — Recraft V3 SVG for logos, icons, and diagrams.
  • 📊 Batch + Variants — Generate N images from N prompts or N variants of one prompt (seed-based or prompt-modifier-based).
  • 🧩 Arbitrary Replicate Modelsrun_replicate_model escape hatch accepts any owner/name[:version] reference, with get_model_schema introspection for the OpenAPI input schema. Optional allowlist via REPLICATE_MODEL_ALLOWLIST.
  • 📦 Structured Output — Every generate_* tool returns machine-readable structuredContent alongside human-readable content, matching a per-tool outputSchema (URL, prompt, format, aspect ratio, per-variant seed, etc).
  • ⏳ Progress Notifications — Batch and variant generation emit notifications/progress for clients that opt in via progressToken, so long runs aren't black-boxed.
  • 💬 Curated Prompts — 5 ready-made prompt templates (logo, portrait, svg-icon, product-shot, isometric-diagram) surfaced in Claude Desktop's slash palette and Cursor's @-menu.
  • 🏷️ Proper Tool AnnotationsreadOnlyHint / destructiveHint / openWorldHint / idempotentHint set correctly so clients can reason about safety and cost.
  • 🪵 Structured Logging — Server-side errors travel over notifications/message instead of stderr.
  • 🔌 Universal MCP Compatibility — MCP protocol 2025-11-25; works with Claude Desktop, Cursor, Cline, Zed, and any spec-compliant client.
  • 🔍 Generation History — Browse past runs through imagelist, svglist, and predictionlist resources.

📚 Documentation

Available Tools

generate_image

Generates an image based on a text prompt using the configured image model (allowlist only).

{
  prompt: string;                // Required: Text description of the image to generate
  model_id?: string;             // Optional: Override image model (allowlist only)
  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)
  support_image_mcp_response_type?: boolean; // Optional: Return embedded image content when supported (default: true)
}

generate_multiple_images

Generates multiple images based on an array of prompts using the configured image model (allowlist only).

{
  prompts: string[];             // Required: Array of text descriptions for images to generate (1-10 prompts)
  model_id?: string;             // Optional: Override image model (allowlist only)
  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)
  support_image_mcp_response_type?: boolean; // Optional: Return embedded image content when supported (default: true)
}

generate_image_variants

Generates multiple variants of the same image from a single prompt using the configured image model (allowlist only).

{
  prompt: string;                // Required: Text description for the image to generate variants of
  model_id?: string;             // Optional: Override image model (allowlist only)
  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";     // 

…
View source on GitHub