Fix FastMCP SSE transport host/port configuration
Browse filesMove host and port args to FastMCP constructor — run() does not accept them in the installed version.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- weather_mcp_server.py +2 -2
weather_mcp_server.py
CHANGED
|
@@ -10,7 +10,7 @@ Transport: stdio (default for local use) or SSE for remote.
|
|
| 10 |
import httpx
|
| 11 |
from mcp.server.fastmcp import FastMCP
|
| 12 |
|
| 13 |
-
mcp = FastMCP("weather-server")
|
| 14 |
|
| 15 |
|
| 16 |
def _geocode(location: str) -> tuple[float, float, str]:
|
|
@@ -111,4 +111,4 @@ if __name__ == "__main__":
|
|
| 111 |
mcp.run(transport="stdio")
|
| 112 |
else:
|
| 113 |
# SSE — persistent server, used in Docker
|
| 114 |
-
mcp.run(transport="sse"
|
|
|
|
| 10 |
import httpx
|
| 11 |
from mcp.server.fastmcp import FastMCP
|
| 12 |
|
| 13 |
+
mcp = FastMCP("weather-server", host="0.0.0.0", port=8000)
|
| 14 |
|
| 15 |
|
| 16 |
def _geocode(location: str) -> tuple[float, float, str]:
|
|
|
|
| 111 |
mcp.run(transport="stdio")
|
| 112 |
else:
|
| 113 |
# SSE — persistent server, used in Docker
|
| 114 |
+
mcp.run(transport="sse")
|