Fal.ai Video Generator MCP server

Provides a bridge to fal.ai's video generation models, enabling creation of customized videos from text prompts and images with adjustable parameters like aspect ratio, resolution, and duration.
Back to servers
Setup instructions
Provider
el-el-san
Release date
Apr 07, 2025
Language
TypeScript
Stats
2 stars

This MCP server allows you to generate videos from text prompts or images using AI image generation models like Luma Ray2 Flash and Kling v1.6 Pro. It provides a straightforward way to control video parameters and create AI-generated video content.

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Create a .env file and set your FAL.AI API key:
    FAL_KEY=your_fal_key_here
    
    You can obtain an API key from FAL.AI

Building and Running the Server

Build the server:

npm run build

Run the server:

npm start

Integration with Claude Desktop

To use this server with Claude Desktop, add the following to your claude_desktop_config.json file:

{
  "mcpServers": {
    "video-generator": {
      "command": "node",
      "args": ["your_install_path/fal-mcp-server/build/index.js"],
      "env": {
        "FAL_KEY": "your_fal_key_here"
      }
    }
  }
}

Available Tools

generate-video

Generates videos from text prompts and/or images using AI models.

Parameters:

  • prompt (required): Text description of the video content you want to generate
  • image_url (optional): Starting image URL for the video (URL or base64 data URI)
  • end_image_url (optional): Ending image URL for the video (URL or base64 data URI)
  • aspect_ratio (default "16:9"): Video aspect ratio ("16:9", "9:16", "4:3", "3:4", "21:9", "9:21")
  • resolution (default "540p"): Video resolution ("540p", "720p", "1080p")
  • duration (default "5s"): Video length ("5s", "9s")
  • loop (default false): Whether to loop the video
  • model (default "luma"): AI model to use ("luma"=Ray2, "kling"=Kling v1.6 Pro)

check-video-status

Checks the status of a video generation request.

Parameters:

  • request_id (required): Request ID to check
  • model (default "luma"): AI model used for the request ("luma"=Ray2, "kling"=Kling v1.6 Pro)

Usage Examples

You can use prompts like this in Claude:

Generate a video of a cat playing with a ball of yarn. Please use portrait mode and the Kling model.

Claude will call the generate-video tool with appropriate parameters and provide the resulting video URL.

Model Comparison

  • Luma Ray2 Flash: Excels at smooth movements and realistic physics, producing natural results
  • Kling v1.6 Pro: Excels at detailed textures and special effects, producing stylized results

The optimal model may vary depending on your prompt and desired outcome.

Limitations

  • Video generation may take time (especially at higher resolutions)
  • Requires a valid FAL.AI API key with sufficient credits
  • Higher resolutions and longer videos consume more credits
  • Both models consume FAL.AI credits (rates may vary by model)

Troubleshooting

API Key Errors

Ensure your FAL_KEY environment variable is correctly set. You can also set it directly in the Claude Desktop configuration file.

Video Generation Errors

If errors occur during video generation, detailed error messages will be logged. Common issues include:

  • Invalid or expired API key
  • Insufficient account credits
  • Inappropriate prompts or images
  • Temporary server-side issues

If errors persist, wait and try again, or try modifying your prompt.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "video-generator" '{"command":"node","args":["your_install_path/fal-mcp-server/build/index.js"],"env":{"FAL_KEY":"your_fal_key_here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "video-generator": {
            "command": "node",
            "args": [
                "your_install_path/fal-mcp-server/build/index.js"
            ],
            "env": {
                "FAL_KEY": "your_fal_key_here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "video-generator": {
            "command": "node",
            "args": [
                "your_install_path/fal-mcp-server/build/index.js"
            ],
            "env": {
                "FAL_KEY": "your_fal_key_here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later