From d19166d4bf35fbbf3d32e7030959cbf8b488b51d Mon Sep 17 00:00:00 2001 From: nate nowack Date: Wed, 23 Jul 2025 16:37:57 -0500 Subject: [PATCH] Fix invalid async context manager usage in proxy documentation (#1246) --- docs/servers/proxy.mdx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/servers/proxy.mdx b/docs/servers/proxy.mdx index 83cd24f34..bf648ae2a 100644 --- a/docs/servers/proxy.mdx +++ b/docs/servers/proxy.mdx @@ -261,18 +261,17 @@ my_server = FastMCP("MyServer") # Get a proxy server proxy = FastMCP.as_proxy("backend_server.py") -# Add mirrored components to your server -async with proxy: - mirrored_tool = await proxy.get_tool("useful_tool") - - # Create a local copy that you can modify - local_tool = mirrored_tool.copy() - - # Add the local copy to your server - my_server.add_tool(local_tool) - - # Now you can disable YOUR copy - local_tool.disable() +# Get mirrored components from proxy +mirrored_tool = await proxy.get_tool("useful_tool") + +# Create a local copy that you can modify +local_tool = mirrored_tool.copy() + +# Add the local copy to your server +my_server.add_tool(local_tool) + +# Now you can disable YOUR copy +local_tool.disable() ```