fal-mcp
# fal-mcp
An MCP server that wraps the [fal.ai](https://fal.ai) image generation API, giving Claude (or any MCP client) the ability to generate and edit images.
## Tools
| Tool | Description |
|---|---|
| `generate_image` | Text-to-image generation with configurable model, size, steps, and guidance |
| `generate_with_reference` | Image generation guided by a style/content reference image |
| `generate_with_lora` | Image generation with a LoRA model applied |
| `edit_image` | Edit an existing image using natural language instructions (FLUX Kontext) |
| `raw_generate` | Submit arbitrary requests for advanced configurations (ControlNet, IP-Adapter, multi-LoRA) |
| `list_outputs` | List all saved images in the output directory |
## Supported models
- `fal-ai/flux/dev` — high quality (default)
- `fal-ai/flux/schnell` — fast, 1-4 steps
- `fal-ai/flux-pro/v1.1` — professional, up to 2K resolution
- `fal-ai/flux-general` — supports LoRA, ControlNet, IP-Adapter
- `fal-ai/recraft/v3/text-to-image` — illustration style
- `fal-ai/flux-pro/kontext` — image editing
## Setup
1. Get an API key from [fal.ai](https://fal.ai)
2. Set the `FAL_KEY` environment variable (or add it to a `.env.local` file in the parent directory)
## Usage with Claude Code
Add this to your `.mcp.json`:
```json
{
"mcpServers": {
"fal": {
"command": "uv",
"args": ["run", "--directory", "/path/to/fal-mcp", "python", "server.py"]
}
}
}
```
## Dependencies
- Python >= 3.11
- [FastMCP](https://github.com/jlowin/fastmcp) v2
- httpx
- python-dotenv
TDQS
Scored across 6 tools
Most tools have distinct purposes: edit_image modifies existing images, generate_image creates from text, generate_with_lora adds LoRA models, generate_with_reference uses style guidance, list_outputs enumerates saved images, and raw_generate handles advanced configurations. However, generate_image and generate_with_lora could potentially overlap in functionality if LoRA is used for generation, but their descriptions clarify the distinction.
Tool names follow a consistent verb-based snake_case pattern (e.g., edit_image, generate_image, list_outputs), which is clear and predictable. The only minor deviation is raw_generate, which uses 'raw' as a prefix instead of a verb, but it still fits the overall naming style without causing confusion.
With 6 tools, the server is well-scoped for image generation and editing tasks. Each tool serves a specific role, from basic generation to advanced configurations, and the count is neither too sparse nor overwhelming, fitting typical MCP server ranges for this domain.
The toolset covers core image generation workflows: creation (generate_image), editing (edit_image), style control (generate_with_reference), model customization (generate_with_lora), and advanced options (raw_generate), plus management (list_outputs). A minor gap is the lack of a delete or manage tool for removing saved images, but agents can work around this.