{"_id":"@iflow-mcp/replicate-flux-mcp","name":"@iflow-mcp/replicate-flux-mcp","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.2":{"name":"@iflow-mcp/replicate-flux-mcp","version":"0.1.2","type":"module","bin":{"replicate-flux-mcp":"build/index.js"},"scripts":{"build":"tsc && shx chmod +x build/*.js","prepare":"npm run build","watch":"tsc --watch","inspector":"npx @modelcontextprotocol/inspector build/index.js -e REPLICATE_API_TOKEN=YOUR_REPLICATE_API_TOKEN"},"homepage":"https://github.com/awkoy/replicate-flux-mcp","keywords":["replicate","flux","mcp","flux-schnell","flux-schnell-mcp","modelcontextprotocol","image-generation","ai"],"author":{"name":"Yaroslav Boiko","email":"y.boikodeveloper@gmail.com"},"license":"MIT","description":"MCP for Replicate Flux Model","dependencies":{"@modelcontextprotocol/sdk":"^1.7.0","replicate":"^1.0.1","zod":"^3.24.2"},"devDependencies":{"@types/node":"^22.13.10","shx":"^0.3.4","typescript":"^5.8.2"},"engines":{"node":">=18"},"repository":{"type":"git","url":"git+https://github.com/awkoy/replicate-flux-mcp.git"},"_id":"@iflow-mcp/replicate-flux-mcp@0.1.2","gitHead":"ae0fee73bea0389c9530edc52c1d046e84010c66","bugs":{"url":"https://github.com/awkoy/replicate-flux-mcp/issues"},"_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"integrity":"sha512-T8W2QkJIUS0iCT2tXNSX2Fob7KAhklIGR2Og/X8otkxvTXC4i8s07ZSi3FyWo/dnHHvNO5fepYcq2/gDZ1A/jA==","shasum":"0e9bed25a6b62e9111c2cb643301339f2bb13d4e","tarball":"https://registry.npmjs.org/@iflow-mcp/replicate-flux-mcp/-/replicate-flux-mcp-0.1.2.tgz","fileCount":22,"unpackedSize":49812,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDvdI4i8m/XBzgVb5anZm+eMxFesbGoUemKbPeZ6wD0rAIgLAied9vCg0hJUjW2XhZlywKMPqQgjDB6Yw0kvwhEPSo="}]},"_npmUser":{"name":"chatflowdev","email":"chatflowdev@gmail.com"},"directories":{},"maintainers":[{"name":"chatflowdev","email":"chatflowdev@gmail.com"},{"name":"qystart","email":"987472953@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/replicate-flux-mcp_0.1.2_1765171446418_0.012250087389439779"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-08T05:24:06.339Z","0.1.2":"2025-12-08T05:24:06.559Z","modified":"2025-12-08T05:24:06.842Z"},"maintainers":[{"name":"chatflowdev","email":"chatflowdev@gmail.com"},{"name":"qystart","email":"987472953@qq.com"}],"description":"MCP for Replicate Flux Model","homepage":"https://github.com/awkoy/replicate-flux-mcp","keywords":["replicate","flux","mcp","flux-schnell","flux-schnell-mcp","modelcontextprotocol","image-generation","ai"],"repository":{"type":"git","url":"git+https://github.com/awkoy/replicate-flux-mcp.git"},"author":{"name":"Yaroslav Boiko","email":"y.boikodeveloper@gmail.com"},"bugs":{"url":"https://github.com/awkoy/replicate-flux-mcp/issues"},"license":"MIT","readme":"[![MseeP.ai Security Assessment Badge](https://mseep.net/pr/awkoy-replicate-flux-mcp-badge.png)](https://mseep.ai/app/awkoy-replicate-flux-mcp)\n\n# Replicate Flux MCP\n\n![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n![TypeScript](https://img.shields.io/badge/TypeScript-4.9+-blue)\n![Model Context Protocol](https://img.shields.io/badge/MCP-Enabled-purple)\n[![smithery badge](https://smithery.ai/badge/@awkoy/replicate-flux-mcp)](https://smithery.ai/server/@awkoy/replicate-flux-mcp)\n![NPM Downloads](https://img.shields.io/npm/dw/replicate-flux-mcp)\n![Stars](https://img.shields.io/github/stars/awkoy/replicate-flux-mcp)\n\n<a href=\"https://glama.ai/mcp/servers/ss8n1knen8\">\n  <img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/ss8n1knen8/badge\" />\n</a>\n\n**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](https://replicate.com/black-forest-labs/flux-schnell) for raster images and [Recraft's V3 SVG model](https://replicate.com/recraft-ai/recraft-v3-svg) for vector graphics via the Replicate API.\n\n## 📑 Table of Contents\n\n- [Getting Started & Integration](#-getting-started--integration)\n  - [Setup Process](#setup-process)\n  - [Cursor Integration](#cursor-integration)\n  - [Claude Desktop Integration](#claude-desktop-integration)\n  - [Smithery Integration](#smithery-integration)\n  - [Glama.ai Integration](#glamaai-integration)\n- [Features](#-features)\n- [Documentation](#-documentation)\n  - [Available Tools](#available-tools)\n  - [Available Resources](#available-resources)\n- [Development](#-development)\n- [Technical Details](#-technical-details)\n- [Troubleshooting](#-troubleshooting)\n- [Contributing](#-contributing)\n- [License](#-license)\n- [Resources](#-resources)\n- [Examples](#-examples)\n\n## 🚀 Getting Started & Integration\n\n### Setup Process\n\n1. **Obtain a Replicate API Token**\n   - Sign up at [Replicate](https://replicate.com/)\n   - Create an API token in your account settings\n\n2. **Choose Your Integration Method**\n   - Follow one of the integration options below based on your preferred MCP client\n\n3. **Ask Your AI Assistant to Generate an Image**\n   - Simply ask naturally: \"Can you generate an image of a serene mountain landscape at sunset?\"\n   - Or be more specific: \"Please create an image showing a peaceful mountain scene with a lake reflecting the sunset colors in the foreground\"\n\n4. **Explore Advanced Features**\n   - Try different parameter settings for customized results\n   - Experiment with SVG generation using `generate_svg`\n   - Use batch image generation or variant generation features\n\n### Cursor Integration\n\n#### Method 1: Using mcp.json\n\n1. Create or edit the `.cursor/mcp.json` file in your project directory:\n\n```json\n{\n  \"mcpServers\": {\n    \"replicate-flux-mcp\": {\n      \"command\": \"env REPLICATE_API_TOKEN=YOUR_TOKEN npx\",\n      \"args\": [\"-y\", \"replicate-flux-mcp\"]\n    }\n  }\n}\n```\n\n2. Replace `YOUR_TOKEN` with your actual Replicate API token\n3. Restart Cursor to apply the changes\n\n#### Method 2: Manual Mode\n\n1. Open Cursor and go to Settings\n2. Navigate to the \"MCP\" or \"Model Context Protocol\" section\n3. Click \"Add Server\" or equivalent\n4. Enter the following command in the appropriate field:\n\n```\nenv REPLICATE_API_TOKEN=YOUR_TOKEN npx -y replicate-flux-mcp\n```\n\n5. Replace `YOUR_TOKEN` with your actual Replicate API token\n6. Save the settings and restart Cursor if necessary\n\n### Claude Desktop Integration\n\n1. Create or edit the `mcp.json` file in your configuration directory:\n\n```json\n{\n  \"mcpServers\": {\n    \"replicate-flux-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"replicate-flux-mcp\"],\n      \"env\": {\n        \"REPLICATE_API_TOKEN\": \"YOUR TOKEN\"\n      }\n    }\n  }\n}\n```\n\n2. Replace `YOUR_TOKEN` with your actual Replicate API token\n3. Restart Claude Desktop to apply the changes\n\n### Smithery Integration\n\nThis MCP server is available as a hosted service on Smithery, allowing you to use it without setting up your own server.\n\n1. Visit [Smithery](https://smithery.ai/) and create an account if you don't have one\n2. Navigate to the [Replicate Flux MCP server page](https://smithery.ai/server/@awkoy/replicate-flux-mcp)\n3. Click \"Add to Workspace\" to add the server to your Smithery workspace\n4. Configure your MCP client (Cursor, Claude Desktop, etc.) to use your Smithery workspace URL\n\nFor more information on using Smithery with your MCP clients, visit the [Smithery documentation](https://smithery.ai/docs).\n\n### Glama.ai Integration\n\nThis MCP server is also available as a hosted service on Glama.ai, providing another option to use it without local setup.\n\n1. Visit [Glama.ai](https://glama.ai/) and create an account if you don't have one\n2. Go to the [Replicate Flux MCP server page](https://glama.ai/mcp/servers/ss8n1knen8)\n3. Click \"Install Server\" to add the server to your workspace\n4. Configure your MCP client to use your Glama.ai workspace\n\nFor more information, visit the [Glama.ai MCP servers documentation](https://glama.ai/mcp/servers).\n\n## 🌟 Features\n\n- **🖼️ High-Quality Image Generation** - Create stunning images using Flux Schnell, a state-of-the-art AI model\n- **🎨 Vector Graphics Support** - Generate professional SVG vector graphics with Recraft V3 SVG model\n- **🤖 AI Assistant Integration** - Seamlessly enable AI assistants like Claude to generate visual content\n- **🎛️ Advanced Customization** - Fine-tune generation with controls for aspect ratio, quality, resolution, and more\n- **🔌 Universal MCP Compatibility** - Works with all MCP clients including Cursor, Claude Desktop, Cline, and Zed\n- **🔒 Secure Local Processing** - All requests are processed locally for enhanced privacy and security\n- **🔍 Comprehensive History Management** - Track, view, and retrieve your complete generation history\n- **📊 Batch Processing** - Generate multiple images from different prompts in a single request\n- **🔄 Variant Exploration** - Create and compare multiple interpretations of the same concept\n- **✏️ Prompt Engineering** - Fine-tune image variations with specialized prompt modifications\n\n## 📚 Documentation\n\n### Available Tools\n\n#### `generate_image`\n\nGenerates an image based on a text prompt using the Flux Schnell model.\n\n```typescript\n{\n  prompt: string;                // Required: Text description of the image to generate\n  seed?: number;                 // Optional: Random seed for reproducible generation\n  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)\n  megapixels?: \"1\" | \"0.25\";     // Optional: Image resolution (default: \"1\")\n  num_outputs?: number;          // Optional: Number of images to generate (1-4) (default: 1)\n  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., \"16:9\", \"4:3\") (default: \"1:1\")\n  output_format?: string;        // Optional: Output format (\"webp\", \"jpg\", \"png\") (default: \"webp\")\n  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)\n  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)\n  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)\n}\n```\n\n#### `generate_multiple_images`\n\nGenerates multiple images based on an array of prompts using the Flux Schnell model.\n\n```typescript\n{\n  prompts: string[];             // Required: Array of text descriptions for images to generate (1-10 prompts)\n  seed?: number;                 // Optional: Random seed for reproducible generation\n  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)\n  megapixels?: \"1\" | \"0.25\";     // Optional: Image resolution (default: \"1\")\n  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., \"16:9\", \"4:3\") (default: \"1:1\")\n  output_format?: string;        // Optional: Output format (\"webp\", \"jpg\", \"png\") (default: \"webp\")\n  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)\n  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)\n  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)\n}\n```\n\n#### `generate_image_variants`\n\nGenerates multiple variants of the same image from a single prompt.\n\n```typescript\n{\n  prompt: string;                // Required: Text description for the image to generate variants of\n  num_variants: number;          // Required: Number of image variants to generate (2-10, default: 4)\n  prompt_variations?: string[];  // Optional: List of prompt modifiers to apply to variants (e.g., [\"in watercolor style\", \"in oil painting style\"])\n  variation_mode?: \"append\" | \"replace\"; // Optional: How to apply variations - 'append' adds to base prompt, 'replace' uses variations directly (default: \"append\")\n  seed?: number;                 // Optional: Base random seed. Each variant will use seed+variant_index\n  go_fast?: boolean;             // Optional: Run faster predictions with optimized model (default: true)\n  megapixels?: \"1\" | \"0.25\";     // Optional: Image resolution (default: \"1\")\n  aspect_ratio?: string;         // Optional: Aspect ratio (e.g., \"16:9\", \"4:3\") (default: \"1:1\")\n  output_format?: string;        // Optional: Output format (\"webp\", \"jpg\", \"png\") (default: \"webp\")\n  output_quality?: number;       // Optional: Image quality (0-100) (default: 80)\n  num_inference_steps?: number;  // Optional: Number of denoising steps (1-4) (default: 4)\n  disable_safety_checker?: boolean; // Optional: Disable safety filter (default: false)\n}\n```\n\n#### `generate_svg`\n\nGenerates an SVG vector image based on a text prompt using the Recraft V3 SVG model.\n\n```typescript\n{\n  prompt: string;                // Required: Text description of the SVG to generate\n  size?: string;                 // Optional: Size of the generated SVG (default: \"1024x1024\")\n  style?: string;                // Optional: Style of the generated image (default: \"any\")\n                                // Options: \"any\", \"engraving\", \"line_art\", \"line_circuit\", \"linocut\"\n}\n```\n\n#### `prediction_list`\n\nRetrieves a list of your recent predictions from Replicate.\n\n```typescript\n{\n  limit?: number;  // Optional: Maximum number of predictions to return (1-100) (default: 50)\n}\n```\n\n#### `get_prediction`\n\nGets detailed information about a specific prediction.\n\n```typescript\n{\n  predictionId: string;  // Required: ID of the prediction to retrieve\n}\n```\n\n### Available Resources\n\n#### `imagelist`\n\nBrowse your history of generated images created with the Flux Schnell model.\n\n#### `svglist`\n\nBrowse your history of generated SVG images created with the Recraft V3 SVG model.\n\n#### `predictionlist`\n\nBrowse all your Replicate predictions history.\n\n## 💻 Development\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/awkoy/replicate-flux-mcp.git\ncd replicate-flux-mcp\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Start development mode:\n\n```bash\nnpm run dev\n```\n\n4. Build the project:\n\n```bash\nnpm run build\n```\n\n5. Connect to Client:\n\n```json\n{\n  \"mcpServers\": {\n    \"image-generation-mcp\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"/Users/{USERNAME}/{PATH_TO}/replicate-flux-mcp/build/index.js\"\n      ],\n      \"env\": {\n        \"REPLICATE_API_TOKEN\": \"YOUR REPLICATE API TOKEN\"\n      }\n    }\n  }\n}\n```\n\n## ⚙️ Technical Details\n\n### Stack\n\n- **Model Context Protocol SDK** - Core MCP functionality for tool and resource management\n- **Replicate API** - Provides access to state-of-the-art AI image generation models\n- **TypeScript** - Ensures type safety and leverages modern JavaScript features\n- **Zod** - Implements runtime type validation for robust API interactions\n\n### Configuration\n\nThe server can be configured by modifying the `CONFIG` object in `src/config/index.ts`:\n\n```javascript\nconst CONFIG = {\n  serverName: \"replicate-flux-mcp\",\n  serverVersion: \"0.1.2\",\n  imageModelId: \"black-forest-labs/flux-schnell\",\n  svgModelId: \"recraft-ai/recraft-v3-svg\",\n  pollingAttempts: 25,\n  pollingInterval: 2000, // ms\n};\n```\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n#### Authentication Error\n- Ensure your `REPLICATE_API_TOKEN` is correctly set in the environment\n- Verify your token is valid by testing it with the Replicate API directly\n\n#### Safety Filter Triggered\n- The model has a built-in safety filter that may block certain prompts\n- Try modifying your prompt to avoid potentially problematic content\n\n#### Timeout Error\n- For larger images or busy servers, you might need to increase `pollingAttempts` or `pollingInterval` in the configuration\n- Default settings should work for most use cases\n\n## 🤝 Contributing\n\nContributions are welcome! Please follow these steps to contribute:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nFor feature requests or bug reports, please create a GitHub issue. If you like this project, consider starring the repository!\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🔗 Resources\n\n- [Model Context Protocol Documentation](https://modelcontextprotocol.io)\n- [Replicate API Documentation](https://replicate.com/docs)\n- [Flux Schnell Model](https://replicate.com/black-forest-labs/flux-schnell)\n- [Recraft V3 SVG Model](https://replicate.com/recraft-ai/recraft-v3-svg)\n- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)\n- [Smithery Documentation](https://smithery.ai/docs)\n- [Glama.ai MCP Servers](https://glama.ai/mcp/servers)\n\n## 🎨 Examples\n\n![Demo](https://github.com/user-attachments/assets/ad6db606-ae3a-48db-a1cc-e1f88847769e)\n\n| Multiple Prompts | Prompt Variants |\n|-----------------|-----------------|\n| ![Multiple prompts example: \"A serene mountain lake at sunset\", \"A bustling city street at night\", \"A peaceful garden in spring\"](https://github.com/user-attachments/assets/e5ac56d2-bfbb-4f33-938c-a3d7bffeee60) | ![Variants example: Base prompt \"A majestic castle\" with modifiers \"in watercolor style\", \"as an oil painting\", \"with gothic architecture\"](https://github.com/user-attachments/assets/8ebe5992-4803-4bf3-a82a-251135b0698a) |\n\nHere are some examples of how to use the tools:\n\n### Batch Image Generation with `generate_multiple_images`\n\nCreate multiple distinct images at once with different prompts:\n\n```json\n{\n  \"prompts\": [\n    \"A red sports car on a mountain road\", \n    \"A blue sports car on a beach\", \n    \"A vintage sports car in a city street\"\n  ]\n}\n```\n\n### Image Variants with `generate_image_variants`\n\nCreate different interpretations of the same concept using seeds:\n\n```json\n{\n  \"prompt\": \"A futuristic city skyline at night\",\n  \"num_variants\": 4,\n  \"seed\": 42\n}\n```\n\nOr explore style variations with prompt modifiers:\n\n```json\n{\n  \"prompt\": \"A character portrait\",\n  \"prompt_variations\": [\n    \"in anime style\", \n    \"in watercolor style\", \n    \"in oil painting style\", \n    \"as a 3D render\"\n  ]\n}\n```\n\n---\n\nMade with ❤️ by Yaroslav Boiko\n\n","readmeFilename":"README.md","_rev":"1-5c72d6299f29e79a0e203390506a7e10"}