Skip to content

fix: add proxy timeouts and modernize networking in apps dev#3741

Merged
jlowin merged 6 commits intoPrefectHQ:mainfrom
mateeaaaaaaa:main
Apr 5, 2026
Merged

fix: add proxy timeouts and modernize networking in apps dev#3741
jlowin merged 6 commits intoPrefectHQ:mainfrom
mateeaaaaaaa:main

Conversation

@mateeaaaaaaa
Copy link
Copy Markdown
Contributor

Description

This PR improves the stability and security of the fastmcp dev apps server by addressing potential resource hangs and modernizing network calls:

  1. Added Default Timeout: Added a 60s default timeout to the httpx.AsyncClient in the proxy_mcp handler. Previously, it used timeout=None, which could cause the dev server to hang indefinitely if the backend MCP server was unresponsive.
  2. Modernized SDK Fetching: Replaced urllib.request.urlopen with httpx.Client for fetching SDK assets from NPM and esm.sh. This ensures consistency with the project's preferred HTTP library and provides better handling of redirects and connection pooling.

Closes #

Contribution type

  • Bug fix (simple, well-scoped fix for a clearly broken behavior)
  • Documentation improvement
  • Enhancement (maintainers typically implement enhancements — see CONTRIBUTING.md)

Checklist

  • This PR addresses an existing issue (or fixes a self-evident bug)
  • I have read CONTRIBUTING.md
  • I have added tests that cover my changes
  • I have run uv run prek run --all-files and all checks pass
  • I have self-reviewed my changes
  • If I used an LLM, it followed the repo's contributing conventions (not generic output)

@marvin-context-protocol marvin-context-protocol bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality. mcp apps Related to MCP Apps - user-facing applications with frontend bundles served by MCP servers. http Related to HTTP transport, networking, or web server functionality. labels Apr 1, 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: 40a214113d

ℹ️ 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".

@mateeaaaaaaa
Copy link
Copy Markdown
Contributor Author

@codex review

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: d37ab6e225

ℹ️ 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".

@mateeaaaaaaa
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

ℹ️ 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".

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.

Looks good — proxy timeout is a nice improvement, and the httpx migration is clean.

@jlowin jlowin merged commit 34e632d into PrefectHQ:main Apr 5, 2026
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. cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality. http Related to HTTP transport, networking, or web server functionality. mcp apps Related to MCP Apps - user-facing applications with frontend bundles served by MCP servers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants