Fal AI MCP Server

by piebro

256 downloads
Not rated
GitHub

About

An MCP (Model Context Protocol) Server to use the fal.ai APIs to generate images and videos.

Details

Author
piebro
Downloads
256
Categories
Other

- Generates images and videos via fal.ai APIs.
- Compatible with any MCP client.
- Barebones design for easy extension.
- Requires a valid FAL_KEY for authentication.
- Saves generated media to a configurable directory.
- Can be run via uvx or directly with uv.

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 AI 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

Install uv, then add the server to your MCP client’s config using uvx with the FAL_KEY and SAVE_MEDIA_DIR environment variables. Alternatively, clone the repository and use uv with a directory. The server runs as an MCP tool provider.

Claude Desktop / Cursor

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

{
    "mcpServers": {
        "fal ai mcp server": {
            "fal-ai-mcp-server-piebro": {
                "name": "fal-ai-mcp-server",
                "command": "uvx",
                "args": [
                    "fal-ai-mcp-server"
                ],
                "env": {
                    "FAL_KEY": "your-key",
                    "SAVE_MEDIA_DIR": "path/to/save/images"
                }
            }
        }
    }
}

McpServers

{
    "fal-ai-mcp-server-piebro": {
        "name": "fal-ai-mcp-server",
        "command": "uvx",
        "args": [
            "fal-ai-mcp-server"
        ],
        "env": {
            "FAL_KEY": "your-key",
            "SAVE_MEDIA_DIR": "path/to/save/images"
        }
    }
}

Fal AI MCP Server

An MCP (Model Context Protocol) server to use the fal.ai APIs to generate images and videos.
This is a barebones server that anyone can extend to use different fal.ai models and API endpoints.

Usage

Install uv and add the server to an MCP config using uvx:

{
    "name": "fal-ai-mcp-server",
    "command": "uvx",
    "args": [
        "fal-ai-mcp-server"
    ],
    "env": {
        "FAL_KEY": "your-key",
        "SAVE_MEDIA_DIR": "path/to/save/images"
    }
}

or clone the repo and use uv with a directory:

{
    "name": "fal-ai-mcp-server",
    "command": "uv",
    "args": [
        "--directory",
        "path/to/root/dir/",
        "run",
        "main.py"
    ],
    "env": {
        "FAL_KEY": "your-key",
        "SAVE_MEDIA_DIR": "path/to/save/images"
    }
}

Development

Testing

Clone the repo and use mcp-client-for-testing to test the tools of the server.

uvx mcp-client-for-testing \
    --config '
    [
        {
            "name": "fal-ai-mcp-server",
            "command": "uv",
            "args": [
                "--directory", 
                "path/to/root/dir/", 
                "run", 
                "main.py"
            ],
            "env": {
                "FAL_KEY": "your-key",
                "SAVE_MEDIA_DIR": "path/to/save/images"
            }
        }
    ]
    ' \
    --tool_call '{"name": "echo_tool", "arguments": {"message": "Hello, world!"}}'

Formatting and Linting

The code is formatted and linted with ruff:

uv run ruff format
uv run ruff check --fix

Building with uv

Build the package using uv:

uv build

Releasing a New Version

To release a new version of the package to PyPI, create and push a new Git tag:

1. Checkout the main branch and get the current version:

   git checkout main
git pull origin main
git describe --tags

2. Create and push a new Git tag:

   git tag v0.2.0
git push origin v0.2.0

The GitHub Actions workflow will automatically build and publish the package to PyPI when a new tag is pushed.
The python package version number will be derived directly from the Git tag.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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.