diff --git a/docs/servers/providers/proxy.mdx b/docs/servers/providers/proxy.mdx index 71a8e0e3b..12db1da5b 100644 --- a/docs/servers/providers/proxy.mdx +++ b/docs/servers/providers/proxy.mdx @@ -408,7 +408,7 @@ gateway = FastMCP( ) ``` -By default the gateway keeps its own `serverInfo`; pass `identity="upstream"` to expose the backend identity. Frontend values win on collisions, and protocol versions, capabilities, cache policy, `resultType`, and unknown top-level fields always remain frontend-owned. If the backend is unavailable, negotiation succeeds without its optional metadata. +By default the gateway keeps its own `serverInfo`; pass `identity="upstream"` to use the backend identity when available. Frontend instructions and `_meta` values win on collisions. The middleware never copies upstream protocol versions, capabilities, cache policy, `resultType`, or unknown top-level fields. If the backend is unavailable, negotiation succeeds without its optional metadata. ### FastMCPProxy Class diff --git a/fastmcp_slim/fastmcp/server/providers/proxy.py b/fastmcp_slim/fastmcp/server/providers/proxy.py index 7199d430c..5f54aeb2a 100644 --- a/fastmcp_slim/fastmcp/server/providers/proxy.py +++ b/fastmcp_slim/fastmcp/server/providers/proxy.py @@ -1048,10 +1048,10 @@ class _NegotiationMetadata: class ProxyMetadataMiddleware(Middleware): """Forward optional negotiation metadata from a ``ProxyProvider`` backend. - Only instructions and namespaced metadata are forwarded, with frontend - values taking precedence. Protocol versions, capabilities, cache policy, - and result type always remain frontend-owned. ``identity`` controls whether - server identity remains the gateway's or is replaced by the backend's. + Instructions and namespaced metadata are forwarded with frontend values + taking precedence. Protocol versions, capabilities, cache policy, and result + type are never copied from the backend. ``identity`` controls whether server + identity remains the gateway's or uses the backend's when available. """ def __init__( @@ -1335,8 +1335,9 @@ class FastMCPProxy(FastMCP): provider_error_strategy: How provider errors should affect aggregate operations. Defaults to ``"warn"`` for compatibility; use ``"raise"`` when the proxy should surface upstream failures. - identity: Whether negotiation exposes the proxy's server identity or - the upstream server's. Defaults to ``"proxy"`` for compatibility. + identity: Whether negotiation retains the proxy's server identity or + uses the upstream server's when available. Defaults to ``"proxy"`` + for compatibility. **kwargs: Additional settings for the FastMCP server. """ super().__init__(**kwargs)