Replace FastMCP.as_proxy() with create_proxy() function (#2829)

This commit is contained in:
Jeremiah Lowin 2026-01-10 11:39:06 -05:00 committed by GitHub
commit 3163e61ee4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 341 additions and 124 deletions

View file

@ -46,13 +46,13 @@ server2 = FastMCP("Server2", providers=[provider])
### ProxyProvider
`ProxyProvider` (`src/fastmcp/server/providers/proxy.py`) proxies components from remote MCP servers via a client factory. Used by `FastMCP.as_proxy()` and `FastMCP.mount()` for remote server integration.
`ProxyProvider` (`src/fastmcp/server/providers/proxy.py`) proxies components from remote MCP servers via a client factory. Used by `create_proxy()` and `FastMCP.mount()` for remote server integration.
```python
from fastmcp import FastMCP
from fastmcp.server import create_proxy
# Create proxy to remote server
server = FastMCP.as_proxy("http://remote-server/mcp")
server = create_proxy("http://remote-server/mcp")
```
### OpenAPIProvider