Sponsored by Deepsite.site

Mcp Server FalAI

Created By
codecraftm7 months ago
A Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Content

MCP Image Generator

A Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.

Features

  • Generate high-quality images from text prompts
  • Support for multiple anime and artistic styles:
    • Ghibli Style
    • Pixar Style
    • Pokemon Style
    • Genshin Impact Style
    • Cyberpunk Style
    • One Piece Style
    • Attack on Titan Style
    • Shinkai Makoto Style
    • Sailor Moon Style
    • Evangelion Style
    • Disney Princess Style
    • Kyoto Animation Style
    • Dreamworks Animation Style
    • Marvel Studios Style
    • DC Comics Style
    • Kawaii Pastel Style
    • Simpsons Style
    • Dragon Ball Style
    • Demon Slayer Style
    • Warner Bros Animation Style
    • Dark Fantasy Style
    • And many more Japanese anime styles
  • Multiple image size options:
    • Square (512x512)
    • Square HD (1024x1024)
    • Portrait 4:3 (768x1024)
    • Portrait 16:9 (576x1024)
    • Landscape 4:3 (1024x768)
    • Landscape 16:9 (1024x576)
  • Generate multiple images in one request (up to 4)
  • Image upscaling (4x resolution enhancement)
  • Image search and replace functionality
  • Built-in NSFW content detection

Installation

  1. Clone the repository:
git clone [repository-url]
cd mcp-falai
  1. Install dependencies:
npm install
  1. Configure environment variables: Create a .env file with the following content:
FALAI_API_KEY=your_fal_ai_key_here

Usage

MCP Server Configuration

To use the MCP Image Generator server, add it to your mcpServers configuration:

{
  "mcpServers": {
    "image-generator": {
      "command": "npx",
      "args": ["-y", "mcp-falai"]
    }
  }
}

You can also specify additional configuration options:

{
  "mcpServers": {
    "falai": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-falai",
        "--mode=rest",
        "--port=9593",
        "--endpoint=/rest"
      ],
      "env": {
        "FALAI_API_KEY": "your_fal_ai_key_here"
      }
    }
  }
}

Starting the Server

The server can run in two modes:

  1. STDIO mode (default):
npm start
  1. REST mode:
npm start -- --mode=rest --port=9593 --endpoint=/rest

API Reference

Generate Image

Request Format:

{
  "name": "generate_image",
  "arguments": {
    "prompt": "A beautiful sunset over mountains",
    "style": "ghibli-style",
    "num_images": 1,
    "size": "square_hd"
  }
}

Parameters:

  • prompt (required): Text description of the image to generate
  • style (optional): Image style (default: "ghibli-style")
    • Available styles: See the Features section above for the complete list
  • num_images (optional): Number of images to generate (1-4, default: 1)
  • size (optional): Image size (default: "square_hd")
    • Available sizes: "square", "square_hd", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9"

Upscale Image

Request Format:

{
  "name": "upscale_image",
  "arguments": {
    "image_url": "https://example.com/image.jpg"
  }
}

Parameters:

  • image_url (required): URL of the image to upscale

Search and Replace

Request Format:

{
  "name": "search-and-replace",
  "arguments": {
    "image_url": "https://example.com/image.jpg",
    "mask_url": "https://example.com/mask.jpg",
    "prompt": "Description of the replacement"
  }
}

Parameters:

  • image_url (required): URL of the image to edit
  • mask_url (required): URL of the mask image (black areas preserved, white areas inpainted)
  • prompt (required): Description of the replacement content

Development

  • npm run build: Build the project
  • npm run watch: Watch mode for development
  • npm run inspector: Run MCP inspector

Error Handling

The server provides detailed error messages for common issues:

  • Missing API key
  • Invalid prompt
  • Invalid style or size parameters
  • API request failures
  • NSFW content detection

License

MIT

Server Config

{
  "mcpServers": {
    "falai": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "FALAI_API_KEY",
        "chatmcp/falai"
      ],
      "env": {
        "FALAI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Serper MCP ServerA Serper MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Tavily Mcp
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server