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
31 changes: 0 additions & 31 deletions src/fastmcp/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2081,37 +2081,6 @@ async def run_sse_async(
uvicorn_config=uvicorn_config,
)

def sse_app(
self,
path: str | None = None,
message_path: str | None = None,
middleware: list[ASGIMiddleware] | None = None,
) -> StarletteWithLifespan:
"""
Create a Starlette app for the SSE server.

Args:
path: The path to the SSE endpoint
message_path: The path to the message endpoint
middleware: A list of middleware to apply to the app
"""
# Deprecated since 2.3.2
if fastmcp.settings.deprecation_warnings:
warnings.warn(
"The sse_app method is deprecated (as of 2.3.2). Use http_app as a modern (non-SSE) "
"alternative, or call `fastmcp.server.http.create_sse_app` directly.",
DeprecationWarning,
stacklevel=2,
)
return create_sse_app(
server=self,
message_path=message_path or self._deprecated_settings.message_path,
sse_path=path or self._deprecated_settings.sse_path,
auth=self.auth,
debug=self._deprecated_settings.debug,
middleware=middleware,
)

def streamable_http_app(
self,
path: str | None = None,
Expand Down
2 changes: 1 addition & 1 deletion tests/client/test_sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from fastmcp.client import Client
from fastmcp.client.transports import SSETransport
from fastmcp.server.dependencies import get_http_request
from fastmcp.server.http import create_sse_app
from fastmcp.server.server import FastMCP
from fastmcp.utilities.tests import run_server_async

Expand Down Expand Up @@ -94,7 +95,6 @@ async def nested_sse_server():
from starlette.applications import Starlette
from starlette.routing import Mount

from fastmcp.server.http import create_sse_app
from fastmcp.utilities.http import find_available_port

server = create_test_server()
Expand Down
9 changes: 0 additions & 9 deletions tests/deprecated/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@ def test_deprecation_warnings_setting_false(self):
mcp.settings


def test_sse_app_deprecation_warning():
"""Test that sse_app raises a deprecation warning."""
server = FastMCP("TestServer")

with pytest.warns(DeprecationWarning, match="The sse_app method is deprecated"):
app = server.sse_app()
assert isinstance(app, Starlette)


def test_streamable_http_app_deprecation_warning():
"""Test that streamable_http_app raises a deprecation warning."""
server = FastMCP("TestServer")
Expand Down
Loading