Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/fastmcp/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 0 additions & 18 deletions tests/deprecated/test_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import warnings
from unittest.mock import AsyncMock, patch

import pytest
from starlette.applications import Starlette
Expand Down Expand Up @@ -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")
Expand Down
Loading