π The fast, Pythonic way to build MCP servers and clients.
fix: don't pass HTTP kwargs to run_async when transport is unspecified (#3838)
Bill Easton74797c8cac40
diff --git a/src/fastmcp/cli/run.py b/src/fastmcp/cli/run.pyindex 9adedf657..9c39a5dbd 100644--- a/src/fastmcp/cli/run.py+++ b/src/fastmcp/cli/run.py@@ -15,6 +15,7 @@ from typing import Any, Literalfrom mcp.server.fastmcp import FastMCP as FastMCP1xfrom watchfiles import Change, awatch+import fastmcpfrom fastmcp.server.server import FastMCP, create_proxyfrom fastmcp.utilities.logging import get_loggerfrom fastmcp.utilities.mcp_server_config import (@@ -240,8 +241,13 @@ async def run_command(kwargs = {}if transport is not None:kwargs["transport"] = transport- # Only pass HTTP-specific options for non-stdio transports- if transport != "stdio":+ # Resolve effective transport for the HTTP kwargs guard β transport+ # may be None here if the user didn't pass --transport, in which case+ # run_async will resolve it from settings.transport.+ effective_transport = (+ transport if transport is not None else fastmcp.settings.transport+ )+ if effective_transport != "stdio":if host is not None:kwargs["host"] = hostif port is not None: