MCP Connector

Generate Media with Fal.ai Models

Generate images, video, music, and audio via Fal.ai's 600+ models directly from an AI assistant.

Works with githubdockerfal.ai

91
Spark score
out of 100
Updated 3 months ago
Version 1.18.0
Models
universal

Add to Favorites

Why it matters

Leverage Fal.ai's advanced models for generating images, videos, music, and audio. This MCP connector integrates with clients like Claude Desktop to streamline creative media production.

Outcomes

What it gets done

01

Generate images using Flux and Stable Diffusion.

02

Create videos from text prompts or existing images.

03

Produce music and audio, including text-to-speech and transcription.

04

Integrate with MCP clients for seamless media generation.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-fal-mcp-server | bash

Capabilities

Tools your agent gets

generate_image

Generate images using Flux, SDXL, and other models from text prompts.

generate_video

Generate videos from images or text prompts using SVD and AnimatedDiff models.

generate_music

Create music from text descriptions using MusicGen model.

text_to_speech

Convert text to speech audio using Bark model.

transcribe_audio

Transcribe audio files to text using Whisper model.

upscale_image

Upscale images for resolution enhancement.

transform_image

Transform images based on text prompts.

Overview

Fal MCP Server MCP server

An MCP server exposing Fal.ai's 600+ generation models to an AI assistant: image, video, music generation and editing across 18 tools. Use it when an assistant needs to generate or edit media directly rather than just describe it - requires a Fal.ai API key.

What it does

Fal.ai MCP Server lets Claude Desktop and other MCP clients generate and edit images, video, music, and audio using Fal.ai's model platform, spanning 18 tools and dynamically discovering 600+ available models via the Fal.ai API (with smart TTL-based caching). It uses Fal's native async client for non-blocking generation, with queue-based progress updates for long-running video/music jobs, and supports stdio, HTTP/SSE, or dual transport modes. A handful of friendly aliases are always available for popular models, e.g. flux_schnell/flux_dev/flux_pro and sdxl for images, svd/kling for video, and musicgen/bark/whisper for audio - alongside any of the 600+ full model IDs.

When to use - and when NOT to

Use this when you want an AI assistant to generate media directly - text-to-image, image editing/upscaling/background removal, text-to-video or image-to-video, or music generation - by name, friendly alias (e.g. flux_schnell), or full Fal.ai model ID (e.g. fal-ai/flux-pro/v1.1-ultra). Use list_models to discover models by category or search term, and recommend_model/get_pricing before generating to pick the right model and understand cost. It requires a Fal.ai API key (FAL_KEY); note that video and music generation can take several minutes and may hit a default timeout - use a faster model variant (e.g. schnell over pro) or reduce duration/resolution if that's a problem. When running via Docker, the upload_file tool needs explicit volume mounts to reach host files - container paths, not host paths, must be used. Common errors are self-explanatory and documented: a missing FAL_KEY, a misspelled model ID (fixable via list_models), a Docker file-not-found (needs a volume mount), and rate limiting (wait and retry, or upgrade the Fal.ai plan).

Capabilities

Image: generate_image, generate_image_structured, generate_image_from_image. Editing: remove_background, upscale_image, edit_image, inpaint_image, resize_image (social media presets), compose_images (overlays/watermarks). Video: generate_video, generate_video_from_image, generate_video_from_video. Audio: generate_music. Utility: list_models (category/search filters), recommend_model, get_pricing, get_usage, upload_file.

How to install

Via uvx (zero install):

{
  "mcpServers": {
    "fal-ai": {
      "command": "uvx",
      "args": ["--from", "fal-mcp-server", "fal-mcp"],
      "env": { "FAL_KEY": "your-fal-api-key" }
    }
  }
}

Or via Docker for production:

docker run -d --name fal-mcp -e FAL_KEY=your-api-key -p 8080:8080 ghcr.io/raveenb/fal-mcp-server:latest

then connect Claude Desktop via mcp-remote pointed at http://localhost:8080/sse. Claude Code users can install via the plugin marketplace: /plugin install fal-ai@raveenb/fal-mcp-server. Requires Python 3.10+ and a Fal.ai API key.

Who it's for

Creators and developers who want an AI assistant to generate or edit images, video, and music using any of 600+ Fal.ai models, with cost visibility and model recommendations built in. Licensed MIT.

Source README

๐ŸŽจ Fal.ai MCP Server

CI
Docker
MCP
GitHub Release
PyPI
Docker Image
Python
License

A Model Context Protocol (MCP) server that enables Claude Desktop (and other MCP clients) to generate images, videos, music, and audio using Fal.ai models.

Fal.ai Server MCP server

โœจ Features

๐Ÿš€ Performance

  • Native Async API - Uses fal_client.run_async() for optimal performance
  • Queue Support - Long-running tasks (video/music) use queue API with progress updates
  • Non-blocking - All operations are truly asynchronous

๐ŸŒ Transport Modes (New!)

  • STDIO - Traditional Model Context Protocol communication
  • HTTP/SSE - Web-based access via Server-Sent Events
  • Dual Mode - Run both transports simultaneously

๐ŸŽจ Media Generation (18 Tools)

Image Generation:

  • ๐Ÿ–ผ๏ธ generate_image - Create images from text prompts (Flux, SDXL, etc.)
  • ๐ŸŽฏ generate_image_structured - Fine-grained control over composition, lighting, subjects
  • ๐Ÿ”„ generate_image_from_image - Transform existing images with style transfer

Image Editing:

  • โœ‚๏ธ remove_background - Remove backgrounds from images (transparent PNG)
  • ๐Ÿ” upscale_image - Upscale images 2x or 4x while preserving quality
  • โœ๏ธ edit_image - Edit images using natural language instructions
  • ๐ŸŽญ inpaint_image - Edit specific regions using masks
  • ๐Ÿ“ resize_image - Smart resize for social media (Instagram, YouTube, TikTok, etc.)
  • ๐Ÿท๏ธ compose_images - Overlay images (watermarks, logos) with precise positioning

Video Tools:

  • ๐ŸŽฌ generate_video - Text-to-video and image-to-video generation
  • ๐Ÿ“น generate_video_from_image - Animate images into videos
  • ๐Ÿ”€ generate_video_from_video - Video restyling and motion transfer

Audio Tools:

  • ๐ŸŽต generate_music - Create instrumental music or songs with vocals

Utility Tools:

  • ๐Ÿ” list_models - Discover 600+ available models with smart filtering
  • ๐Ÿ’ก recommend_model - AI-powered model recommendations for your task
  • ๐Ÿ’ฐ get_pricing - Check costs before generating content
  • ๐Ÿ“Š get_usage - View spending history and usage stats
  • โฌ†๏ธ upload_file - Upload local files for use with generation tools

๐Ÿ” Dynamic Model Discovery (New!)

  • 600+ Models - Access all models available on Fal.ai platform
  • Auto-Discovery - Models are fetched dynamically from the Fal.ai API
  • Smart Caching - TTL-based cache for optimal performance
  • Flexible Input - Use full model IDs or friendly aliases

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • Fal.ai API key (free tier available)
  • Claude Desktop (or any MCP-compatible client)

Installation

Option 0: Claude Code Plugin (Simplest for Claude Code Users) ๐Ÿ”Œ

If you're using Claude Code, install directly via the plugin system:

# Add the Luminary Lane Tools marketplace
/plugin marketplace add raveenb/fal-mcp-server

# Install the fal-ai plugin
/plugin install fal-ai@luminary-lane-tools

Or install directly without adding the marketplace:

/plugin install fal-ai@raveenb/fal-mcp-server

Note: You'll need to set FAL_KEY in your environment before using the plugin.

Option 1: uvx (Recommended - Zero Install) โšก

Run directly without installation using uv:

# Run the MCP server directly
uvx --from fal-mcp-server fal-mcp

# Or with specific version
uvx --from fal-mcp-server==1.4.0 fal-mcp

Claude Desktop Configuration for uvx:

{
  "mcpServers": {
    "fal-ai": {
      "command": "uvx",
      "args": ["--from", "fal-mcp-server", "fal-mcp"],
      "env": {
        "FAL_KEY": "your-fal-api-key"
      }
    }
  }
}

Note: Install uv first: curl -LsSf https://astral.sh/uv/install.sh | sh

Option 2: Docker (Recommended for Production) ๐Ÿณ

Official Docker image available on GitHub Container Registry.

Step 1: Start the Docker container

# Pull and run with your API key
docker run -d \
  --name fal-mcp \
  -e FAL_KEY=your-api-key \
  -p 8080:8080 \
  ghcr.io/raveenb/fal-mcp-server:latest

# Verify it's running
docker logs fal-mcp

Step 2: Configure Claude Desktop to connect

Add to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "fal-ai": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:8080/sse"]
    }
  }
}

Note: This uses mcp-remote to connect to the HTTP/SSE endpoint. Alternatively, if you have curl available: "command": "curl", "args": ["-N", "http://localhost:8080/sse"]

Step 3: Restart Claude Desktop

The fal-ai tools should now be available.

Docker Environment Variables:

Variable Default Description
FAL_KEY (required) Your Fal.ai API key
FAL_MCP_TRANSPORT http Transport mode: http, stdio, or dual
FAL_MCP_HOST 0.0.0.0 Host to bind the server to
FAL_MCP_PORT 8080 Port for the HTTP server

Using Docker Compose:

curl -O https://raw.githubusercontent.com/raveenb/fal-mcp-server/main/docker-compose.yml
echo "FAL_KEY=your-api-key" > .env
docker-compose up -d

โš ๏ธ File Upload with Docker:

The upload_file tool requires volume mounts to access host files:

docker run -d -p 8080:8080 \
  -e FAL_KEY="${FAL_KEY}" \
  -e FAL_MCP_TRANSPORT=http \
  -v ${HOME}/Downloads:/downloads:ro \
  -v ${HOME}/Pictures:/pictures:ro \
  ghcr.io/raveenb/fal-mcp-server:latest

Then use container paths like /downloads/image.png instead of host paths.

Feature stdio (uvx) Docker (HTTP/SSE)
upload_file โœ… Full filesystem โš ๏ธ Needs volume mounts
Security Runs as user Sandboxed container
Option 3: Install from PyPI
pip install fal-mcp-server

Or with uv:

uv pip install fal-mcp-server
Option 4: Install from source
git clone https://github.com/raveenb/fal-mcp-server.git
cd fal-mcp-server
pip install -e .

Configuration

  1. Get your Fal.ai API key from fal.ai

  2. Configure Claude Desktop by adding to:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
For PyPI/pip Installation:
{
  "mcpServers": {
    "fal-ai": {
      "command": "fal-mcp",
      "env": {
        "FAL_KEY": "your-fal-api-key"
      }
    }
  }
}

Note: For Docker configuration, see Option 2: Docker above.

For Source Installation:
{
  "mcpServers": {
    "fal-ai": {
      "command": "python",
      "args": ["/path/to/fal-mcp-server/src/fal_mcp_server/server.py"],
      "env": {
        "FAL_KEY": "your-fal-api-key"
      }
    }
  }
}
  1. Restart Claude Desktop

๐Ÿ’ฌ Usage

With Claude Desktop

Once configured, ask Claude to:

  • "Generate an image of a sunset"
  • "Create a video from this image"
  • "Generate 30 seconds of ambient music"
  • "Convert this text to speech"
  • "Transcribe this audio file"

Discovering Available Models

Use the list_models tool to discover available models:

  • "What image models are available?"
  • "List video generation models"
  • "Search for flux models"

Using Any Fal.ai Model

You can use any model from the Fal.ai platform:

# Using a friendly alias (backward compatible)
"Generate an image with flux_schnell"

# Using a full model ID (new capability)
"Generate an image using fal-ai/flux-pro/v1.1-ultra"
"Create a video with fal-ai/kling-video/v1.5/pro"

HTTP/SSE Transport (New!)

Run the server with HTTP transport for web-based access:

# Using Docker (recommended)
docker run -d -e FAL_KEY=your-key -p 8080:8080 ghcr.io/raveenb/fal-mcp-server:latest

# Using pip installation
fal-mcp-http --host 0.0.0.0 --port 8000

# Or dual mode (STDIO + HTTP)
fal-mcp-dual --transport dual --port 8000

Connect from web clients via Server-Sent Events:

  • SSE endpoint: http://localhost:8080/sse (Docker) or http://localhost:8000/sse (pip)
  • Message endpoint: POST http://localhost:8080/messages/

