Remove deprecated streamable_http_app method (#2336)

This commit is contained in:
Jeremiah Lowin 2025-11-01 12:46:21 -07:00 committed by GitHub
commit cdbe4d9a1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 32 deletions

View file

@ -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,

View file

@ -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")