diff --git a/src/fastmcp/server/server.py b/src/fastmcp/server/server.py index 70d00b7bd8..eda3d62dfd 100644 --- a/src/fastmcp/server/server.py +++ b/src/fastmcp/server/server.py @@ -2053,34 +2053,6 @@ async def run_http_async( await server.serve() - async def run_sse_async( - self, - host: str | None = None, - port: int | None = None, - log_level: str | None = None, - path: str | None = None, - uvicorn_config: dict[str, Any] | None = None, - ) -> None: - """Run the server using SSE transport.""" - - # Deprecated since 2.3.2 - if fastmcp.settings.deprecation_warnings: - warnings.warn( - "The run_sse_async method is deprecated (as of 2.3.2). Use run_http_async for a " - "modern (non-SSE) alternative, or create an SSE app with " - "`fastmcp.server.http.create_sse_app` and run it directly.", - DeprecationWarning, - stacklevel=2, - ) - await self.run_http_async( - transport="sse", - host=host, - port=port, - log_level=log_level, - path=path, - uvicorn_config=uvicorn_config, - ) - def streamable_http_app( self, path: str | None = None, diff --git a/tests/deprecated/test_deprecated.py b/tests/deprecated/test_deprecated.py index 4f60579ec7..ec9ce4e239 100644 --- a/tests/deprecated/test_deprecated.py +++ b/tests/deprecated/test_deprecated.py @@ -1,5 +1,4 @@ import warnings -from unittest.mock import AsyncMock, patch import pytest from starlette.applications import Starlette @@ -44,23 +43,6 @@ def test_streamable_http_app_deprecation_warning(): assert isinstance(app, Starlette) -async def test_run_sse_async_deprecation_warning(): - """Test that run_sse_async raises a deprecation warning.""" - server = FastMCP("TestServer") - - # Use patch to avoid actually running the server - with patch.object(server, "run_http_async", new_callable=AsyncMock) as mock_run: - with pytest.warns( - DeprecationWarning, match="The run_sse_async method is deprecated" - ): - await server.run_sse_async() - - # Verify the mock was called with the right transport - mock_run.assert_called_once() - call_kwargs = mock_run.call_args.kwargs - assert call_kwargs.get("transport") == "sse" - - def test_http_app_with_sse_transport(): """Test that http_app with SSE transport works (no warning).""" server = FastMCP("TestServer")