Skip to content

run_command passes HTTP kwargs to stdio transport when transport is unspecified #3844

@strawgate

Description

@strawgate

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. Reports of errors, unexpected behavior, or broken functionality.cliRelated to FastMCP CLI commands (run, dev, install) or CLI functionality.httpRelated to HTTP transport, networking, or web server functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions