mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 05:24:18 +02:00
Expose stateless_http kwarg
This commit is contained in:
parent
edbf0ae816
commit
5d3d97b220
1 changed files with 9 additions and 1 deletions
|
|
@ -1342,6 +1342,7 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
path: str | None = None,
|
||||
uvicorn_config: dict[str, Any] | None = None,
|
||||
middleware: list[ASGIMiddleware] | None = None,
|
||||
stateless_http: bool | None = None,
|
||||
) -> None:
|
||||
"""Run the server using HTTP transport.
|
||||
|
||||
|
|
@ -1352,6 +1353,8 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
log_level: Log level for the server (defaults to settings.log_level)
|
||||
path: Path for the endpoint (defaults to settings.streamable_http_path or settings.sse_path)
|
||||
uvicorn_config: Additional configuration for the Uvicorn server
|
||||
middleware: A list of middleware to apply to the app
|
||||
stateless_http: Whether to use stateless HTTP (defaults to settings.stateless_http)
|
||||
"""
|
||||
host = host or self._deprecated_settings.host
|
||||
port = port or self._deprecated_settings.port
|
||||
|
|
@ -1359,7 +1362,12 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
log_level or self._deprecated_settings.log_level
|
||||
).lower()
|
||||
|
||||
app = self.http_app(path=path, transport=transport, middleware=middleware)
|
||||
app = self.http_app(
|
||||
path=path,
|
||||
transport=transport,
|
||||
middleware=middleware,
|
||||
stateless_http=stateless_http,
|
||||
)
|
||||
|
||||
_uvicorn_config_from_user = uvicorn_config or {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue