> ## Documentation Index
> Fetch the complete documentation index at: https://fal.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> fal has two developer products. Model APIs run hosted models through an API key. fal Serverless deploys your own Python apps and models on fal GPUs.
> To call a hosted model, start with the [Quick Start](https://fal.ai/docs/documentation/quickstart.md) and the [Model APIs overview](https://fal.ai/docs/documentation/model-apis/overview.md).
> To deploy your own model with fal Serverless, start with these pages:
> - [Introduction to Serverless](https://fal.ai/docs/documentation/serverless/index.md): What fal Serverless is and the three ways to deploy on it.
> - [Installation & Setup](https://fal.ai/docs/documentation/development/getting-started/installation.md): Install the fal CLI with `pip install fal` and authenticate.
> - [Quick Start](https://fal.ai/docs/documentation/development/getting-started/quick-start.md): Build a Hello World app, test it with `fal run`, and ship it with `fal deploy`.
> - [App Lifecycle](https://fal.ai/docs/documentation/development/app-lifecycle.md): How a `fal.App` goes from code to running runners.
> - [Define Your Endpoints](https://fal.ai/docs/documentation/development/endpoints-overview.md): Structure the API endpoints that your app exposes.
> - [Deploy to Production](https://fal.ai/docs/documentation/deployment/deploy-to-production.md): Persistent URLs, authentication modes, and automatic scaling.
> - [Machine Types](https://fal.ai/docs/documentation/deployment/machine-types.md): Available GPU and CPU machine types and how to choose one.
> - [Pricing](https://fal.ai/docs/documentation/serverless/pricing.md): Per-second billing and the runner states that are billed.
> - [Scaling Parameter Reference](https://fal.ai/docs/documentation/deployment/scale-your-application.md): Parameters that control runners, concurrency, and scale to zero.
> - [Optimizing Cold Starts](https://fal.ai/docs/documentation/serverless/optimizations/optimize-cold-starts.md): Causes of cold starts and ways to make them shorter.
> - [Examples](https://fal.ai/docs/examples/index.md): Complete Serverless apps for image, video, audio, 3D, realtime, and multi-GPU workloads.
> - [Migrating to fal](https://fal.ai/docs/documentation/development/migrating-to-fal.md): Guides to move an existing Docker server or an app from another platform to fal.
> fal Serverless deploys need access that the fal team approves for each account. Request access at https://fal.ai/dashboard/serverless-get-started.

# Model Context Protocol (MCP)

> Connect the fal MCP server to your client using OAuth

Connect your favorite app to fal through browser sign-in. Search models, check pricing, and generate images, video, and audio without pasting an API key into chat.

For public documentation search only, use `https://fal.ai/docs/mcp`. That server does not generate media or access your account. For model generation, use `https://mcp.fal.ai/mcp-relay` and follow the setup guide below.

## Setup

Connect with browser sign-in using `https://mcp.fal.ai/mcp-relay`.

### Coding agents: one command

On macOS or Linux, run this command in your terminal:

```bash theme={null}
curl -fsSL https://fal.ai/mcp/install.sh | bash
```

The installer adds fal to each of these agents that it finds on your computer:

* Claude Code, Codex CLI, and Cursor
* VS Code and Devin Desktop (formerly Windsurf)
* Gemini CLI, Grok Build, and opencode

The installer skips agents that already have fal. It does not write an API key. If a config file has comments or trailing commas, the installer does not change it and prints the entry to add yourself. After it finishes, sign in once in each agent. The installer shows the sign-in step for each agent.

To set up a coding agent by hand, use its guide:

> [card] [Claude Code](https://fal.ai/docs/documentation/setting-up/mcp/claude-code.md)
>
> Add the remote server, then authenticate with /mcp

> [card] [Codex CLI](https://fal.ai/docs/documentation/setting-up/mcp/codex-cli.md)
>
> Add the server and run codex mcp login fal

> [card] [Cursor](https://fal.ai/docs/documentation/setting-up/mcp/cursor.md)
>
> Install from the Cursor Marketplace, or add the server URL

> [card] [Pi](https://fal.ai/docs/documentation/setting-up/mcp/pi.md)
>
> Add the server. Run `pi mcp login fal`.

If you set up fal from inside a coding agent, paste this message into the agent instead. The agent then uses its own MCP command, which it can run without approval for an install script:

```text theme={null}
Add the fal MCP server to this coding agent with its own MCP command, not an install script. The server is https://mcp.fal.ai/mcp-relay (remote, Streamable HTTP, OAuth sign-in). In Claude Code: claude mcp add --transport http --scope user fal https://mcp.fal.ai/mcp-relay. In Codex: codex mcp add fal --url https://mcp.fal.ai/mcp-relay. Then tell me how to sign in.
```

### Apps and chat agents

The installer cannot reach these. Connect fal inside each app.

> [card] [ChatGPT](https://fal.ai/docs/documentation/setting-up/mcp/chatgpt.md)
>
> Install the fal plugin and connect your account

> [card] [Claude](https://fal.ai/docs/documentation/setting-up/mcp/claude.md)
>
> Add a connector and sign in through your browser

> [card] [Grok Bot](https://fal.ai/docs/documentation/setting-up/mcp/grok-bot.md)
>
> Add the fal plugin and sign in through your browser

> [card] [Replit](https://fal.ai/docs/documentation/setting-up/mcp/replit.md)
>
> Open the install link and sign in

> [card] [Muse and Instinct](https://fal.ai/docs/documentation/setting-up/mcp/chat-agents.md)
>
> Ask the agent in chat to add fal

> [card] [Other tools](https://fal.ai/docs/documentation/setting-up/mcp/other-clients.md)
>
> Copy the URL into a Streamable HTTP and OAuth client

> [card] [genmedia CLI](https://fal.ai/docs/documentation/setting-up/genmedia.md)
>
> A separate terminal connection using a local API key
