fal.ai MCP Server & CLI

A free, open source fal.ai MCP server and CLI that lets Claude Code, Codex, Cursor and other AI agents find models, check prices, and generate images and videos.

Navid Moazzezby Navid Moazzez·Updated Oct 5, 2026·15 min read·
Your computer
  1. 1

    Add it with a single command in a terminal.

    Put your own fal key in place of the example.

    claude mcp add fal-ai \
    -e FAL_KEY=YOUR_FAL_KEY \
    -- npx -y @thenavidm/fal-ai-mcp-cli@latest
  2. 2

    In Claude Code, type /mcp. fal should show as connected.

    /mcp

Needs Node 22 or newer and a fal API key. Make one in a minute.

It's free and open source. If it saves you time, star it on GitHub, so more people find it.

Rate this tool

This free fal.ai MCP server and CLI gives your AI real access to fal.ai's image, video, audio and 3D models, your request history and your Assets library. It finds models and their prices, runs them, follows each run until it's done, and manages your Assets, collections, characters and file access.

It's one install with two ways in. Claude, Codex, Cursor or any other MCP app calls its 66 tools for you, and the same tools work as a CLI that agents like Claude Code, Codex and OpenCode run, or that you type yourself.

In this guide, I'll show you:

  • What the fal.ai MCP server & CLI is, and what you can ask it
  • How to install it and check that it works
  • When to use the MCP server, and when the CLI
  • Every tool, and how to keep your account safe

Every tool on this page comes from the server itself, and every cost was measured in Claude Code.

key_takeaways.mdTL;DR

Key takeaways

It gives Claude, Codex, Cursor and any other MCP app 66 tools for fal.ai: find models, check prices, generate images and videos, follow your runs, and manage your Assets library and files.
Your AI reads a model's inputs and price before it spends a credit, and every paid run waits for your approval.
The server asks fal not to store your inputs and outputs as data, unless you ask it to.
The same tools run as a CLI, which costs your AI nothing until it runs.

What is the fal.ai MCP server & CLI?

The fal.ai MCP server & CLI is a free, open source program that lets AI agents make images and videos with fal.ai models for you, in two ways. The MCP server is what an AI app like Claude, Codex or Cursor connects to, through MCP (Model Context Protocol), the open standard AI apps use to call outside tools.

You ask in plain language. Your AI picks the right tool, and the server makes the call to fal's own API.

The CLI is the same program as commands. fal-ai-cli search-models runs the same code your AI runs when you ask which models can make video, whether an agent like Claude Code runs it or you do.

In an AI OS, the layer that connects your AI to your context, your data and your tools, a server like this is how your AI reaches fal.ai. I explain how the parts fit together in how to build an AI operating system, and here's how I use AI myself.

What can you ask it?

Once it's set up, you ask the way you'd ask an assistant. These are real prompts it handles:

Try asking
Which fal models can turn an image into a video, and what does each one cost?
Make a product photo of a ceramic mug on a wooden table with FLUX.
Is my video done yet? Send me the link.
How much did I spend on fal last week, model by model?
Put my last five images in a collection called Launch.
Make that file private, and give me a link that works for a day.

The first one shows why this is useful. Your AI compares models and prices before anything runs, so you choose with the cost in front of you.

It works well next to my Midjourney MCP server and Creatomate MCP server, so your AI can generate images in Midjourney and turn the results into template videos in the same chat. Every server I've made is on my MCP servers page.

For your prompts, my free AI image prompt generator and AI video prompt generator help too.

How to install the fal.ai MCP server

Pick your app in the box at the top of this page. Each one is a single command or a pasted block, and they all run through npx, so there's nothing to install first.

Windsurf, Zed and Cline take the same server, though they don't have a tab in the box yet. Follow the box's Cursor tab, and put its block here instead:

