Skip to content

Honor per-server timeout from MCP config entries - #5760

Closed
CRYPTONIKAV wants to merge 2 commits into
PrefectHQ:mainfrom
CRYPTONIKAV:fix/5754-entry-timeout
Closed

CRYPTONIKAV wants to merge 2 commits into
PrefectHQ:mainfrom
CRYPTONIKAV:fix/5754-entry-timeout

Conversation

@CRYPTONIKAV

Copy link
Copy Markdown
Contributor

The timeout field on RemoteMCPServer and StdioMCPServer config entries was silently dropped: to_transport() never forwarded it, so a config that looks capped actually runs unlimited. This threads it through MCPConfigTransport instead, converting the entry's milliseconds to the session's read_timeout_seconds for single-server configs and per-backend proxy clients in multi-server ones. An unset entry leaves the client default untouched, and timeout: 0 keeps its disabled meaning.

config = {"mcpServers": {"weather": {"url": "https://weather.example.com/mcp", "timeout": 5000}}}
client = Client(config)  # weather leg now capped at 5s

Closes #5754.

�F916 Generated with Claude Code

🤖 Generated with Claude Code
@github-actions

Copy link
Copy Markdown
Contributor

This pull request is awaiting maintainer assignment. Linked PRs stay open while maintainers triage the issue; this check remains failing until assignment.

Per CONTRIBUTING.md, an external PR must reference an issue that's assigned to its author. To get there:

  1. A maintainer will review the issue and decide whether to assign you. Please don't comment just to request assignment.

Once you're assigned and the link is present, this check is re-run automatically. Previously gate-closed PRs also reopen — no further action needed.

Maintainers: reopen this PR or remove the missing-issue-link label to bypass this check.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T04:52:07.476540Z 9a2843d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. client Related to the FastMCP client SDK or client-side functionality. labels Oct 16, 2026

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

Copy link
Copy Markdown
Contributor

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: 9a2843d99b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@BrickerP BrickerP left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approve — clearest fix for #5754, including timeout: 0

This is one of three open PRs for the same bug (#5757, #5758, #5760). Of the three, this one gets the semantics right:

  • config_entry_timeout_seconds returns (is_set, seconds), so a set timeout: 0 overrides the client default and disables the session timeout (None), matching Client / normalize_timeout_to_seconds (“0 means disabled”).
  • Single-server path overrides read_timeout_seconds only when the entry is set; multi-server proxy path applies the same helper.
  • Docs + focused tests for set / unset / override behavior.

Minor nits (non-blocking): the datetime.timedelta branch on the config field looks unused if the schema is ms int/float only; fine to keep for defensive parsing.

I re-requested changes on #5757 for the zero case and will comment on #5758 as a duplicate — maintainers should land one of these and close the other two.

@zzstoatzz

zzstoatzz commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the contribution. #5758 incorporates the ClientGroup timeout fix and preserves CRYPTONIKAV’s co-authorship. It keeps the existing outer-client and backend timeout limits. Closing this overlapping PR.

@zzstoatzz zzstoatzz closed this Oct 20, 2026
@CRYPTONIKAV

Copy link
Copy Markdown
Contributor Author

Thanks for folding the ClientGroup timeout fix into #5758 and preserving co-authorship — closing this one is the right call. Happy to help review further changes in that area.

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. client Related to the FastMCP client SDK or client-side functionality. missing-issue-link

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config entry 'timeout' field is silently ignored (RemoteMCPServer/StdioMCPServer) — no request limit applied

3 participants