When transport is not explicitly passed (stays None), run_command in cli/run.py forwards HTTP-specific kwargs like port and host to server.run_async(). run_async resolves None transport to settings.transport (default "stdio"), then passes these kwargs to run_stdio_async which doesn't accept them, causing TypeError.
Introduced in #3833 when if port: was changed to if port is not None: — the old truthiness check happened to filter out port=0 but also prevented any port from reaching stdio.
The fix needs to resolve the effective transport before deciding which kwargs to forward.
🤖 Generated with Claude Code
When
transportis not explicitly passed (staysNone),run_commandincli/run.pyforwards HTTP-specific kwargs likeportandhosttoserver.run_async().run_asyncresolvesNonetransport tosettings.transport(default"stdio"), then passes these kwargs torun_stdio_asyncwhich doesn't accept them, causingTypeError.Introduced in #3833 when
if port:was changed toif port is not None:— the old truthiness check happened to filter out port=0 but also prevented any port from reaching stdio.The fix needs to resolve the effective transport before deciding which kwargs to forward.
🤖 Generated with Claude Code