Fal.ai MCP Server

A Model Context Protocol (MCP) server for discovering and documenting Fal.ai models. This server provides tools for coding agents to learn about available models, their schemas, capabilities, and usage patterns.

Features

Available Tools

list_models

List all available Fal.ai models for image, video, and audio generation with comprehensive filtering and sorting options.

Use this tool when:

Filtering Options:

Common API Categories: "text-to-image", "image-to-image", "text-to-video", "image-to-video", "video-to-video", "image-to-3d", "text-to-audio", "audio", "audio-to-audio", "speech-to-text", "text-to-speech", "training"

Sorting Options:

Parameters:

Examples:

// Basic search
{
  "category": "text-to-image",
  "search": "flux",
  "limit": 10
}

// Advanced filtering
{
  "category": ["text-to-image", "image-to-image"],
  "status": "active",
  "tags": ["new"],
  "sortBy": "updated_at",
  "limit": 20
}

get_model_info

Get detailed information about a specific Fal.ai model including metadata, capabilities, description, and pricing (when API key is provided).

Use this tool when:

Returns comprehensive model information including ID, name, description, category, owner, capabilities, and pricing (when API key is provided via Authorization header).

Parameters:

Example:

{
  "model_id": "fal-ai/flux-pro"
}

get_model_schema

Get the OpenAPI/JSON schema for a Fal.ai model's input and output parameters.

Use this tool when:

Returns the complete schema including required/optional parameters, types, examples, and validation rules.

Parameters:

Example:

{
  "model_id": "fal-ai/flux/dev"
}

get_model_documentation

Get comprehensive documentation for a Fal.ai model including usage examples, best practices, parameter descriptions, and integration guides.

Use this tool when:

Returns markdown-formatted documentation with examples, parameter details, and best practices.

Parameters:

Example:

{
  "model_id": "fal-ai/flux-pro"
}

MCP Client Configuration

API Key Configuration (Optional)

API keys are optional but recommended to avoid rate limits. The server works without authentication, but authenticated requests have higher rate limits.

How It Works

The server extracts API keys from the Authorization header in MCP client requests:

Authorization: Key <your-fal-api-key>

Configuring MCP Clients

Claude Desktop

Add custom headers in your Claude Desktop configuration:

{
  "mcpServers": {
    "fal-ai": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://fal-mcp.your-account.workers.dev/mcp"
      ],
      "env": {
        "FAL_API_KEY": "your-fal-api-key-here"
      }
    }
  }
}

Note: The exact method for passing headers depends on your MCP client. Some clients may require using a proxy or wrapper to inject headers.

Other MCP Clients

Check your MCP client's documentation for how to pass custom headers. The server expects:

Getting a Fal.ai API Key

  1. Sign up at fal.ai
  2. Navigate to your account settings
  3. Generate an API key
  4. Use it in the Authorization header format: Key <your-api-key>

Connecting to MCP Clients

Using mcp-remote

For local MCP clients like Claude Desktop, use the mcp-remote package:

npm install -g mcp-remote

Then configure your MCP client to use:

npx mcp-remote https://fal-mcp.your-account.workers.dev/mcp

Direct Connection

If your MCP client supports streamable HTTP transport, connect directly to:

https://fal-mcp.your-account.workers.dev/mcp

Architecture

Components

Caching Strategy

API Integration

The server uses the Fal.ai Platform API for:

All API calls are made server-side, so MCP clients don't need direct API access.

References