AppWhere the block goes
WindsurfIn the Cascade panel, open the Actions menu (…) and choose Open MCP config file, then paste the block.
ClineClick the MCP Servers icon in the Cline panel, open the Configure tab, click Configure MCP Servers, and paste the block.
ZedGo to Settings, then AI, then MCP Servers, and choose Add Server, then Add Local Server. Enter the block's command, arguments and variables, and Zed saves them under context_servers.
Before you start0/3

Watch out: fal shows a new key only once, so copy it as soon as you create it. If you work in a team, select the team in the top-left corner of the dashboard first.

Set up your fal account

It takes a minute.

Create an API key0/5

The API scope runs models, and it's the right one to start with. An ADMIN key adds deploying your own apps, which this server doesn't need.

A key belongs to the account that made it, personal or team, and every run is billed to that account.

To keep the key out of your app's config, save it alone in a file only you can read, and point FAL_TOKEN_FILE at that file's full path instead.

Check that it works

Run the doctor with --network. It checks your settings, then reads one model from fal's catalog. It never runs a model or spends a credit.

npx -y @thenavidm/fal-ai-mcp-cli doctor --network

When every line has a check mark, restart your app and ask it which models can make video. The catalog is public, so if model searches work but your Assets don't, the key is from a different account.

In Claude Code, /mcp also shows whether the fal.ai server is connected. It's one of the Claude Code commands worth knowing.

Use the fal.ai CLI

The CLI is the same 66 tools as commands. AI agents that run commands, like Claude Code, Codex and OpenCode, use it on their own, and you can type the same commands in a terminal or a script.

Every tool name becomes a command with dashes, so search_models runs as fal-ai-cli search-models.

npm install -g @thenavidm/fal-ai-mcp-cli
fal-ai-cli
fal-ai-cli search-models --category image-to-video --limit 5
fal-ai-cli get-pricing --endpoint-id fal-ai/flux/dev
fal-ai-cli submit-job --model-id fal-ai/flux/dev --input '{"prompt":"A ceramic mug on a wooden table"}' --confirm
fal-ai-cli get-job-status --model-id fal-ai/flux/dev --request-id YOUR_REQUEST_ID

The bare fal-ai-cli lists every command, fal-ai-cli which <words> finds the command for a task, and fal-ai-cli <command> --help shows what a command takes. Every model run, upload and change needs --confirm, the terminal's version of your approval.

fal-ai-cli install <app> adds the server to Claude Code, Codex, Claude Desktop, Cursor, VS Code or Gemini CLI, in each app's own format.

These are the flags you'll use most:

FlagWhat it does
--jsonPrints JSON
--compactPrints the JSON on one line
--select a,b.cKeeps only those fields, and a dotted path goes deeper
--agentMachine mode: compact JSON, no prompts, and it never confirms anything
--confirmLets a write that asks first go ahead
--dry-runShows what a write would do, without doing it

A script can branch on the exit code:

Exit codeWhat it means
0It worked
1Something unexpected went wrong
2The command was typed wrong, or a write needed --confirm
3It wasn't found
4fal.ai rejected the credentials
5fal.ai failed or couldn't be reached
7You hit a rate limit, so wait and try again
10Nothing is set up yet

MCP server or CLI: which one?

Both are the same program with the same 66 tools. The difference is when your AI pays for them, in the tokens it reads.

Every message, in an app that loads every tool
MCP server
40,500 tokens
CLI
Nothing
Every message, in Claude Code
MCP server
1,300 tokens
CLI
Nothing
When fal.ai comes up
MCP server
Nothing more, or in Claude Code the tools it picks
CLI
1,300 tokens, once
20 messages with fal.ai in one, every tool loaded
MCP server
810,000 tokens
CLI
1,300 tokens
Works in Claude Desktop's chat
MCP server
Yes
CLI
No, there's no terminal there
Works in a script, a cron job or CI
MCP server
No
CLI
Yes

An app that loads every tool up front sends the full list with every message, whether you mention fal.ai or not. Claude Code doesn't by default: its tool search sends only the tool names and the server's instructions, and loads a tool's full definition when your AI reaches for it.

