simple-fal-mcp

simple-fal-mcp

MCP server for fal model discovery, execution, pricing, and local media processing, enabling AI model workflows via natural language.

Category
访问服务器

README

simple-fal-mcp

Model Context Protocol (MCP) server for Codex and Claude Code with fal model discovery, execution, pricing, request follow-up, temp workspaces, and local media post-process.

Current scope:

  • normal fal model endpoints only
  • queue and sync execution
  • image, video, and audio generation workflows
  • local temp workspace management and media finishing
  • no realtime/websocket flows in v1

Conceptual fal MCP visual

Tools

  • fal_status: always available; returns config/auth/capability state, setup-web state, media availability, saved cursors, and workspace summary.
  • fal_setup_web: local setup panel controller with actions status, start, stop.
  • fal_model: model discovery tool with actions search, next, get, pricing, estimate.
  • fal_cost: pricing/cost tool with actions price, estimate, usage, usage_next, request.
  • fal_run: submits one model run, supports local-file uploads, and saves request state in a temp workspace.
  • fal_request: request follow-up tool with actions status, wait, result, materialize, cancel, history, history_next.
  • fal_workspace: local workspace manager with actions list, get, delete, cleanup.
  • fal_media: local media tool with actions inspect, open, reveal, image_convert, image_resize, video_convert, video_trim, video_reverse, video_concat, image_sequence_to_video, extract_frame, mux_audio, audio_convert, audio_reverse, audio_concat.

Quick flow examples:

  • fal_model({ "action": "search", "query": "kling image to video" })
  • fal_model({ "action": "get", "endpointId": "fal-ai/kling-video/o1/standard/image-to-video", "schemaMode": "summary" })
  • fal_run({ "endpointId": "fal-ai/nano-banana-2", "input": { "prompt": "..." } })
  • fal_request({ "action": "wait", "runId": "..." })
  • fal_media({ "action": "image_resize", "workspaceId": "...", "inputPath": "runs/.../artifacts/01-images-0.png", "width": 1280, "height": 720, "fit": "cover" })

Install (npx)

Requirements:

  • Node >= 20.19.0
  • ffmpeg and ffprobe for video/audio actions

Codex

codex mcp remove simple-fal
codex mcp add simple-fal -- \
  npx -y simple-fal-mcp@latest

Ask your agent to run fal_status, call fal_setup_web with action: "start" if needed, and then send you setupWeb.url.

Optional: pass keys via env when adding:

codex mcp add simple-fal -- \
  --env FAL_KEY="$FAL_KEY" \
  --env FAL_ADMIN_KEY="$FAL_ADMIN_KEY" \
  -- npx -y simple-fal-mcp@latest

Claude Code

claude mcp remove simple-fal
claude mcp add --transport stdio simple-fal -- \
  npx -y simple-fal-mcp@latest

Ask Claude Code to run fal_status, call fal_setup_web with action: "start" if needed, and then share setupWeb.url.

Optional: pass keys via env when adding:

claude mcp add --transport stdio \
  --env FAL_KEY="$FAL_KEY" \
  --env FAL_ADMIN_KEY="$FAL_ADMIN_KEY" \
  simple-fal -- \
  npx -y simple-fal-mcp@latest

How To Use

Think of simple-fal-mcp as your "fal execution layer":

  • discover live models
  • inspect schema before spending money
  • check price or estimate cost
  • run with raw input and optional local-file uploads
  • continue by saved runId or requestId
  • finish outputs locally in a temp workspace

Typical flow

  1. Add the MCP server with the npx install command above.

  2. Ask your agent for setup status:

  • Run fal_status and tell me what is missing.
  1. If needed, ask for the setup link:
  • If setup web is not running, call fal_setup_web with action=start and give me setupWeb.url.
  1. Open the link, save the fal key, and optionally save an admin key. In some clients, you may need to restart the agent process after key changes so all tools see refreshed auth cleanly.

  2. Search and inspect before running:

  • Search fal for a Kling first/last-frame video model.
  • Show me the schema summary and upload pointer hints for this model.
  • Show me the live price and estimate a 5-second run.
  1. Run the model:
  • Submit this fal run and return the request id immediately.
  • Wait for that run and fetch the result when it is done.
  1. Finish locally if needed:
  • Resize this frame to 1280x720 with cover.
  • Mux this audio onto the video.
  • Open the final file.
  1. Clean up later:
  • Show me the last workspace.
  • Clean old fal temp workspaces.

What to ask your agent (examples)

  • Setup:
    • Please configure simple-fal and give me the setup link.
  • Discovery:
    • Find a cheap image-to-video model and show me the schema summary.
  • Pricing:
    • Show me the live price for this endpoint and estimate a 5-second run.
  • Execution:
    • Run this fal endpoint with these local files and save everything to a temp workspace.
  • Follow-up:
    • Wait for my last fal run and fetch the result if it is done.
  • Local media:
    • Resize this image to 1280x720 cover, reverse the final video, and open it.

Copy-Paste For AGENTS.md / CLAUDE.md

You can add explicit usage instructions like this:

If user uses simple-fal-mcp:

1) Setup flow
- Call fal_status.
- If setup is incomplete, call fal_setup_web(action=start) and return setupWeb.url.
- Tell user to open the local setup page and save the key.
- When setup is finished or user asks to close it, call fal_setup_web(action=stop).

2) Discovery and pricing
- Use fal_model(action=search) to find endpoints.
- Use fal_model(action=get, schemaMode=summary) before requesting raw OpenAPI.
- Use fal_cost(action=price) or fal_cost(action=estimate) before expensive runs when useful.

3) Run flow
- Prefer fal_run with wait=submit.
- Use uploadFiles for local files instead of pasting inline data.
- Follow queued runs with fal_request(action=wait|status|result).
- Use fal_request(action=materialize) if the provider run finished but local files are missing.

4) Workspace and media
- Prefer workspace-relative follow-up by runId/workspaceId.
- Use fal_media for local resize/convert/trim/mux/reveal/open steps.
- Keep final files by copying them out of the temp workspace.

5) Safety
- Never expose fal keys, admin keys, or setup tokens in user-visible messages.
- Do not claim realtime/websocket support in v1.

Configuration

Default paths:

  • $XDG_CONFIG_HOME/simple-fal-mcp/config.json
  • $XDG_CONFIG_HOME/simple-fal-mcp/auth.json
  • $XDG_CONFIG_HOME/simple-fal-mcp/state.json
  • or ~/.config/simple-fal-mcp/...

File roles:

  • config.json: runtime defaults and workspace settings
  • auth.json: fal API key and optional admin key
  • state.json: saved cursors, request history state, usage cursor state, and workspace index

Env precedence:

  1. CLI args
  2. environment variables
  3. config/auth/state files

Supported env vars:

  • FAL_KEY
  • FAL_ADMIN_KEY
  • FAL_DEFAULT_WAIT_MS
  • FAL_POLL_INTERVAL_MS
  • FAL_MODEL_SEARCH_LIMIT
  • FAL_ARTIFACT_DOWNLOAD_LIMIT
  • FAL_OBJECT_TTL_SECONDS
  • FAL_DOWNLOAD_OUTPUTS
  • FAL_WORKSPACE_ROOT
  • FAL_WORKSPACE_AUTO_CLEANUP_HOURS
  • FAL_SETUP_WEB_AUTO_STOP_MINUTES

Useful CLI args:

  • --fal-key
  • --fal-admin-key
  • --config
  • --auth
  • --state
  • --setup-host
  • --setup-port
  • --setup-token

Local Workspace Model

Generated outputs are stored under a local temp root by default:

/tmp/simple-fal-mcp/workspaces/<workspace-id>/

Each run gets a directory with:

  • request.json
  • status.json
  • response.json
  • artifacts/

These files are temp state, not permanent storage. If you want to keep an output, copy it out of the workspace.

Local Development

bun install
bun run lint
bun run typecheck
bun run build
bun run self-test

Notes

  • Model discovery and schema inspection use fal’s live APIs instead of a hardcoded local catalog.
  • fal_run defaults to queue mode with wait: "submit" and saves request state locally so later tools can recover by runId.
  • Local uploads are resolved before submit and recorded in run metadata.
  • Provider success and local artifact download are treated separately, so a completed run stays completed even when local mirroring needs a retry.
  • The setup page does not expose the stored fal key or admin key back to the browser after either has been saved.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选