Update mcp_server.py
Browse files- mcp_server.py +2 -17
mcp_server.py
CHANGED
@@ -14,23 +14,8 @@ from mcp.server.fastmcp import FastMCP
|
|
14 |
mcp = FastMCP("modal_flux_testing", timeout=500)
|
15 |
|
16 |
# Global variables to store secrets
|
17 |
-
MODAL_API_URL =
|
18 |
-
MISTRAL_API_KEY =
|
19 |
-
|
20 |
-
def initialize(modal_url, mistral_key):
|
21 |
-
global MODAL_API_URL, MISTRAL_API_KEY
|
22 |
-
MODAL_API_URL = modal_url
|
23 |
-
MISTRAL_API_KEY = mistral_key
|
24 |
-
print(f"Initialized with Modal URL: {modal_url}")
|
25 |
-
print(f"Mistral API Key: {'✓' if mistral_key else '✗'}")
|
26 |
-
|
27 |
-
def your_api_function():
|
28 |
-
if not MISTRAL_API_KEY:
|
29 |
-
raise ValueError("MISTRAL_API_KEY not initialized")
|
30 |
-
|
31 |
-
# Use MISTRAL_API_KEY and MODAL_API_URL here
|
32 |
-
return "Success"
|
33 |
-
|
34 |
MISTRAL_API_URL = "https://api.mistral.ai/v1/chat/completions"
|
35 |
|
36 |
# Social Media Size Presets
|
|
|
14 |
mcp = FastMCP("modal_flux_testing", timeout=500)
|
15 |
|
16 |
# Global variables to store secrets
|
17 |
+
MODAL_API_URL = os.getenv('MODAL_API_URL',"https://rajkumarcmppl--flux-api-server-fastapi-server.modal.run")
|
18 |
+
MISTRAL_API_KEY = os.getenv("MISTRAL_API_KEY","DRdpSRosSmwjj62cbdb3b04xjaPrMKpa")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
MISTRAL_API_URL = "https://api.mistral.ai/v1/chat/completions"
|
20 |
|
21 |
# Social Media Size Presets
|