复制Flux Mcp
MCP复制流量模型 - 一种强大的工具,用于生成与特定编码氛围和美学风格相匹配的定制图像和SVG资产。通过为开发者量身定制的AI驱动设计生成,简化您的视觉资产创建过程。
概览
什么是复制流模型的MCP?
复制流模型的MCP是一个创新工具,旨在生成与特定编码氛围和美学风格相符的定制图像和SVG资产。这个强大的应用程序利用AI技术简化视觉资产创建过程,使其成为开发人员在项目中增强定制设计元素的必备资源。
复制流模型的MCP的特点
- AI驱动的设计生成:利用先进算法创建独特的视觉资产,以满足用户的特定需求。
- 自定义选项:提供多种设置以调整生成图像和SVG的风格和外观。
- 用户友好的界面:以开发人员为中心设计,确保直观体验,减少学习曲线。
- 集成能力:轻松与现有工作流程和工具集成,实现无缝资产管理。
- 开源:可供公众使用,鼓励开发者社区的合作和贡献。
如何使用复制流模型的MCP
- 安装:从GitHub克隆代码库,并按照文档中提供的设置说明进行操作。
- 配置:调整设置以匹配您所需的美学和编码风格。
- 生成资产:使用该工具通过输入您的规格来创建图像和SVG。
- 导出和使用:下载生成的资产,并根据需要将其纳入您的项目中。
常见问题解答
问:复制流模型的MCP是免费使用的吗?
答:是的,该工具是开源的,供公众免费使用。
问:我可以自定义生成的资产吗?
答:当然可以!该工具提供各种自定义选项,以根据您的具体要求调整资产。
问:我如何为该项目做贡献?
答:欢迎贡献!您可以分叉代码库,进行更改,并提交拉取请求以供审核。
问:复制流模型的MCP支持哪些编程语言?
答:该工具设计为支持多种编程语言,使其在不同开发环境中具有多功能性。
问:我在哪里可以找到更多信息或支持?
答:有关更多信息和支持,可以在GitHub上的项目文档中找到。
详情
Replicate Flux MCP
<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. 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
- Features
- Documentation
- Development
- Technical Details
- Troubleshooting
- Contributing
- License
- Resources
- Examples
🚀 Getting Started & Integration
Setup Process
-
Obtain a Replicate API Token
- Sign up at Replicate
- Create an API token in your account settings
-
Choose Your Integration Method
- Follow one of the integration options below based on your preferred MCP client
-
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"
-
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
- 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"]
}
}
}
- Replace
YOUR_TOKEN
with your actual Replicate API token - Restart Cursor to apply the changes
Method 2: Manual Mode
- 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:
env REPLICATE_API_TOKEN=YOUR_TOKEN npx -y replicate-flux-mcp
- Replace
YOUR_TOKEN
with your actual Replicate API token - Save the settings and restart Cursor if necessary
Claude Desktop Integration
- 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"
}
}
}
}
- Replace
YOUR_TOKEN
with your actual Replicate API token - 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.
- 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
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.
- Visit Glama.ai and create an account if you don't have one
- Go to the Replicate Flux MCP server page
- Click "Install Server" to add the server to your workspace
- 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.
{
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.
{
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.
{
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.
{
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.
{
limit?: number; // Optional: Maximum number of predictions to return (1-100) (default: 50)
}
get_prediction
Gets detailed information about a specific prediction.
{
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
- Clone the repository:
git clone https://github.com/awkoy/replicate-flux-mcp.git
cd replicate-flux-mcp
- Install dependencies:
npm install
- Start development mode:
npm run dev
- Build the project:
npm run build
- Connect to Client:
{
"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
:
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
orpollingInterval
in the configuration - Default settings should work for most use cases
🤝 Contributing
Contributions are welcome! Please follow these steps to contribute:
- 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
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
- Model Context Protocol Documentation
- Replicate API Documentation
- Flux Schnell Model
- Recraft V3 SVG Model
- MCP TypeScript SDK
- Smithery Documentation
- Glama.ai MCP Servers
🎨 Examples
Multiple Prompts | Prompt Variants |
---|---|
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:
{
"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:
{
"prompt": "A futuristic city skyline at night",
"num_variants": 4,
"seed": 42
}
Or explore style variations with prompt modifiers:
{
"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
Server配置
{
"mcpServers": {
"replicate-flux-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/metorial/mcp-container--awkoy--replicate-flux-mcp--replicate-flux-mcp",
"node build/index.js"
],
"env": {
"REPLICATE_API_TOKEN": "replicate-api-token"
}
}
}
}