Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fal_ai_mcp_server-0.1.2.tar.gz (25.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fal_ai_mcp_server-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file fal_ai_mcp_server-0.1.2.tar.gz.

File metadata

  • Download URL: fal_ai_mcp_server-0.1.2.tar.gz
  • Upload date:
  • Size: 25.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fal_ai_mcp_server-0.1.2.tar.gz
Algorithm Hash digest
SHA256 07f12217e7900c4d48768451c8eb9d96a1a96a2c663981f27127a04ca35e0c00
MD5 b5c580403d41138df594b62200996549
BLAKE2b-256 b67cb6d25d43104e7801a0a654141dc1bcbd505f85a996fe85cc318d23c50c53

See more details on using hashes here.

Provenance

The following attestation bundles were made for fal_ai_mcp_server-0.1.2.tar.gz:

Publisher: publish.yml on piebro/fal-ai-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fal_ai_mcp_server-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fal_ai_mcp_server-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6576d76969168d6ac26f181fb0317be7a6819b033ac31420a04c9a21d7f2d3fd
MD5 323ec4c8ccb829fe4427485de4465583
BLAKE2b-256 02c91e59b0e07495a3378a076aa74e8fa05af2f847e4084da2038a03d3e57935

See more details on using hashes here.

Provenance

The following attestation bundles were made for fal_ai_mcp_server-0.1.2-py3-none-any.whl:

Publisher: publish.yml on piebro/fal-ai-mcp-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page