See Docker Documentation and HTTP Transport Documentation for details.

๐Ÿ“ฆ Supported Models

This server supports 600+ models from the Fal.ai platform through dynamic discovery. Use the list_models tool to explore available models, or use any model ID directly.

Popular Aliases (Quick Reference)

These friendly aliases are always available for commonly used models:

Alias Model ID Type
flux_schnell fal-ai/flux/schnell Image
flux_dev fal-ai/flux/dev Image
flux_pro fal-ai/flux-pro Image
sdxl fal-ai/fast-sdxl Image
stable_diffusion fal-ai/stable-diffusion-v3-medium Image
svd fal-ai/stable-video-diffusion Video
animatediff fal-ai/fast-animatediff Video
kling fal-ai/kling-video Video
musicgen fal-ai/musicgen-medium Audio
musicgen_large fal-ai/musicgen-large Audio
bark fal-ai/bark Audio
whisper fal-ai/whisper Audio

Using Full Model IDs

You can also use any model directly by its full ID:

# Examples of full model IDs
"fal-ai/flux-pro/v1.1-ultra"      # Latest Flux Pro
"fal-ai/kling-video/v1.5/pro"     # Kling Video Pro
"fal-ai/hunyuan-video"            # Hunyuan Video
"fal-ai/minimax-video"            # MiniMax Video

Use list_models with category filters to discover more:

  • list_models(category="image") - All image generation models
  • list_models(category="video") - All video generation models
  • list_models(category="audio") - All audio models
  • list_models(search="flux") - Search for specific models

๐Ÿ“š Documentation

Guide Description
Installation Guide Detailed setup instructions for all platforms
API Reference Complete tool documentation with parameters
Examples Usage examples for image, video, and audio generation
Docker Guide Container deployment and configuration
HTTP Transport Web-based SSE transport setup
Local Testing Running CI locally with act

๐Ÿ“– Full documentation site: raveenb.github.io/fal-mcp-server

๐Ÿ”Œ Claude Code Plugin Marketplace

This project is part of the Luminary Lane Tools marketplace for Claude Code plugins.

Add the marketplace:

/plugin marketplace add raveenb/fal-mcp-server

Available plugins:

Plugin Description
fal-ai Generate images, videos, and music using 600+ Fal.ai models

More plugins coming soon!

๐Ÿ”ง Troubleshooting

Common Errors

FAL_KEY not set
Error: FAL_KEY environment variable is required

Solution: Set your Fal.ai API key:

export FAL_KEY="your-api-key"
Model not found
Error: Model 'xyz' not found

Solution: Use list_models to discover available models, or check the model ID spelling.

File not found (Docker)
Error: File not found: /Users/username/image.png

Solution: When using Docker, mount the directory as a volume. See File Upload with Docker above.

Timeout on video/music generation
Error: Generation timed out after 300s

Solution: Video and music generation can take several minutes. This is normal for high-quality models. Try:

  • Using a faster model variant (e.g., schnell instead of pro)
  • Reducing duration or resolution
Rate limiting
Error: Rate limit exceeded

Solution: Wait a few minutes and retry. Consider upgrading your Fal.ai plan for higher limits.

Debug Mode

Enable verbose logging for troubleshooting:

# Set debug environment variable
export FAL_MCP_DEBUG=true

# Run the server
fal-mcp

Reporting Issues

If you encounter a bug or unexpected behavior:

  1. Check existing issues: GitHub Issues

  2. Gather information:

    • Error message (full text)
    • Steps to reproduce
    • Model ID used
    • Environment (OS, Python version, transport mode)
  3. Open a new issue with:

    **Error:** [paste error message]
    **Steps to reproduce:** [what you did]
    **Model:** [model ID if applicable]
    **Environment:** [OS, Python version, Docker/uvx/pip]
    
  4. Include logs if available (with sensitive data removed)

๐Ÿ“ Open an Issue

๐Ÿค Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Local Development

We support local CI testing with act:

# Quick setup
make ci-local  # Run CI locally before pushing

# See detailed guide
cat docs/LOCAL_TESTING.md

๐Ÿ“ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

Hosted deployment

A hosted deployment is available on Fronteir AI.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.