dbenham2 Claude Sonnet 4.6 commited on
Commit
c6872da
·
1 Parent(s): 26d2110

Fix FastMCP SSE transport host/port configuration

Browse files

Move 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>

Files changed (1) hide show
  1. 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", host="0.0.0.0", port=8000)
 
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")