The CLI costs nothing until fal.ai comes up. Then your agent reads its skill file once and runs the commands it needs. With the skill added, Claude Code also lists its one-line description with every message, about 60 tokens.

When the whole conversation is about fal.ai, the gap closes. Then the MCP server is the better experience, because you ask in plain language and your AI never has to look up a command.

How to spend less

In Claude Code, leave tool search on, which it is unless you've set ENABLE_TOOL_SEARCH=false.

Turn the server off when you aren't making media. In Claude Code that's the /mcp panel, and every AI app has its own switch. FAL_READ_ONLY=1 cuts it to the 32 reading tools.

Or install the CLI and connect the server later, on the days it earns its place. Every tool stays in reach, and the standing cost drops to nothing.

Every number here was measured on October 5, 2026 in Claude Code 2.1.286 with Claude Opus 5.5. It's the same one-line prompt with and without the server connected, once with tool search off so every tool loads, and once with Claude Code's default. The skill was measured the same way, and other apps and models count tokens a little differently.

Check the price, run it, then read the result

Every model takes its own inputs, so your AI reads get_model_info and the price before it runs anything. A price can depend on the resolution, the length or the number of outputs, so an estimate isn't the final bill.

submit_job queues a run and returns a request ID. Your AI checks that ID with get_job_status and reads the result once it's done, instead of running the model again to see where it is. A run that timed out may still have spent credits, so your AI checks your history before it tries again.

The server asks fal not to store your inputs and outputs as data, unless you ask it to. The media files themselves follow your storage settings, and those can be public by default.

set_storage_file_acl decides who can open a file, and sign_storage_file_url makes a temporary link to a private one, saved to a private file instead of the chat.

For several runs at once, preview_generation_batch checks up to 10 of them against current inputs and prices, and gives the batch a fingerprint. submit_generation_batch checks them all again before the first one goes, and stops if anything changed.

Watch out: Changing your storage settings or a file's access replaces the whole setting, so anything you leave out goes back to its default. Your AI reads the current setting first.

Every fal.ai tool

The tables below list all 66 tools, grouped by what they're for. Of these, 32 only read, and 34 spend credits or change something in your fal account or on your computer.

Runs and uploads

run_model
What it does
Runs a model and waits for the result, which spends credits.
Kind
Asks first
submit_job
What it does
Queues a model run and returns its request ID, which spends credits.
Kind
Asks first
generate_image
What it does
Makes an image with the model you pick, which spends credits.
Kind
Asks first
generate_video
What it does
Makes a video with the model you pick, which spends credits.
Kind
Asks first
get_job_status
What it does
Checks where a queued run is.
Kind
Reads
get_job_result
What it does
Reads a finished run's result.
Kind
Reads
cancel_job
What it does
Asks fal to cancel a queued run.
Kind
Asks first
upload_file
What it does
Uploads one file from your computer, up to 20 MB, to use as an input.
Kind
Asks first
preview_generation_batch
What it does
Checks up to 10 runs against current inputs and prices, and gives the batch a fingerprint.
Kind
Reads
submit_generation_batch
What it does
Queues a checked batch of runs, only with the fingerprint from its preview.
Kind
Asks first

Models and prices

search_models
What it does
Finds models by name or category, or lists them all.
Kind
Reads
get_pricing
What it does
Shows a model's price per image, video or second.
Kind
Reads
estimate_pricing
What it does
Estimates what a run will cost.
Kind
Reads
get_model_info
What it does
Reads one model's details and the inputs it takes.
Kind
Reads

Usage, billing and history

get_usage
What it does
Lists your billed usage, by model, user or date.
Kind
Reads
get_analytics
What it does
Shows request counts, error rates and speed for each model.
Kind
Reads
get_billing_events
What it does
Lists your individual billing events.
Kind
Reads
delete_request_payloads
What it does
Deletes a request's stored inputs, outputs and output files.
Kind
Asks first
list_requests_by_endpoint
What it does
Lists your requests to the models you name.
Kind
Reads
search_requests
What it does
Searches your request history by text, image or video.
Kind
Reads
get_account_billing
What it does
Reads your account's billing details.
Kind
Reads
get_organization_teams
What it does
Lists your organization's teams, on Enterprise.
Kind
Reads
get_organization_usage
What it does
Lists usage across your organization's teams, on Enterprise.
Kind
Reads

