Created
November 9, 2025 13:32
-
-
Save samirsaci/a6ce25499619fff44228233f0ac2efdd to your computer and use it in GitHub Desktop.
MCP Server Supply Chain Optimisation - Network py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import httpx | |
| from mcp.server.fastmcp import FastMCP | |
| from models.network_models import LaunchParamsNetwork | |
| import os | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s - %(message)s", | |
| handlers=[ | |
| logging.FileHandler("app.log"), | |
| logging.StreamHandler() | |
| ] | |
| ) | |
| mcp = FastMCP("NetworkServer") | |
| For the input parameters, I have defined a model in a separate file network_models.py | |
| from pydantic import BaseModel | |
| from typing import Optional | |
| class LaunchParamsNetwork(BaseModel): | |
| objective: Optional[str] = 'Production Cost' | |
| max_energy: Optional[float] = 780 | |
| max_water: Optional[float] = 3500 | |
| max_waste: Optional[float] = 0.78 | |
| max_co2prod: Optional[float] = 41 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment