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
17 changes: 0 additions & 17 deletions src/fastmcp/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -2483,23 +2483,6 @@ def proxy_client_factory():

return FastMCPProxy(client_factory=client_factory, **settings)

@classmethod
def from_client(
cls, client: Client[ClientTransportT], **settings: Any
) -> FastMCPProxy:
"""
Create a FastMCP proxy server from a FastMCP client.
"""
# Deprecated since 2.3.5
if fastmcp.settings.deprecation_warnings:
warnings.warn(
"FastMCP.from_client() is deprecated; use FastMCP.as_proxy() instead.",
DeprecationWarning,
stacklevel=2,
)

return cls.as_proxy(client, **settings)

def _should_enable_component(
self,
component: FastMCPComponent,
Expand Down
9 changes: 1 addition & 8 deletions tests/deprecated/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from starlette.applications import Starlette

from fastmcp import Client, FastMCP
from fastmcp import FastMCP
from fastmcp.utilities.tests import temporary_settings

# reset deprecation warnings for this module
Expand Down Expand Up @@ -46,10 +46,3 @@ def test_http_app_with_sse_transport():
w for w in recorded_warnings if issubclass(w.category, DeprecationWarning)
]
assert len(deprecation_warnings) == 0


def test_from_client_deprecation_warning():
"""Test that FastMCP.from_client raises a deprecation warning."""
server = FastMCP("TestServer")
with pytest.warns(DeprecationWarning, match="from_client"):
FastMCP.from_client(Client(server))
Loading