Skip to content

fix: don't pass HTTP kwargs when transport is unspecified#3838

Merged
jlowin merged 1 commit intomainfrom
fix/run-command-stdio-kwargs
Apr 12, 2026
Merged

fix: don't pass HTTP kwargs when transport is unspecified#3838
jlowin merged 1 commit intomainfrom
fix/run-command-stdio-kwargs

Conversation

@strawgate
Copy link
Copy Markdown
Collaborator

@strawgate strawgate commented Apr 11, 2026

Follow-up to #3833. When transport is None (the default), run_async resolves it to settings.transport which defaults to "stdio". The guard from #3833 used transport != "stdio" which is True for None, so HTTP-specific kwargs like port=0 leaked into run_stdio_async and caused TypeError.

The fix resolves the effective transport from fastmcp.settings.transport before deciding which kwargs to forward.

Fixes #3844

🤖 Generated with Claude Code

@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. server Related to FastMCP server implementation or server-side functionality. http Related to HTTP transport, networking, or web server functionality. labels Apr 11, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d14193ebcd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/fastmcp/cli/run.py Outdated
When transport is None (the default), run_async resolves it to
settings.transport which defaults to "stdio". The previous guard
`transport != "stdio"` passed HTTP kwargs through for None transport,
causing TypeError in run_stdio_async.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@strawgate strawgate force-pushed the fix/run-command-stdio-kwargs branch from d14193e to 95b3a68 Compare April 11, 2026 17:59
Copy link
Copy Markdown
Member

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct follow-up to #3833 — resolve effective transport from settings before deciding whether to forward HTTP kwargs.

@jlowin jlowin merged commit 74797c8 into main Apr 12, 2026
9 of 10 checks passed
@jlowin jlowin deleted the fix/run-command-stdio-kwargs branch April 12, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. http Related to HTTP transport, networking, or web server functionality. server Related to FastMCP server implementation or server-side functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run_command passes HTTP kwargs to stdio transport when transport is unspecified

2 participants