mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-20 20:44:17 +02:00
Remove deprecated streamable_http_app method (#2336)
This commit is contained in:
parent
b78ed5a9a8
commit
cdbe4d9a1d
2 changed files with 0 additions and 32 deletions
|
|
@ -2053,27 +2053,6 @@ class FastMCP(Generic[LifespanResultT]):
|
|||
|
||||
await server.serve()
|
||||
|
||||
def streamable_http_app(
|
||||
self,
|
||||
path: str | None = None,
|
||||
middleware: list[ASGIMiddleware] | None = None,
|
||||
) -> StarletteWithLifespan:
|
||||
"""
|
||||
Create a Starlette app for the StreamableHTTP server.
|
||||
|
||||
Args:
|
||||
path: The path to the StreamableHTTP endpoint
|
||||
middleware: A list of middleware to apply to the app
|
||||
"""
|
||||
# Deprecated since 2.3.2
|
||||
if fastmcp.settings.deprecation_warnings:
|
||||
warnings.warn(
|
||||
"The streamable_http_app method is deprecated (as of 2.3.2). Use http_app() instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
return self.http_app(path=path, middleware=middleware)
|
||||
|
||||
def http_app(
|
||||
self,
|
||||
path: str | None = None,
|
||||
|
|
|
|||
|
|
@ -32,17 +32,6 @@ class TestDeprecationWarningsSetting:
|
|||
mcp.settings
|
||||
|
||||
|
||||
def test_streamable_http_app_deprecation_warning():
|
||||
"""Test that streamable_http_app raises a deprecation warning."""
|
||||
server = FastMCP("TestServer")
|
||||
|
||||
with pytest.warns(
|
||||
DeprecationWarning, match="The streamable_http_app method is deprecated"
|
||||
):
|
||||
app = server.streamable_http_app()
|
||||
assert isinstance(app, Starlette)
|
||||
|
||||
|
||||
def test_http_app_with_sse_transport():
|
||||
"""Test that http_app with SSE transport works (no warning)."""
|
||||
server = FastMCP("TestServer")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue