Skip to content

Conversation

@osushinekotan
Copy link

Describe your changes

Added timeout configuration for HTTP requests in FastAPI-MCP. This change introduces a timeout parameter to all relevant functions (create_mcp_tools_from_openapi, create_http_tool, mount_mcp_server, and add_mcp_server), allowing users to customize the timeout setting for HTTP requests made via httpx client. Without this change, all requests were using the httpx default timeout of 5 seconds, which can be insufficient for endpoints performing complex operations.

Issue ticket number and link (if applicable)

#47

Screenshots of the feature / bugfix

Checklist before requesting a review

  • Added relevant tests
  • Run ruff & mypy
  • All tests pass

I verified the functionality manually using Claude Desktop to simulate MCP server calls with different timeout values, and confirmed that the parameters are properly passed through the entire call chain to the httpx client.

@shahar4499
Copy link
Contributor

Closing this since it's irrelevant after the refactor, but as mentioned in the issue, there is a way around this: #47 (comment)

@shahar4499 shahar4499 closed this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants