Jeremiah Lowin commited on
Commit
6d04c2c
·
unverified ·
1 Parent(s): 23b21a0

Remove deprecated proxy creation (#1186)

Browse files
Files changed (1) hide show
  1. src/fastmcp/server/server.py +2 -3
src/fastmcp/server/server.py CHANGED
@@ -1662,8 +1662,7 @@ class FastMCP(Generic[LifespanResultT]):
1662
  resource_separator: Deprecated. Separator character for resource URIs.
1663
  prompt_separator: Deprecated. Separator character for prompt names.
1664
  """
1665
- from fastmcp.client.transports import FastMCPTransport
1666
- from fastmcp.server.proxy import FastMCPProxy, ProxyClient
1667
 
1668
  # Deprecated since 2.9.0
1669
  # Prior to 2.9.0, the first positional argument was the prefix and the
@@ -1715,7 +1714,7 @@ class FastMCP(Generic[LifespanResultT]):
1715
  as_proxy = server._has_lifespan
1716
 
1717
  if as_proxy and not isinstance(server, FastMCPProxy):
1718
- server = FastMCPProxy(ProxyClient(transport=FastMCPTransport(server)))
1719
 
1720
  # Delegate mounting to all three managers
1721
  mounted_server = MountedServer(
 
1662
  resource_separator: Deprecated. Separator character for resource URIs.
1663
  prompt_separator: Deprecated. Separator character for prompt names.
1664
  """
1665
+ from fastmcp.server.proxy import FastMCPProxy
 
1666
 
1667
  # Deprecated since 2.9.0
1668
  # Prior to 2.9.0, the first positional argument was the prefix and the
 
1714
  as_proxy = server._has_lifespan
1715
 
1716
  if as_proxy and not isinstance(server, FastMCPProxy):
1717
+ server = FastMCP.as_proxy(server)
1718
 
1719
  # Delegate mounting to all three managers
1720
  mounted_server = MountedServer(