fal-minimax-image-01 MCP Server

fal-minimax-image-01 MCP Server

Enables high-quality AI image generation using MiniMax (Hailuo AI) text-to-image technology through fal.ai, supporting multiple aspect ratios, prompt optimization, and both synchronous and queue-based generation with automatic local image downloads.

Category
访问服务器

README

fal-ai/minimax/image-01 MCP Server

A Model Context Protocol (MCP) server that provides access to the fal-ai/minimax/image-01 image generation model. This server allows you to generate high-quality images using MiniMax (Hailuo AI) Text to Image technology through the fal.ai platform.

Features

  • High-Quality Image Generation: Generate stunning images using the fal-ai/minimax/image-01 model
  • MiniMax (Hailuo AI) Technology: Advanced text-to-image generation with excellent quality
  • Multiple Generation Methods: Support for synchronous and queue-based generation
  • Flexible Aspect Ratios: Support for various aspect ratios from square to panoramic
  • Prompt Optimization: Optional prompt enhancement for better results
  • Local Image Download: Automatically downloads generated images to local storage
  • Queue Management: Submit long-running requests and check their status
  • Webhook Support: Optional webhook notifications for completed requests
  • Stylized and Realistic Output: Supports both stylized and photorealistic image generation

Installation

  1. Clone this repository:
git clone https://github.com/PierrunoYT/fal-minimax-image-01-mcp-server.git
cd fal-minimax-image-01-mcp-server
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

Environment Variables

Set your fal.ai API key as an environment variable:

export FAL_KEY="your_fal_api_key_here"

You can get your API key from fal.ai.

MCP Client Configuration

Add this server to your MCP client configuration. For example, in Claude Desktop's config file:

{
  "mcpServers": {
    "fal-minimax-image-01": {
      "command": "npx",
      "args": ["-y", "https://github.com/PierrunoYT/fal-minimax-image-01-mcp-server.git"],
      "env": {
        "FAL_KEY": "your_fal_api_key_here"
      }
    }
  }
}

If the package is published to npm, you can use:

{
  "mcpServers": {
    "fal-minimax-image-01": {
      "command": "npx",
      "args": ["fal-minimax-image-01-mcp-server"],
      "env": {
        "FAL_KEY": "your_fal_api_key_here"
      }
    }
  }
}

Alternatively, if you've cloned the repository locally:

{
  "mcpServers": {
    "fal-minimax-image-01": {
      "command": "node",
      "args": ["/path/to/fal-minimax-image-01-mcp-server/build/index.js"],
      "env": {
        "FAL_KEY": "your_fal_api_key_here"
      }
    }
  }
}

Available Tools

1. minimax_generate

Generate images using the standard synchronous method.

Parameters:

  • prompt (required): Text prompt for image generation (max 1500 characters). Longer text prompts will result in better quality images.
  • aspect_ratio (optional): Aspect ratio of the generated image (default: "1:1")
  • num_images (optional): Number of images to generate (1-9, default: 1)
  • prompt_optimizer (optional): Whether to enable automatic prompt optimization (default: false)

Example:

{
  "prompt": "Man dressed in white t shirt, full-body stand front view image, outdoor, Venice beach sign, full-body image, Los Angeles, Fashion photography of 90s, documentary, Film grain, photorealistic",
  "aspect_ratio": "16:9",
  "num_images": 2,
  "prompt_optimizer": true
}

2. minimax_generate_queue

Submit a long-running image generation request to the queue.

Parameters: Same as minimax_generate plus:

  • webhook_url (optional): URL for webhook notifications

Returns: A request ID for tracking the job

3. minimax_queue_status

Check the status of a queued request.

Parameters:

  • request_id (required): The request ID from queue submission
  • logs (optional): Include logs in response (default: true)

4. minimax_queue_result

Get the result of a completed queued request.

Parameters:

  • request_id (required): The request ID from queue submission

API Information

  • Endpoint: https://fal.run/fal-ai/minimax/image-01
  • Model ID: fal-ai/minimax/image-01
  • Category: text-to-image
  • Kind: inference
  • Tags: stylized, realism

Aspect Ratios

The MiniMax model supports the following aspect ratios:

  • 1:1: Square format (default)
  • 16:9: Widescreen landscape
  • 4:3: Standard landscape
  • 3:2: Classic photo landscape
  • 2:3: Classic photo portrait
  • 3:4: Standard portrait
  • 9:16: Vertical/mobile format
  • 21:9: Ultra-wide panoramic

Example:

{
  "aspect_ratio": "16:9"
}

Prompt Optimization

Enable prompt optimization to enhance your text prompts for better results:

{
  "prompt_optimizer": true
}

When enabled, the AI will automatically improve your prompt to generate higher quality images. This is disabled by default.

Output

Generated images are automatically downloaded to a local images/ directory with descriptive filenames. The response includes:

  • Local file paths
  • Original URLs
  • Image dimensions (when available)
  • Content types
  • File sizes
  • Generation parameters used
  • Request IDs for tracking

Error Handling

The server provides detailed error messages for:

  • Missing API keys
  • Invalid parameters
  • Network issues
  • API rate limits
  • Generation failures
  • Prompt length violations (max 1500 characters)

Development

Running in Development Mode

npm run dev

Testing the Server

npm test

Getting the Installation Path

npm run get-path

API Reference

This server implements the fal-ai/minimax/image-01 API. For detailed API documentation, visit:

Examples

Basic Text-to-Image Generation

{
  "prompt": "A majestic dragon soaring through clouds, fantasy art style, detailed scales, dramatic lighting"
}

Photorealistic Portrait

{
  "prompt": "Man dressed in white t shirt, full-body stand front view image, outdoor, Venice beach sign, full-body image, Los Angeles, Fashion photography of 90s, documentary, Film grain, photorealistic",
  "aspect_ratio": "2:3",
  "prompt_optimizer": true
}

Landscape Image with Optimization

{
  "prompt": "A serene mountain landscape at sunset, golden hour lighting, misty valleys, snow-capped peaks, cinematic composition, high resolution nature photography",
  "aspect_ratio": "16:9",
  "prompt_optimizer": true
}

Multiple Images Generation

{
  "prompt": "A cute cartoon cat in different poses, kawaii style, pastel colors, chibi art, adorable expressions",
  "aspect_ratio": "1:1",
  "num_images": 4
}

Ultra-wide Panoramic Scene

{
  "prompt": "A detailed architectural visualization of a futuristic smart city with sustainable technology, flying vehicles, green buildings, advanced infrastructure, panoramic view",
  "aspect_ratio": "21:9",
  "prompt_optimizer": true
}

Queue-based Generation with Webhook

{
  "prompt": "Epic fantasy battle scene with dragons and knights, medieval castle in background, dramatic sky, detailed armor and weapons, cinematic lighting, high fantasy art",
  "aspect_ratio": "16:9",
  "num_images": 3,
  "webhook_url": "https://your-server.com/webhook"
}

Tips for Better Results

  1. Use Detailed Prompts: Longer, more descriptive prompts generally produce better quality images
  2. Enable Prompt Optimization: Use prompt_optimizer: true for enhanced results
  3. Choose Appropriate Aspect Ratios: Match the aspect ratio to your intended use case
  4. Be Specific: Include details about style, lighting, composition, and quality level
  5. Use Style Keywords: Terms like "photorealistic", "cinematic", "detailed", "high resolution" can improve output

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Support

For issues and questions:

Changelog

v1.0.0

  • Initial release with fal-ai/minimax/image-01 API support
  • MiniMax (Hailuo AI) Text to Image generation with superior capabilities
  • Support for multiple aspect ratios (1:1 to 21:9)
  • Prompt optimization for enhanced results (disabled by default)
  • Queue management with webhook support
  • Local image download functionality
  • Support for generating up to 9 images per request
  • Comprehensive error handling
  • Updated API schema matching latest fal.ai specifications

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选