Workflows

list_workflows
What it does
Lists your workflows.
Kind
Reads
create_workflow
What it does
Saves a new workflow.
Kind
Asks first
get_workflow
What it does
Reads one workflow in full.
Kind
Reads

Assets

list_assets
What it does
Browses and searches your fal Assets library.
Kind
Reads
upload_asset
What it does
Adds media already hosted on fal to your Assets library.
Kind
Asks first
get_asset
What it does
Reads one asset.
Kind
Reads
get_asset_lineage
What it does
Shows what an asset was made from, step by step.
Kind
Reads
favorite_asset
What it does
Marks an asset as a favorite.
Kind
Asks first
unfavorite_asset
What it does
Takes an asset out of your favorites.
Kind
Asks first

Asset collections

list_asset_collections
What it does
Lists your asset collections.
Kind
Reads
create_asset_collection
What it does
Makes an asset collection.
Kind
Asks first
get_asset_collection
What it does
Reads one asset collection.
Kind
Reads
update_asset_collection
What it does
Changes an asset collection.
Kind
Asks first
delete_asset_collection
What it does
Deletes an asset collection.
Kind
Asks first
get_asset_collection_hierarchy
What it does
Shows the collections above and below one collection.
Kind
Reads
favorite_asset_collection
What it does
Marks a collection as a favorite.
Kind
Asks first
unfavorite_asset_collection
What it does
Takes a collection out of your favorites.
Kind
Asks first
move_asset_collection
What it does
Moves a collection into another one, or to the top.
Kind
Asks first
list_asset_collection_assets
What it does
Lists the assets in a collection.
Kind
Reads
add_asset_to_collection
What it does
Adds an asset to a collection.
Kind
Asks first
remove_asset_from_collection
What it does
Takes an asset out of a collection.
Kind
Asks first

Characters

list_asset_characters
What it does
Lists your characters, the reference sets that keep a person consistent.
Kind
Reads
create_asset_character
What it does
Makes a character from reference images.
Kind
Asks first
update_asset_character
What it does
Changes a character.
Kind
Asks first
get_asset_character
What it does
Reads one character.
Kind
Reads
delete_asset_character
What it does
Deletes a character.
Kind
Asks first
favorite_asset_character
What it does
Marks a character as a favorite.
Kind
Asks first
unfavorite_asset_character
What it does
Takes a character out of your favorites.
Kind
Asks first

Asset tags

list_asset_tags
What it does
Lists your asset tags.
Kind
Reads
create_asset_tag
What it does
Makes an asset tag.
Kind
Asks first
set_asset_tags_for_asset
What it does
Sets all of an asset's tags at once.
Kind
Asks first
update_asset_tag
What it does
Changes an asset tag.
Kind
Asks first
delete_asset_tag
What it does
Deletes an asset tag.
Kind
Asks first
list_asset_tags_for_asset
What it does
Lists an asset's tags.
Kind
Reads
assign_asset_tag
What it does
Adds a tag to an asset.
Kind
Asks first
unassign_asset_tag
What it does
Takes a tag off an asset.
Kind
Asks first

File access and storage

get_storage_file_acl
What it does
Reads who can open a file on fal's CDN.
Kind
Reads
set_storage_file_acl
What it does
Replaces who can open a file on fal's CDN.
Kind
Asks first
sign_storage_file_url
What it does
Makes a temporary link to a private file, saved to a private file on your computer.
Kind
Asks first
get_storage_settings
What it does
Reads how long new files are kept and who can open them.
Kind
Reads
update_storage_settings
What it does
Replaces how long new files are kept and who can open them.
Kind
Asks first

Your accounts and requests

