falai-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@falai-mcp-servergenerate an image using stable-diffusion-xl with prompt 'a serene lake at sunset'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
falai-mcp-server
A FastMCP server that exposes core fal.ai model API operations (model catalogue, search, schema retrieval, inference, queue management, CDN uploads). The server can run locally over STDIO or remotely via the Streamable HTTP transport, and now ships with Docker support for easier deployment.
Your browser does not support the video tag.
Quick Start
PyPI Installation (Recommended)
pip install falai-mcp-toolsAfter installation, you can run the server with:
falai-mcpManual Installation
Clone the repository:
git clone https://github.com/berkbirkan/falai-mcp.git cd falai-mcpCreate and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall the project in editable mode:
pip install -e .
Requirements
Python 3.10 or newer
A fal.ai API key: either
FAL_KEYor theFAL_KEY_ID/FAL_KEY_SECRETpairDocker (optional, only if you prefer containerized execution)
Configuration
Environment variables (prefixed with FALAI_) control runtime behaviour:
Variable | Description |
| fal.ai credentials (required for live API calls) |
| Comma-separated list of explicit model IDs to expose |
| Comma-separated keywords to pre-filter models when no explicit list is provided |
| HTTP timeout (seconds) for fal.ai requests (default: |
| Set to |
| Bind address and port when HTTP transport is enabled (defaults: |
If you prefer a .env file, place it next to the project root (or mount it into the container) and load it before running the server.
Clients can override credentials and model filters per MCP session through the
configuretool. Environment variables supply defaults when the client does not set overrides.
Usage
Local STDIO usage
Ensure your virtual environment is active and credentials are exported:
export FAL_KEY=sk_live_...Run the server with the default STDIO transport:
falai-mcpLeave the process running; configure your MCP client (Claude, Cursor, etc.) to launch this command via STDIO (see the client integration section).
Remote HTTP usage
Export credentials and enable the HTTP transport:
export FAL_KEY=sk_live_... export FALAI_ENABLE_HTTP=true export FALAI_HTTP_PORT=8080 # optional overrideStart the server so it listens on the configured host/port:
falai-mcpConfirm the HTTP transport is reachable (for example with
curl -I http://localhost:8080/mcp/). Clients should connect tohttp://<host>:<port>/mcp/.
Docker Usage
Build the container image:
docker build -t falai-mcp .Run the container with HTTP enabled and publish the port:
docker run \ --rm \ -e FAL_KEY=sk_live_... \ -e FALAI_ENABLE_HTTP=true \ -e FALAI_HTTP_PORT=8080 \ -p 8080:8080 \ falai-mcpThe MCP endpoint is now available at
http://localhost:8080/mcp/.
Client integrations
Below are example configurations for popular MCP clients. Adjust paths, environment variables, and identifiers to match your setup.
Claude Desktop
Claude Desktop keeps its configuration in ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on your platform.
STDIO (local process)
{ "mcpServers": { "falai-local": { "command": "falai-mcp", "args": [], "env": { "FAL_KEY": "sk_live_..." } } } }Restart Claude Desktop after saving changes. Claude will spawn
falai-mcpand communicate over STDIO.Remote HTTP server
{ "mcpServers": { "falai-remote": { "transport": { "type": "http", "url": "http://localhost:8080/mcp/" } } } }
Cursor
Cursor reads MCP configuration from ~/.cursor/mcp.json.
STDIO (local process)
{ "clients": { "falai-local": { "command": "falai-mcp", "args": [], "env": { "FAL_KEY": "sk_live_..." } } } }Remote HTTP server
{ "clients": { "falai-remote": { "transport": { "type": "http", "url": "http://localhost:8080/mcp/" } } } }
After editing mcp.json, restart Cursor (or reload MCP connections) to pick up the new configuration.
Available tools
Tool | Description |
| Override credentials and access scope for the active session |
| List available models with optional pagination |
| Search the model catalogue using space-separated keywords |
| Retrieve the OpenAPI schema for a model |
| Run synchronous or queued inference |
| Fetch the result of a queued request |
| Check the status (optionally with logs) of a queued request |
| Cancel a queued request |
| Upload a local file to fal.ai CDN |
All tools enforce any configured allow-list and respect per-session overrides from the configure tool.
Development
Building for PyPI
Install build tools:
pip install build twineBuild the package:
python -m buildUpload to PyPI (test first with TestPyPI):
# Test upload python -m twine upload --repository testpypi dist/* # Production upload python -m twine upload dist/*
Notes
Schema retrieval and queue inspection require valid fal.ai credentials; errors appear as MCP tool errors if credentials are missing or invalid.
Model discovery falls back to the bundled
fal-clientendpoint catalogue when fal.ai's public APIs are unavailable.When running remotely, ensure network access between the client and the MCP server (open firewall ports, configure TLS or reverse proxies if needed).
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/berkbirkan/falai-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server