mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 21:14:17 +02:00
Remove OpenAPI timeout parameter, make client optional, surface timeout errors (#3067)
* Remove OpenAPI timeout param, make client optional, surface timeout errors * Close auto-created httpx client via provider lifespan
This commit is contained in:
parent
fe432de156
commit
5fd41b2e15
7 changed files with 102 additions and 43 deletions
|
|
@ -95,6 +95,19 @@ value = await ctx.get_state("key")
|
|||
|
||||
`FASTMCP_SHOW_CLI_BANNER` is now `FASTMCP_SHOW_SERVER_BANNER`.
|
||||
|
||||
#### OpenAPI `timeout` Parameter Removed
|
||||
|
||||
Configure timeout on the httpx client directly. The `client` parameter is now optional — when omitted, a default client is created from the spec's `servers` URL with a 30-second timeout.
|
||||
|
||||
```python
|
||||
# Before
|
||||
provider = OpenAPIProvider(spec, client, timeout=60)
|
||||
|
||||
# After
|
||||
client = httpx.AsyncClient(base_url="https://api.example.com", timeout=60)
|
||||
provider = OpenAPIProvider(spec, client)
|
||||
```
|
||||
|
||||
#### Metadata Namespace Renamed
|
||||
|
||||
The FastMCP metadata namespace changed from `_fastmcp` to `fastmcp`, and metadata is now always included. The `include_fastmcp_meta` parameter has been removed from `FastMCP()` and `to_mcp_tool()`—remove any usage of this parameter.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue