home / mcp / fal mcp server

Fal MCP Server

Wraps fal.ai image generation API to enable image creation and editing via MCP clients.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "guillaumeboniface-fal-mcp": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/fal-mcp",
        "python",
        "server.py"
      ],
      "env": {
        "FAL_KEY": "YOUR_API_KEY"
      }
    }
  }
}

This MCP server wraps the fal.ai image generation API to empower an MCP client like Claude to generate and edit images through a streamlined, configurable backend. It exposes a set of image generation and editing tools that you can invoke from your MCP client, handling authentication and API interactions for you.

How to use

You connect to this server from your MCP client by configuring an MCP JSON that points to the local server. Once connected, you can request image generation, guided generation with references, LoRA-enabled transforms, and image edits using natural language prompts. The server handles API authentication and routes your requests to fal.ai, returning image outputs you can save or reuse.

How to install

Prerequisites you need before installation:

  • Python 3.11 or newer is required.
  • A compatible MCP client setup referenced as an MCP URL/command.
  • Access to fal.ai to obtain an API key.

Step-by-step setup:

# 1) Prepare a Python virtual environment
python3.11 -m venv venv
source venv/bin/activate

# 2) Install required Python dependencies
pip install fastmcp httpx python-dotenv

# 3) Ensure you have an API key from fal.ai and set it for the server (see environment config below)

Usage with Claude Code

To connect from Claude Code, add a server entry that runs the local fal-mcp server. The following configuration starts the server from your local directory.

{
  "mcpServers": {
    "fal": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/fal-mcp", "python", "server.py"]
    }
  }
}

Available tools

generate_image

Create a new image from text prompts with a chosen model, resolution, steps, and guidance scale.

generate_with_reference

Generate an image guided by a content or style reference image.

generate_with_lora

Generate an image using a LoRA model to apply specialized styles or effects.

edit_image

Edit an existing image using natural language instructions (FLUX Kontext) to apply changes.

raw_generate

Submit advanced, configurable requests for supporting techniques like ControlNet, IP-Adapter, or multiple LoRAs.

list_outputs

List all images saved in the server's output directory for easy access and reuse.