Remove deprecated proxy creation (#1186)

This commit is contained in:
Jeremiah Lowin 2025-07-19 13:37:46 -04:00 committed by GitHub
commit 1c20ad77c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1662,8 +1662,7 @@ class FastMCP(Generic[LifespanResultT]):
resource_separator: Deprecated. Separator character for resource URIs.
prompt_separator: Deprecated. Separator character for prompt names.
"""
from fastmcp.client.transports import FastMCPTransport
from fastmcp.server.proxy import FastMCPProxy, ProxyClient
from fastmcp.server.proxy import FastMCPProxy
# Deprecated since 2.9.0
# Prior to 2.9.0, the first positional argument was the prefix and the
@ -1715,7 +1714,7 @@ class FastMCP(Generic[LifespanResultT]):
as_proxy = server._has_lifespan
if as_proxy and not isinstance(server, FastMCPProxy):
server = FastMCPProxy(ProxyClient(transport=FastMCPTransport(server)))
server = FastMCP.as_proxy(server)
# Delegate mounting to all three managers
mounted_server = MountedServer(