How to integrate Fal.ai MCP with Codex

Connect Codex to Fal.ai MCP. Generate a photorealistic portrait of a cat, create a 15-second ai-generated promo video, and more using natural language, with authentication handled for you.

Fal.ai logoFal.ai
Api Key

Fal.ai is a generative media platform offering 600+ AI models for images, video, voice, and audio. Developers use Fal.ai for fast, scalable access to cutting-edge generative AI tools.

13 Tools

Introduction

Codex is one of the most popular coding harnesses out there. And MCP makes the experience even better. With the Fal.ai MCP integration, Codex can run AI models, submit async inference jobs, check queue status and results, upload input files, and estimate pricing, all without leaving the terminal or the app, whichever you prefer.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate Fal.ai with

Why use Composio?

Apart from a managed and hosted MCP server, you will get:

  • CodeAct: A dedicated workbench that allows GPT to write its code to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
  • Large tool responses: Handle them to minimise context rot.
  • Dynamic just-in-time access to 20,000 tools across 1700+ other Apps for cross-app workflows. It loads the tools you need, so GPTs aren't overwhelmed by tools you don't need.

How to install Fal.ai MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

Try it

Ask Codex for a Fal.ai task. The first time, Composio asks you to connect your Fal.ai account.

For example, ask it to:

  • "Generate a photorealistic portrait of a cat"
  • "Create a 15-second AI-generated promo video"
  • "Synthesize an audio clip saying 'Welcome home!'"

What is the Fal.ai MCP server, and what's possible with it?

The Fal.ai MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Fal.ai account. It provides structured and secure access to generative media models, input files, pricing, and inference jobs, so your agent can discover models, generate media, upload source files, monitor jobs, and estimate costs on your behalf.

  • Model discovery: Have your agent search available Fal.ai models to find suitable options for generating images, videos, voice, audio, and other media.
  • Media generation: Direct your agent to run a model and generate new content, with completed files returned through Fal.ai-hosted links.
  • Input file uploads: Let the agent upload images, audio, or video for use as source material in supported generation tasks.
  • Job tracking and control: Instruct your agent to submit longer generation jobs, follow their progress, retrieve completed results, or cancel requests that are no longer needed.
  • Pricing checks: Have your agent retrieve model pricing or estimate the cost of a planned generation before starting it.

Conclusion

You've successfully integrated Fal.ai with Codex using Composio's MCP server. Now you can interact with Fal.ai directly from your terminal, VS Code, or the Codex App using natural language commands.

Key benefits of this setup:

  • Seamless integration across CLI, VS Code, and standalone app
  • Natural language commands for Fal.ai operations
  • Managed authentication through Composio
  • Access to 20,000+ tools across 1700+ apps for cross-app workflows
  • CodeAct workbench for complex tool chaining

Next steps:

  • Try asking Codex to perform various Fal.ai operations
  • Explore cross-app workflows by connecting more toolkits
  • Build automation scripts that leverage Codex's AI capabilities
TOOLS

Supported Tools

Every Fal.ai action and event your agent gets out of the box.

Cancel Queue Request

Request cancellation of a queued or in-progress fal.ai job using your own fal account.

Estimate Pricing

Estimate expected costs for API calls or unit-based usage across one or more fal.ai model endpoints using your own fal account.

Get JWKS for Webhook Verification

Retrieve the JSON Web Key Set used for fal.ai webhook signature verification using your own fal account.

Get Models

Discover and search fal.ai model endpoints using your own fal account.

Get Model Pricing

Retrieve unit pricing for specific fal.ai model endpoints using your own fal account, including unit price, billing unit and currency.

Get Queue Request Result

Tool to retrieve the final result of a completed queue request.

List Model Requests

List recent fal.ai model requests with filters and cursor pagination using your own fal account.

Check Queue Request Status

Check the status of a queued fal.ai request using your own fal account.

Stream Request Status Updates

Collect SSE status updates for a queued fal.ai request using your own fal account.

Run Model (Sync)

Run a fal.ai model synchronously using your own fal account and return its model-specific output.

Submit Async Inference Job

Start image, text-to-video, image-to-video or 3D generation and return a job ID immediately.

Subscribe to Async Inference Job

Submit a fal.ai inference job using your own fal account, poll until it completes or the wait deadline is reached, and return the final result.

Upload Input File

Upload an input media file to fal.ai storage using your own fal account and return its access URL for use as a model input.

FAQ

Frequently asked questions

Start with Fal.ai.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Fal.ai tool your agent needs.Free to start.

Start building