From 3bc819fff8f696af43dd58d244d1eeef1413577e Mon Sep 17 00:00:00 2001 From: datashaman Date: Thu, 4 Sep 2025 06:16:24 +0200 Subject: [PATCH] Weather server missing main function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The weather server script does not run. ``` ❯ uv run weather Traceback (most recent call last): File "/projects/quickstart-resources/weather-server-python/.venv/bin/weather", line 4, in from weather import main ImportError: cannot import name 'main' from 'weather' (/projects/quickstart-resources/weather-server-python/weather.py) ``` The script definition in `pyproject.toml` is looking for a `main` function which does not exist. --- weather-server-python/weather.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weather-server-python/weather.py b/weather-server-python/weather.py index 74a3015..5822b4e 100644 --- a/weather-server-python/weather.py +++ b/weather-server-python/weather.py @@ -89,6 +89,9 @@ Forecast: {period['detailedForecast']} return "\n---\n".join(forecasts) -if __name__ == "__main__": +def main(): # Initialize and run the server - mcp.run(transport='stdio') + mcp.run(transport='stdio') + +if __name__ == "__main__": + main()