-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (27 loc) · 767 Bytes
/
main.py
File metadata and controls
34 lines (27 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
fal.ai MCP Server : Main entry point
This module sets up and runs the fal.ai MCP server,
providing tools to interact with fal.ai models and services.
"""
import os
import sys
from fastmcp import FastMCP
from api.models import register_model_tools
from api.generate import register_generation_tools
from api.storage import register_storage_tools
from api.config import get_api_key, SERVER_NAME, SERVER_DESCRIPTION, SERVER_VERSION, SERVER_DEPENDENCIES
mcp = FastMCP(SERVER_NAME)
register_model_tools(mcp)
register_generation_tools(mcp)
register_storage_tools(mcp)
def main():
try:
get_api_key()
except ValueError:
pass
try:
mcp.run()
except Exception as e:
sys.exit(1)
if __name__ == "__main__":
main()