Skip to content

Commit 3bc819f

Browse files
authored
Weather server missing main function
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 <module> 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.
1 parent dfc9247 commit 3bc819f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

weather-server-python/weather.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ async def get_forecast(latitude: float, longitude: float) -> str:
8989

9090
return "\n---\n".join(forecasts)
9191

92-
if __name__ == "__main__":
92+
def main():
9393
# Initialize and run the server
94-
mcp.run(transport='stdio')
94+
mcp.run(transport='stdio')
95+
96+
if __name__ == "__main__":
97+
main()

0 commit comments

Comments
 (0)