fal-api-mcp-server

by taimo3810

294 downloads
Not rated
GitHub

Description

# fal-api-mcp-server A Model Context Protocol (MCP) server that provides image generation capabilities using fal.ai's FLUX.1 Pro model. ## Components ### Resources This server does not provide any persistent resources as fal.ai is primarily a stateless model execution service…

About

# fal-api-mcp-server A Model Context Protocol (MCP) server that provides image generation capabilities using fal.ai's FLUX.1 Pro model. ## Components ### Resources This server does not provide any persistent resources as fal.ai is primarily a stateless model execution service. ### Tools The server implements one tool…

Details

Author
taimo3810
Downloads
294
Categories
Developer Tools, AI

- Integrates with fal.ai FLUX.1 Pro for image generation
- One tool: generate_image with customizable parameters
- Supports multiple output sizes and formats
- Includes safety checker with adjustable tolerance
- Can generate multiple images per prompt

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name fal-api-mcp-server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Set your fal.ai API key as the FAL_KEY environment variable. Configure the server in your Claude Desktop JSON config using uv (development) or uvx (published). Once running, Claude can invoke the generate_image tool with a prompt to create images.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "fal-api-mcp-server": {
            "fal_api_mcp_server": {
                "command": "uv",
                "args": [
                    "sync"
                ]
            }
        }
    }
}

McpServers

{
    "fal_api_mcp_server": {
        "command": "uv",
        "args": [
            "sync"
        ]
    }
}

fal-api-mcp-server

A Model Context Protocol (MCP) server that provides image generation capabilities using fal.ai's FLUX.1 Pro model.

Components

Resources

This server does not provide any persistent resources as fal.ai is primarily a stateless model execution service.

Tools

The server implements one tool:

- generate_image: Generates images based on text prompts using fal.ai FLUX.1 Pro
- Required parameters:
- prompt: The text prompt to generate the image from
- Optional parameters:
- image_size: The desired image size (default: "landscape_4_3")
- Options: "square_hd", "square", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9"
- num_images: The number of images to generate (default: 1)
- enable_safety_checker: Enable the safety checker (default: true)
- safety_tolerance: Safety tolerance level 1-6, higher is more permissive (default: "2")
- output_format: Output image format, "jpeg" or "png" (default: "jpeg")

Configuration

This server requires a fal.ai API key to function properly. You can obtain an API key by signing up at fal.ai.

The API key should be provided as an environment variable:

FAL_KEY=your_fal_ai_api_key

You can set this environment variable in your shell, or create a .env file in the same directory as the server with the above content.

Demo

https://github.com/user-attachments/assets/564a0fc3-9204-4399-b1ea-ab6a5c9f2d84

Quickstart

Install

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

<details>
<summary>Development/Unpublished Servers Configuration</summary>

  "mcpServers": {
"fal-api-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/fal-api-mcp-server",
"run",
"fal-api-mcp-server"
],
"env": {
"FAL_KEY": "your_fal_ai_api_key"
}
}
}

</details>

<details>
<summary>Published Servers Configuration</summary>

  "mcpServers": {
"fal-api-mcp-server": {
"command": "uvx",
"args": [
"fal-api-mcp-server"
],
"env": {
"FAL_KEY": "your_fal_ai_api_key"
}
}
}

</details>

Usage

Once the server is configured and running, you can use it with Claude to generate images. Example prompts:

- "Generate an image of a mountain landscape at sunset"
- "Create a portrait of a cyberpunk character with neon lights"
- "Show me a futuristic cityscape with flying cars"

Claude will use the fal.ai FLUX.1 Pro model to generate the requested images.

Development

Building and Publishing

To prepare the package for distribution:

1. Sync dependencies and update lockfile:

uv sync

2. Build package distributions:

uv build

This will create source and wheel distributions in the dist/ directory.

3. Publish to PyPI:

uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token: --token or UV_PUBLISH_TOKEN
- Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging
experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /path/to/fal-api-mcp-server run fal-api-mcp-server

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.