list_accounts
What it does
Lists the accounts you've set up, without their keys.
Kind
Reads
get_operation_schema
What it does
Shows every field one of these requests takes.
Kind
Reads

Is the fal.ai MCP server safe?

Every run spends credits, and file access decides who can see your media. So 34 tools ask first: every model run, cancellation and upload, every change to your Assets, workflows and storage, and deleting stored requests. They're the ones marked "Asks first" in the tool tables above.

Searching models, checking prices and reading your history never ask, because they cost and change nothing.

When your AI calls one of them, the call needs a yes first. Where you use it decides who gives it:

  • Claude Code (2.1.246 and later) asks you before every call, in every one of its permission modes.
  • An app that can show forms asks you in a form.
  • Any other app takes your AI's confirm: true as the yes, so tell your AI to check with you first.
  • An agent with no person to ask needs FAL_CONFIRM=model, so its confirm: true counts in every app.
  • In a terminal, you add --confirm to the command.

If the answer is no, nothing reaches fal.ai.

Make it read-only

Set FAL_READ_ONLY=1 and every tool that asks first disappears from the tool list, leaving 32 reading tools.

Keep a log of every write

Set FAL_AUDIT_LOG to a file path. The server writes one line per attempted write, allowed or blocked, with what it was about to do and who approved it.

Watch out: Prompts in your history and model descriptions can come from other people, and one can try to give your AI orders. Treat them as data, and use FAL_READ_ONLY=1 for an agent working on its own.

Your data

Your requests go straight to fal, with no server of ours in between and no tracking. Your key stays in your app's config, your shell or your token file.

The server asks fal not to store your inputs and outputs as data, and an upload sends only the one file you pick. Generated media follows your fal storage settings.

To cut access, delete the key at fal.ai/dashboard/keys, and remove the server from your app's config.

Connect more than one fal account

Set FAL_ACCOUNTS to a JSON list with a name and a key, or a token file, for each account, like your personal account and a team. FAL_DEFAULT_ACCOUNT picks the one that acts when a tool names none, and every tool takes an optional account.

A run belongs to the account that started it, so your AI keeps the account with every request ID. An account never borrows another one's key.

fal.ai MCP server settings

Every setting is an environment variable, in your app's config or your shell.

FAL_KEY
Default
none
What it does
Holds your fal API key
FAL_TOKEN_FILE
Default
none
What it does
Points at a private file holding the key, instead
FAL_ACCOUNTS
Default
none
What it does
Lists several accounts, as JSON
FAL_DEFAULT_ACCOUNT
Default
the first one
What it does
Picks the account that acts when a tool names none
FAL_REQUEST_TIMEOUT_MS
Default
30000
What it does
Gives up on a fal request after this many milliseconds
FAL_MIN_REQUEST_INTERVAL_MS
Default
350
What it does
Waits this many milliseconds between requests
FAL_READ_ONLY
Default
off
What it does
1 hides every tool that spends credits or changes something
FAL_ALLOW_DESTRUCTIVE
Default
on
What it does
0 refuses the tools that ask first
FAL_AUDIT_LOG
Default
none
What it does
Names a file that gets one line per attempted write
FAL_SURFACE
Default
full
What it does
search lists three tools that find, describe and run the rest
FAL_TOOL_TIMEOUT_MS
Default
none
What it does
Gives up on any tool after this many milliseconds
FAL_CONFIRM
Default
human
What it does
model lets your AI's confirm: true approve on its own, for an agent with no person to ask
FAL_HTTP_PORT
Default
8787
What it does
Sets the port for --http
FAL_HTTP_HOST
Default
127.0.0.1
What it does
Sets the address for --http, and any other needs a token
FAL_HTTP_TOKEN
Default
none
What it does
Sets the bearer token every --http request needs
FAL_HTTP_ALLOWED_ORIGINS
Default
none
What it does
Lists other websites allowed to call --http, comma separated
FAL_DEBUG
Default
off
What it does
1 prints debug lines

Troubleshooting

Run the doctor first. It names the step that failed and the fix.

What you seeWhat to do
Model searches work, but Assets failThe catalog is public. Check that the key is from the right account, personal or team
An input is refusedEach model takes its own inputs. Read the model's info and use its exact field names
A run's result isn't readyCheck its status, and read the result once it says COMPLETED. Don't run it again
A run timed outIt may still have spent credits. Check your request history before you try again
A batch says the fingerprint doesn't matchA model's inputs or price changed since the preview. Preview it again
An upload is refusedPick one file between 1 byte and 20 MB, not a folder or a link
"…so it will not run without confirm: true"That's the safety check working. Approve it when your app asks

If the server doesn't show up in your app at all, run the command your app runs, in a terminal, and read the error.

More free tools for AI images and video

Make images with Adobe Firefly or Midjourney too, from the same AI app.

FAQs about the fal.ai MCP server & CLI

Here are the questions people ask most about the fal.ai MCP server and CLI.

The fal.ai MCP server & CLI is a free, open source program that lets an AI app like Claude, Codex or Cursor make images and videos with fal.ai models.

It has 66 tools for models, prices, generation, your request history, Assets and file storage, and the same tools run as a CLI that agents like Claude Code and Codex use, or that you type yourself.

An MCP server is a standard way to give an AI app real access to a tool, so it can act instead of guessing.

MCP stands for Model Context Protocol, and Claude, Codex, Cursor and many other AI apps speak it.

Every server I've made is on my MCP servers page.

The fal.ai CLI is the same program as the fal.ai MCP server, run as commands.

AI agents like Claude Code, Codex and OpenCode run them for you, and you can type them in a terminal or a script.

One npm package installs both.

Use the fal.ai MCP server in an AI app with no terminal, like Claude Desktop's chat, and the CLI in a terminal, a script or a cron job.

In an AI app that can run commands, like Claude Code, Codex or Cursor, the CLI is the lighter choice, because it costs nothing until it runs.

Yes, the fal.ai MCP server is free and open source under the AGPL-3.0 license.

Running models spends your fal credits, and searching models and prices is free.

It spends credits only when a model runs, and every run asks first.

Searching models, checking prices and reading your history spend nothing.

Yes, get_pricing shows a model's unit price, and estimate_pricing estimates a run.

The final bill can differ, because a price can depend on resolution, length and the number of outputs.

The server asks fal not to store your inputs and outputs as data, unless you ask it to.

Generated media files follow your fal storage settings, which you can read and change.

Yes, the fal.ai MCP server connects as many accounts as you set up in FAL_ACCOUNTS, like a personal key and a team key.

Every tool takes an optional account, and an account never borrows another one's key.

To disconnect the fal.ai MCP server, delete its key at fal.ai/dashboard/keys, which cuts access right away.

Then remove the server from your AI app's config.

The fal.ai MCP server works with any app that speaks MCP.

That includes Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Cline, GitHub Copilot CLI, Gemini CLI, OpenCode, OpenClaw, Antigravity and Hermes.

I did.

I'm Navid Moazzez, and I made the fal.ai MCP server & CLI as one of my free tools on navid.me.

You can read more about me.

The code is on GitHub under the AGPL-3.0 license, and the package is on npm.

More MCP servers & CLIs

Related free tools

Navid Moazzez

AI business strategist

Navid Moazzez helps creators and founders master AI and build their own AI Operating System (AI OS) to automate their business and life.

Navid.me is reader-supported. When you buy through links on this site, I may earn an affiliate commission. Read the affiliate disclaimer.

Free AI newsletter

The most actionable AI newsletter for founders

Every week, get proven AI strategies, curated tools, and step-by-step systems to grow your audience, create better content, and build a profitable creator business.

No fluff, no filler, no BS. Just five minutes each week that might level up your online business and life.

P.S. Sign up now to get free access to my ultimate AI tools guide for creators.

Loved by 10,000+ readers
Loved by 10,000+ readers